From dfa6edfe5f040a16a10cf343ad27840aa7e166c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ozan=20=C3=87a=C4=9Flayan?= Date: Wed, 5 Jan 2011 12:15:25 +0000 Subject: [PATCH] comariface: Fix a case where names are not validated When name="xx-yy" is given explicitly in a tag, current code was not replacing the dash with an underscore causing D-Bus errors. This commit fixes this. --- pisi/comariface.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pisi/comariface.py b/pisi/comariface.py index 86247328..fe1c5236 100644 --- a/pisi/comariface.py +++ b/pisi/comariface.py @@ -108,7 +108,8 @@ def post_install(package_name, provided_scripts, for script in provided_scripts: ctx.ui.debug(_("Registering %s comar script") % script.om) - script_name = script.name if script.name else package_name + script_name = safe_script_name(script.name) \ + if script.name else package_name if script.om == "System.Package": self_post = True try: @@ -189,7 +190,8 @@ def post_remove(package_name, metapath, filepath, provided_scripts=[]): link = get_link() package_name = safe_script_name(package_name) - scripts = set([s.name for s in provided_scripts if s.name]) + scripts = set([safe_script_name(s.name) for s \ + in provided_scripts if s.name]) scripts.add(package_name) if package_name in list(link.System.Package):