summaryrefslogtreecommitdiff
path: root/portato/backend
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 21:33:50 +0200
commit7b831112022ce45c6c683bd5c9c9b41a8c3c6015 (patch)
tree264cc7a262db4c51d9db9532d03b6aa238c275c8 /portato/backend
parentfd0724455c9df3a2e77e15bdc81011875051224f (diff)
downloadportato-7b831112022ce45c6c683bd5c9c9b41a8c3c6015.tar.gz
portato-7b831112022ce45c6c683bd5c9c9b41a8c3c6015.tar.bz2
portato-7b831112022ce45c6c683bd5c9c9b41a8c3c6015.zip
Do not bail out, if we try to replace stuff in a category w/o a dash
Diffstat (limited to '')
-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 810b607..6c74024 100644
--- a/portato/backend/flags.py
+++ b/portato/backend/flags.py
@@ -159,11 +159,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 ###