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:
+4
-2
@@ -108,7 +108,8 @@ def post_install(package_name, provided_scripts,
|
|||||||
|
|
||||||
for script in provided_scripts:
|
for script in provided_scripts:
|
||||||
ctx.ui.debug(_("Registering %s comar script") % script.om)
|
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":
|
if script.om == "System.Package":
|
||||||
self_post = True
|
self_post = True
|
||||||
try:
|
try:
|
||||||
@@ -189,7 +190,8 @@ def post_remove(package_name, metapath, filepath, provided_scripts=[]):
|
|||||||
link = get_link()
|
link = get_link()
|
||||||
|
|
||||||
package_name = safe_script_name(package_name)
|
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)
|
scripts.add(package_name)
|
||||||
|
|
||||||
if package_name in list(link.System.Package):
|
if package_name in list(link.System.Package):
|
||||||
|
|||||||
Reference in New Issue
Block a user