Commit 9b056731 authored by Simon McVittie's avatar Simon McVittie

Add --no-git-clean option

This can be used in a packaging-only git repository where you have
added an untracked copy of the source code.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 129c241d
......@@ -511,7 +511,8 @@ class SnapshotBuilder:
):
if os.path.exists('.git'):
self.in_srcdir.do(['git', 'status', '-u'])
self.in_srcdir.do(['git', 'clean', '-fxd'])
if self.args.git_clean:
self.in_srcdir.do(['git', 'clean', '-fxd'])
self.in_srcdir.do([
'env',
......@@ -632,7 +633,8 @@ class SnapshotBuilder:
if os.path.exists('.git'):
self.in_srcdir.do(['git', 'status', '-u'])
self.in_srcdir.do(['git', 'clean', '-fxd'])
if self.args.git_clean:
self.in_srcdir.do(['git', 'clean', '-fxd'])
# If the version in the changelog is not already what we want,
# make it so
......@@ -684,7 +686,8 @@ class SnapshotBuilder:
if self.args.i386 and not self.args.source_only:
if os.path.exists('.git'):
self.in_srcdir.do(['git', 'clean', '-fxd'])
if self.args.git_clean:
self.in_srcdir.do(['git', 'clean', '-fxd'])
self.in_srcdir.do([
'env',
......@@ -785,6 +788,11 @@ def main():
'--i386', help='Build i386 binaries too',
action='store_true', default=False)
parser.add_argument(
'--no-git-clean',
help='do not run `git clean`',
action='store_false', dest='git_clean', default=True)
parser.add_argument(
'--no-check', '--nocheck',
help='do not run build-time tests',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment