diff options
Diffstat (limited to 'src/pyfedpkg/__init__.py')
-rw-r--r-- | src/pyfedpkg/__init__.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/pyfedpkg/__init__.py b/src/pyfedpkg/__init__.py index 474053c..d2783d6 100644 --- a/src/pyfedpkg/__init__.py +++ b/src/pyfedpkg/__init__.py @@ -696,6 +696,32 @@ def push(path=None): _run_command(cmd, cwd=path) return +def retire(path, message=None): + """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 not message: + 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""" |