Fix generate_update_tarball.py for build server
- Kokoro's repo_config style checkout doesn't actually do linkfile
rules. Thus, when the update tarball script runs make, it throws an
error due to no makefile existing, even though commands like m work.
- Add a -f build/Makefile parameter to the make invocations, so that the
Makefile being linked into the rootdir doesn't actually matter.
Change-Id: I8158d5e174c5be57b13e9170dd5538644410eb20
(cherry picked from commit b51708c3e360b58e4c0d59cca03798817c63ba2a)
diff --git a/generate_update_tarball.py b/generate_update_tarball.py
index dc30766..8cf6094 100755
--- a/generate_update_tarball.py
+++ b/generate_update_tarball.py
@@ -65,15 +65,17 @@
else:
return True
-def GetSourceDirectory(package):
- proc = subprocess.run(['make', package + '-source-directory'], stdout=subprocess.PIPE, universal_newlines=True)
+def GetSourceDirectory(rootdir, package):
+ proc = subprocess.run(['make', '-f', os.path.join(rootdir, 'build', 'Makefile'),
+ package + '-source-directory'],
+ stdout=subprocess.PIPE, universal_newlines=True)
proc.check_returncode()
for line in proc.stdout.split(os.linesep):
if line.startswith('Source directory: '):
return line.split(': ')[1]
def CheckVersionTags(rootdir, package, version):
- source_dir = os.path.join(rootdir, GetSourceDirectory(package))
+ source_dir = os.path.join(rootdir, GetSourceDirectory(rootdir, package))
debian_dir = os.path.join(rootdir, 'packages', package)
source_repo = Repo(source_dir)
debian_repo = Repo(debian_dir)
@@ -131,7 +133,8 @@
for package in packages_to_update:
print('make ' + package + '...')
for arch in ARCHES:
- proc = subprocess.run(["make", "USERSPACE_ARCH="+arch, package], stdout=sys.stdout, stderr=sys.stderr)
+ proc = subprocess.run(["make", "-f", os.path.join(args.rootdir, 'build', 'Makefile'),
+ "USERSPACE_ARCH="+arch, package], stdout=sys.stdout, stderr=sys.stderr)
proc.check_returncode()
# Find the set of output files corresponding to the packages we are going to upload.