]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make build-many-glibcs.py clean git source directories.
authorJoseph Myers <joseph@codesourcery.com>
Mon, 29 Jan 2018 13:59:33 +0000 (13:59 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 29 Jan 2018 13:59:33 +0000 (13:59 +0000)
With the git checkouts of Hurd components in build-many-glibcs.py
involving running autoreconf, there's a risk that generated files
could be left behind by an old autoreconf run (if an old version of
the sources generates those files in the source directory but a new
version does not).

This patch avoids that by using git clean -dxfq when updating git
checkouts.  In this patch, that's conditional on --replace-sources, to
avoid removing any local not-checked-in files someone may have in
their checkout unless the option has been specifically passed that
says it's OK to blow old checkouts away, complete with any local
changes to them.

* scripts/build-many-glibcs.py (Context.git_checkout): Use git
clean -dxfq for git updates when replacing sources.

ChangeLog
scripts/build-many-glibcs.py

index 14e71d525ad0b01752a6d4dce859796366a84e09..5a930a9a76cb4bd76c0e9b7582adda208a0fc764 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2018-01-29  Joseph Myers  <joseph@codesourcery.com>
 
+       * scripts/build-many-glibcs.py (Context.git_checkout): Use git
+       clean -dxfq for git updates when replacing sources.
+
        * scripts/build-many-glibcs.py (Config.build_gcc): Use
        --disable-libcilkrts unconditionally, not just for the final GCC
        build for Hurd.
index 0c2ea85b5f904812a047ec6899d5f7f0a7de5698..baa670495872e484c96f94ab003d99b07fc36f9b 100755 (executable)
@@ -816,6 +816,9 @@ class Context(object):
         if update:
             subprocess.run(['git', 'remote', 'prune', 'origin'],
                            cwd=self.component_srcdir(component), check=True)
+            if self.replace_sources:
+                subprocess.run(['git', 'clean', '-dxfq'],
+                               cwd=self.component_srcdir(component), check=True)
             subprocess.run(['git', 'pull', '-q'],
                            cwd=self.component_srcdir(component), check=True)
         else: