From a3798575ab5e37379cadb45215df76b867ffd6f5 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Wed, 19 Jul 2000 05:42:36 +0000 Subject: [PATCH] If the menu_command contain a kdesu -c "", check instead for the command instead of kdesu. git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@199 9bc8b190-ac0f-0410-8968-dc7d1f502856 --- MenuCheck.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/MenuCheck.py b/MenuCheck.py index c01c39f0..18821396 100644 --- a/MenuCheck.py +++ b/MenuCheck.py @@ -92,6 +92,7 @@ class MenuCheck(AbstractCheck.AbstractCheck): section=re.compile("section=(\"([^\"]+)\"|([^ \t\"]+))") title=re.compile("title=(\"([^\"]+)\"|([^ \t\"]+))") command=re.compile("command=\"?([^\" ]+)") + kdesu_command=re.compile("command=\"?kdesu -c \"?([^\" ]+)") icon=re.compile("icon=\"?([^\" ]+)") valid_sections=Config.getOption("ValidMenuSections", DEFAULT_VALID_SECTIONS) update_menus=re.compile("^[^#]*update-menus",re.MULTILINE) @@ -174,13 +175,18 @@ class MenuCheck(AbstractCheck.AbstractCheck): if res: command=res.group(1) try: - if command[0] == '/': - files[command] + if command[:5] == 'kdesu': + res2=MenuCheck.kdesu_command.search(line) + command2=res2.group(1) + files[command2] else: - if not (files.has_key("/bin/" + command) or - files.has_key("/usr/bin/" + command) or - files.has_key("/usr/X11R6/bin/" + command)): - raise KeyError, command + if command[0] == '/': + files[command] + else: + if not (files.has_key("/bin/" + command) or + files.has_key("/usr/bin/" + command) or + files.has_key("/usr/X11R6/bin/" + command)): + raise KeyError, command except KeyError: printWarning(pkg, "menu-command-not-in-package", command) else: