From: Daira Hopwood Date: Fri, 30 Jan 2015 22:05:54 +0000 (+0000) Subject: zetuptoolz: don't add ';' to an empty path when appending a new item. X-Git-Tag: allmydata-tahoe-1.10.1a1~26 X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/flags/status?a=commitdiff_plain;h=2480a162273fa7e75e9c82a804c45f8eca2ffadf;p=tahoe-lafs%2Ftahoe-lafs.git zetuptoolz: don't add ';' to an empty path when appending a new item. Signed-off-by: Daira Hopwood --- diff --git a/setuptools-0.6c16dev6.egg/setuptools/command/scriptsetup.py b/setuptools-0.6c16dev6.egg/setuptools/command/scriptsetup.py index db68c07a..b3233ec1 100644 --- a/setuptools-0.6c16dev6.egg/setuptools/command/scriptsetup.py +++ b/setuptools-0.6c16dev6.egg/setuptools/command/scriptsetup.py @@ -154,10 +154,16 @@ def do_scriptsetup(allusers=False): (value, type) = user_valueandtype or system_valueandtype or (u'', REG_SZ) key_name_path = (HKEY_CURRENT_USER, "HKEY_CURRENT_USER", USER_ENV) + def path_append(value, addition): + if value != "": + return value + u';' + addition + else: + return addition + if addition.lower() in value.lower().split(u';'): print "Already done: %s." % (goal,) else: - changed |= update(key_name_path, varname, value + u';' + addition, type, goal, what) + changed |= update(key_name_path, varname, path_append(value, addition), type, goal, what) if change_allusers: # Also change any overriding environment entry for the current user. @@ -167,7 +173,7 @@ def do_scriptsetup(allusers=False): if not (addition.lower() in split_value or u'%'+varname.lower()+u'%' in split_value): now_what = "the overriding user environment variable %s" % (varname,) changed |= update((HKEY_CURRENT_USER, "HKEY_CURRENT_USER", USER_ENV), - varname, user_value + u';' + addition, user_type, + varname, path_append(user_value, addition), user_type, "add %s to %s" % (addition, now_what), now_what) return changed