From 34a1d857659b5aa0456a33a603f12060f45704ab Mon Sep 17 00:00:00 2001 From: Jochen Schmitt Date: Tue, 21 Sep 2010 21:20:13 +0200 Subject: Implementing a retire command --- src/pyfedpkg/__init__.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/pyfedpkg') diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 474053c..cfd9f3b 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -696,6 +696,28 @@ def push(path=None): _run_command(cmd, cwd=path) return +def retire(path, message=None): + """Retire a Fedora package""" + + cmd = ['git', 'rm', '-rf', path] + _run_command(cmd, cwd=path) + + if message: + msg = message + else: + msg = 'Package is retired' + + fd = open(os.path.join(path, 'dead.package'), 'w') + fd.write(msg) + fd.close() + + cmd = ['git', 'add', os.path.join(path, 'dead.package')] + _run_command(cmd, cwd=path) + + commit (path, msg) + + return + def sources(path, outdir=None): """Download source files""" -- cgit