summaryrefslogtreecommitdiff
path: root/portato/backend/flags.py
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2010-05-25 20:50:51 +0200
committerRené 'Necoro' Neumann <necoro@necoro.net>2010-05-25 20:50:51 +0200
commitefccd35b43ab610e762d353bc917d3afb17c9a61 (patch)
tree24af5ebb3634c993020a63ce0d76bd339f065260 /portato/backend/flags.py
parentdc35f38780c3efeb2ea9d0b14c4ed0d3902c0342 (diff)
downloadportato-efccd35b43ab610e762d353bc917d3afb17c9a61.tar.gz
portato-efccd35b43ab610e762d353bc917d3afb17c9a61.tar.bz2
portato-efccd35b43ab610e762d353bc917d3afb17c9a61.zip
Do not bail out, if we try to replace stuff in a category w/o a dash
Diffstat (limited to 'portato/backend/flags.py')
-rw-r--r--portato/backend/flags.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/portato/backend/flags.py b/portato/backend/flags.py
index 45826c3..27f7a11 100644
--- a/portato/backend/flags.py
+++ b/portato/backend/flags.py
@@ -157,11 +157,17 @@ def generate_path (cpv, exp):
cat, pkg, ver, rev = system.split_cpv(cpv)
if rev != "r0":
ver = "%s-%s" % (ver, rev)
+
exp = exp.replace("$(cat)",cat).\
replace("$(pkg)",pkg).\
replace("$(cat-1)",cat.split("-")[0]).\
- replace("$(cat-2)",cat.split("-")[1]).\
replace("$(version)",ver)
+
+ try:
+ exp = exp.replace("$(cat-2)",cat.split("-")[1])
+ except IndexError: # category only consists of one part -- ignore
+ pass
+
return exp
### USE FLAG PART ###