From 938e165816be2bb3c1b1975a859665f0a9a0c96c Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Thu, 23 Sep 2010 13:07:34 +0200 Subject: Fixups in the retire function --- src/pyfedpkg/__init__.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index cfd9f3b..d2783d6 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -697,15 +697,19 @@ def push(path=None): return def retire(path, message=None): - """Retire a Fedora package""" + """Delete all tracked files and commit a new dead.package file + + Use optional message in commit. + + Runs the commands and returns nothing + + """ cmd = ['git', 'rm', '-rf', path] _run_command(cmd, cwd=path) - if message: - msg = message - else: - msg = 'Package is retired' + if not message: + msg = 'Package is retired' fd = open(os.path.join(path, 'dead.package'), 'w') fd.write(msg) @@ -714,7 +718,7 @@ def retire(path, message=None): cmd = ['git', 'add', os.path.join(path, 'dead.package')] _run_command(cmd, cwd=path) - commit (path, msg) + commit(path, msg) return -- cgit