From fb1714cea7517ce4b77515130d04b206d0a9577d Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 10 Jan 2022 17:37:02 +0530 Subject: [PATCH] Do a prefix match on parent_cmd for important_commands Allows `important_commands` to work properly for upgrades launched by Paru by setting `"pacman --sync -u --` as the an important_command. --- scripts/snap_pac.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/snap_pac.py b/scripts/snap_pac.py index 302238a..594bac8 100755 --- a/scripts/snap_pac.py +++ b/scripts/snap_pac.py @@ -103,7 +103,8 @@ class ConfigProcessor: return self.config.get(section, f"{self.snapshot_type}_description")[:desc_limit] def check_important_commands(self, section): - return self.parent_cmd in json.loads(self.config.get(section, "important_commands")) + important_commands = json.loads(self.config.get(section, "important_commands")) + return any(self.parent_cmd.startswith(x) for x in important_commands) def check_important_packages(self, section): important_packages = json.loads(self.config.get(section, "important_packages"))