comariface: Fix a case where names are not validated

When name="xx-yy" is given explicitly in a <COMAR> tag, current
code was not replacing the dash with an underscore causing D-Bus
errors.

This commit fixes this.
This commit is contained in:
Ozan Çağlayan
2011-01-05 12:15:25 +00:00
parent 7ae4827703
commit dfa6edfe5f
+4 -2
View File
@@ -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):