diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-05-28 20:37:31 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-05-28 20:37:36 +0200 |
commit | 8cec5a37947accd0dbcc3ab58e6557c3ec347377 (patch) | |
tree | 8ecfe786e9b345455dcb9f02dc3a7f367b346355 | |
parent | b60f6140ef221d32ce43fb2ebacec41ed58fb00a (diff) | |
download | vyos-build-8cec5a37947accd0dbcc3ab58e6557c3ec347377.tar.gz vyos-build-8cec5a37947accd0dbcc3ab58e6557c3ec347377.zip |
Packages: add '--keep' option to not clean packages
By default all git repos are reset using 'git reset --hard' and cleaned using
'git clean -x -d -f'. A developer sometimes would like to keep his
changes and thus the --keep option was added.
-rwxr-xr-x | scripts/build-packages | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/build-packages b/scripts/build-packages index dcc74c05..aa73228a 100755 --- a/scripts/build-packages +++ b/scripts/build-packages @@ -98,7 +98,10 @@ def clone_package(pkg, log): First cleanup any possible leftovers from previous builds """ - if args.clean: + if args.keep: + log.debug("Keep possibly modified package '{}'".format(pkg['path'])) + return False + elif args.clean: # delete repository from disk if os.path.isdir(pkg['path']): log.debug("Cleaning '{}'".format(pkg['path'])) @@ -281,6 +284,9 @@ pkg_build = [] if __name__ == '__main__': parser = argparse.ArgumentParser() + exclusive = parser.add_mutually_exclusive_group(required=False) + exclusive.add_argument('-k', '--keep', action='store_true', help='Keep modified Git repositories') + parser.add_argument('-v', '--verbose', action='count', default=0, help='Increase logging verbosity for each occurance') parser.add_argument('-c', '--clean', action='store_true', help='Re-clone required Git repositories') parser.add_argument('-l', '--list-packages', action='store_true', help='List all packages to build') |