From: Guido Günther Date: Fri, 22 Mar 2013 17:14:33 +0000 (+0100) Subject: Purging of the build dir should be configurable via a config file X-Git-Tag: debian/0.6.0_git20130329~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc9d019eb9af759c46a7a183d69e248275afe6bc;p=tools%2Fgit-buildpackage.git Purging of the build dir should be configurable via a config file so introdice --git[-no]-purge which is consistent with the other boolean options and deprecate --git-dont-purge. Closes: #702200 --- diff --git a/docs/chapters/building.sgml b/docs/chapters/building.sgml index 5005416..159f476 100644 --- a/docs/chapters/building.sgml +++ b/docs/chapters/building.sgml @@ -68,7 +68,7 @@ export-dir=../build-area #export-dir=/home/debian-packages/build-area &git-buildpackage; will cleanup the build-area after a successful build. If - you want to keep the build tree use --git-dont-purge. + you want to keep the build tree use --git-no-purge. diff --git a/docs/manpages/git-buildpackage.sgml b/docs/manpages/git-buildpackage.sgml index 3e640d4..d528f3d 100644 --- a/docs/manpages/git-buildpackage.sgml +++ b/docs/manpages/git-buildpackage.sgml @@ -53,6 +53,7 @@ treeish + @@ -390,10 +391,17 @@ + + + + Purge (remove) temporary build directory after build + + + - retain exported build directory after build + Deprecated, use --git-no-purge instead. diff --git a/gbp/config.py b/gbp/config.py index cec593b..ec75765 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -131,6 +131,7 @@ class GbpOptionParser(OptionParser): 'remote-config': '', 'allow-unauthenticated': 'False', 'symlink-orig': 'True', + 'purge': 'True', } help = { 'debian-branch': @@ -262,7 +263,9 @@ class GbpOptionParser(OptionParser): 'symlink-orig': ("Whether to creat a symlink from the upstream tarball " "to the orig.tar.gz if needed, default is " - "'%(symlink-orig)s'") + "'%(symlink-orig)s'"), + 'purge': + "Purge exported package build directory. Default is '%(purge)s'", } def_config_files = [ '/etc/git-buildpackage/gbp.conf', diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 09d4082..c021b86 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -1,6 +1,6 @@ # vim: set fileencoding=utf-8 : # -# (C) 2006-2011 Guido Guenther +# (C) 2006-2013 Guido Günther # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -425,8 +425,9 @@ def parse_args(argv, prefix): help="before building the package export the source into EXPORT_DIR, default is '%(export-dir)s'") export_group.add_config_file_option("export", dest="export", help="export treeish object TREEISH, default is '%(export)s'", metavar="TREEISH") - export_group.add_option("--git-dont-purge", action="store_false", dest="purge", default=True, - help="retain exported package build directory") + export_group.add_boolean_config_file_option(option_name="purge", dest="purge") + export_group.add_option("--git-dont-purge", action="store_true", dest="dont_purge", default=False, + help="deprecated, use --git-no-purge instead") export_group.add_boolean_config_file_option(option_name="overlay", dest="overlay") options, args = parser.parse_args(args) @@ -440,6 +441,11 @@ def parse_args(argv, prefix): gbp.log.err("Overlay must be used with --git-export-dir") return None, None, None + # --git-dont-purge is deprecated: + if options.dont_purge: + gbp.log.warning("--git-dont-purge is depreceted, use --git-no-purge instead") + options.purge = False + return options, args, dpkg_args