diff --git a/CHANGES.md b/CHANGES.md index 37588c0..63ef091 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## 2.4.9 (unreleased) -- Nothing changed yet. +- Fix `PurgePackage` raising error when package is not found. ## 2.4.8 (2024-05-08) diff --git a/src/batou_ext/nix.py b/src/batou_ext/nix.py index 0c4e13a..742c334 100644 --- a/src/batou_ext/nix.py +++ b/src/batou_ext/nix.py @@ -95,7 +95,7 @@ def verify(self): self.cmd(f"nix-env --query {self.package}") raise batou.UpdateNeeded() except batou.utils.CmdExecutionError as e: - if e.stderr.endswith("matches no derivations"): + if e.stderr.strip().endswith("matches no derivations"): batou.output.annotate( f"Could not find package to purge: {self.package}", yellow=True,