From 8b71eed2f8ef0714aba080ded2fcb96630b77d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Sun, 20 Jul 2008 19:18:50 +0200 Subject: Added "$(version)" for the config file naming. --- etc/portato.cfg | 7 +- portato/backend/flags.py | 6 +- portato/gui/templates/PreferenceWindow.glade | 191 ++++++++++++++------------- 3 files changed, 105 insertions(+), 99 deletions(-) diff --git a/etc/portato.cfg b/etc/portato.cfg index 044d0b7..1abb709 100644 --- a/etc/portato.cfg +++ b/etc/portato.cfg @@ -35,9 +35,10 @@ deep = true ; control the name of the particular file if package.* is a directory - string values ; allowed placeholders: -; - $(pkg) : package-name -; - $(cat) : category-name -; - $(cat-1)/$(cat-2) : first/second part of the category name +; - $(pkg) : package name +; - $(cat) : category +; - $(cat-1)/$(cat-2) : first/second part of the category +; - $(version) : version of the package usefile = portato maskfile = portato keywordfile = portato diff --git a/portato/backend/flags.py b/portato/backend/flags.py index fc99651..b151665 100644 --- a/portato/backend/flags.py +++ b/portato/backend/flags.py @@ -151,6 +151,7 @@ def generate_path (cpv, exp): - $(cat-1): first part of the category (e.g. "app") - $(cat-2): second part of the category - $(pkg) : name of the package + - $(version) : version of the package @param cpv: the cpv of the current package @type cpv: string (cat/pkg-ver) @@ -161,10 +162,13 @@ def generate_path (cpv, exp): if exp.find("$(") != -1: 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("$(cat-2)",cat.split("-")[1]).\ + replace("$(version)",ver) return exp ### USE FLAG PART ### diff --git a/portato/gui/templates/PreferenceWindow.glade b/portato/gui/templates/PreferenceWindow.glade index e5a5e75..46d2a39 100644 --- a/portato/gui/templates/PreferenceWindow.glade +++ b/portato/gui/templates/PreferenceWindow.glade @@ -1,6 +1,6 @@ - + 5 @@ -250,189 +250,190 @@ - + True + 0 + 5 + <u><i>Masking Keywords</i></u> + True + True - 1 - 2 - 3 - 4 + 7 + 8 + 5 - + True 0 - File name to use, if package.use is a directory: + 5 + <u><i>Testing Keywords</i></u> + True True - 3 - 4 + 4 + 5 + 5 - + True - Add only exact version to package.use - 0 - True + 0 + 5 + <u><i>Use-Flags</i></u> + True + True + + + 1 + 2 + 6 + + + + + True + + + True + 0 + GTK_SHADOW_OUT + + + True + 0 + <u>You may use the following placeholders:</u> + +<i>$(pkg)</i>: package name +<i>$(cat)</i>: category +<i>$(cat-1)/$(cat-2)</i>: first/second part of the category +<i>$(version)</i> : version of the package + True + + + + + + label_item + + + + 2 - 2 - 3 - + True - Add only exact version to package.keywords + Add only exact version to package.mask/package.unmask 0 True 2 - 5 - 6 + 8 + 9 - + True 0 - File name to use, if package.keywords is a directory: + File name to use, if package.mask/package.unmask is a directory: True - 6 - 7 + 9 + 10 - + True 1 2 - 6 - 7 + 9 + 10 - + True 1 2 - 9 - 10 + 6 + 7 - + True 0 - File name to use, if package.mask/package.unmask is a directory: + File name to use, if package.keywords is a directory: True - 9 - 10 + 6 + 7 - + True - Add only exact version to package.mask/package.unmask + Add only exact version to package.keywords 0 True 2 - 8 - 9 + 5 + 6 - + True - - - True - 0 - GTK_SHADOW_OUT - - - True - 0 - <u>You may use the following placeholders:</u> - -<i>$(cat)</i>: category -<i>$(pkg)</i>: package name -<i>$(cat-1)/$(cat-2)</i>: first/second part of the category - True - - - - - - label_item - - - - + Add only exact version to package.use + 0 + True 2 + 2 + 3 - - True - 0 - 5 - <u><i>Use-Flags</i></u> - True - True - - - 1 - 2 - 6 - - - - + True 0 - 5 - <u><i>Testing Keywords</i></u> - True + File name to use, if package.use is a directory: True - 4 - 5 - 5 + 3 + 4 - + True - 0 - 5 - <u><i>Masking Keywords</i></u> - True - True - 7 - 8 - 5 + 1 + 2 + 3 + 4 -- cgit v1.2.3