about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rwxr-xr-xscripts/build-many-glibcs.py3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 14e71d525a..5a930a9a76 100644
--- 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.
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 0c2ea85b5f..baa6704958 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: