commit dbae1e7f8b3424375d3af0fae4b41a1cc89a68e3
Author: Till Maas <opensource(a)till.name>
Date: Sat Sep 7 10:31:21 2013 +0200
Retirement adjustments
- Exclude correct status code
- always inform if package is already retired
- add constants for status codes
pkgdb-cli | 17 +++++++++++++----
1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/pkgdb-cli b/pkgdb-cli
index ce1487c..f0b44c2 100755
--- a/pkgdb-cli
+++ b/pkgdb-cli
@@ -35,6 +35,13 @@ bold = "\033[1m"
red = "\033[0;31m"
reset = "\033[0;0m"
+STATUS_ACTIVE = 1
+STATUS_APPROVED = 3
+STATUS_DENIED = 10
+STATUS_ORPHANED = 14
+STATUS_UNDER_DEVELOPMENT = 18
+STATUS_RETIRED = 20
+
# Initial simple logging stuff
logging.basicConfig()
log = logging.getLogger("pkgdb")
@@ -946,7 +953,7 @@ def retire_package(packagename, branch='devel',
allpkgs=False,
pkgs = [packagename]
for pkg in pkgs:
- branches = _get_active_branches(pkg, 1)
+ branches = _get_active_branches(pkg, not_statuscode=STATUS_RETIRED)
if branch == "all":
log.debug("Retire in all branches")
for branch in branches:
@@ -955,9 +962,11 @@ def retire_package(packagename, branch='devel',
allpkgs=False,
username=username, password=password)
else:
if branch not in branches:
- log.info(
- 'Package {0} on {1} is already retired'
- ''.format(pkg, branch))
+ print "{0}{1} is already retired in {2}{3}\n".format(
+ bold,
+ packagename,
+ branch,
+ reset)
else:
_retire_one_package(pkg, branch, username, password)
Show replies by date