summaryrefslogtreecommitdiff
path: root/geneticone/backend/flags.py
diff options
context:
space:
mode:
Diffstat (limited to 'geneticone/backend/flags.py')
-rw-r--r--geneticone/backend/flags.py25
1 files changed, 13 insertions, 12 deletions
diff --git a/geneticone/backend/flags.py b/geneticone/backend/flags.py
index 1d2f321..cb26935 100644
--- a/geneticone/backend/flags.py
+++ b/geneticone/backend/flags.py
@@ -301,19 +301,20 @@ def write_use_flags ():
insert(flag,l)
file_cache[file][line-1] = " ".join(l)
+ if flagsToAdd:
# write new lines
- msg = "\n#geneticone update#\n"
- if CONFIG["usePerVersion"]: # add on a per-version-base
- msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
- else: # add on a per-package-base
- list = split_package_name(cpv)
- msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
- if not file in file_cache:
- f = open(file, "a")
- f.write(msg)
- f.close()
- else:
- file_cache[file].append(msg)
+ msg = "\n#geneticone update#\n"
+ if CONFIG["usePerVersion"]: # add on a per-version-base
+ msg += "=%s %s\n" % (cpv, ' '.join(flagsToAdd))
+ else: # add on a per-package-base
+ list = split_package_name(cpv)
+ msg += "%s/%s %s\n" % (list[0], list[1], ' '.join(flagsToAdd))
+ if not file in file_cache:
+ f = open(file, "a")
+ f.write(msg)
+ f.close()
+ else:
+ file_cache[file].append(msg)
# write to disk
for file in file_cache.keys():