Don't double-include if global-requirements
global-requirements is a fully self-contained file, containing both
test and normal requirements. In the situation where the target repo
has a global-requirements.txt file, it should be treated as the only
file that matters- otherwise the mirror builder will hit double include
issues.
Change-Id: I01fd1e0d7f0923456f35a0f931159850cb52e3e7
diff --git a/jeepyb/cmd/run_mirror.py b/jeepyb/cmd/run_mirror.py
index 5ba2efd..5e54583 100644
--- a/jeepyb/cmd/run_mirror.py
+++ b/jeepyb/cmd/run_mirror.py
@@ -208,13 +208,15 @@
out = self.run_command("git reset --hard %s" % branch)
out = self.run_command("git clean -x -f -d -q")
reqlist = []
- for requires_file in ("global-requirements.txt",
- "requirements.txt",
- "test-requirements.txt",
- "tools/pip-requires",
- "tools/test-requires"):
- if os.path.exists(requires_file):
- reqlist.append(requires_file)
+ if os.path.exists('global-requirements.txt'):
+ reqlist.append('global-requirements.txt')
+ else:
+ for requires_file in ("requirements.txt",
+ "test-requirements.txt",
+ "tools/pip-requires",
+ "tools/test-requires"):
+ if os.path.exists(requires_file):
+ reqlist.append(requires_file)
if reqlist:
out = self.run_command(venv_format %
(pip_cache_dir, venv))