summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2015-06-27 00:10:42 +0200
committerGilles Dartiguelongue <eva@gentoo.org>2015-06-27 00:14:43 +0200
commit86f443210464a83721be581cc00cfe08dc5632bd (patch)
tree8fe868123bad34e2c0b957c5ac2364eb53904e70 /scripts
parentscripts/gen_archlist: do not add skipped lines to ALL_CPV_KWS (diff)
downloadgnome-86f443210464a83721be581cc00cfe08dc5632bd.tar.gz
gnome-86f443210464a83721be581cc00cfe08dc5632bd.tar.bz2
gnome-86f443210464a83721be581cc00cfe08dc5632bd.zip
scripts/gen_archlist: simplify logic of file parsing
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_archlist.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
index 1633dfac..21a196fc 100755
--- a/scripts/gen_archlist.py
+++ b/scripts/gen_archlist.py
@@ -486,11 +486,14 @@ def main():
})
ALL_CPV_KWS = []
- for i in open(args.file).readlines():
- cp = i[:-1]
- if cp.startswith('#') or cp.isspace() or not cp:
+ for line in open(args.file).readlines():
+ cp = line.strip()
+
+ # Filter useless lines
+ if not cp or cp.startswith('#'):
continue
- if cp.find('#') is not -1:
+
+ if '#' in cp:
raise Exception('Inline comments are not supported')
# Convert line to CPV(s)