[hurd,commited,3/7] hurd: make build-many-glibcs.py use mainline mig

Message ID alpine.DEB.2.20.1801291359520.31692@digraph.polyomino.org.uk
State Committed, archived
Headers

Commit Message

Joseph Myers Jan. 29, 2018, 2 p.m. UTC
  Followup committed:

Make build-many-glibcs.py clean git source directories.

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.

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.
  

Patch

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 0c2ea85..baa6704 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -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: