summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Keating <jkeating@redhat.com>2010-09-23 13:07:34 +0200
committerJesse Keating <jkeating@redhat.com>2010-09-23 13:07:34 +0200
commit938e165816be2bb3c1b1975a859665f0a9a0c96c (patch)
tree31aea8a1a682f3a9caa980c49a1065b132905a2a
parent34a1d857659b5aa0456a33a603f12060f45704ab (diff)
downloadfedora-packager-938e165816be2bb3c1b1975a859665f0a9a0c96c.tar.gz
fedora-packager-938e165816be2bb3c1b1975a859665f0a9a0c96c.tar.xz
fedora-packager-938e165816be2bb3c1b1975a859665f0a9a0c96c.zip
Fixups in the retire function
-rw-r--r--src/pyfedpkg/__init__.py16
1 files changed, 10 insertions, 6 deletions
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