diff options
| author | Ross Burton <ross.burton@arm.com> | 2020-06-15 14:44:13 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-16 23:39:28 +0100 |
| commit | 2ea4530918792e54c800635eec9c1fd54689b66b (patch) | |
| tree | 1122cdfbca1980d72e76fc8fb6a9c31f6e187717 | |
| parent | 7bf4949eaa4a48295ab6190538df807144c116e5 (diff) | |
| download | poky-2ea4530918792e54c800635eec9c1fd54689b66b.tar.gz | |
install-buildtools: remove hardcoded x86-64 architecture
Remove all instances of the hardcoded 'x86_64' and replace with the current
host platform.
(From OE-Core rev: 52dc6f671ff67a1149be7ef4c65126ea3c907a3d)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rwxr-xr-x | scripts/install-buildtools | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/scripts/install-buildtools b/scripts/install-buildtools index d722519f0f..a9173fa096 100755 --- a/scripts/install-buildtools +++ b/scripts/install-buildtools | |||
| @@ -35,6 +35,7 @@ | |||
| 35 | import argparse | 35 | import argparse |
| 36 | import logging | 36 | import logging |
| 37 | import os | 37 | import os |
| 38 | import platform | ||
| 38 | import re | 39 | import re |
| 39 | import shutil | 40 | import shutil |
| 40 | import shlex | 41 | import shlex |
| @@ -112,6 +113,7 @@ def main(): | |||
| 112 | release = "" | 113 | release = "" |
| 113 | buildtools_url = "" | 114 | buildtools_url = "" |
| 114 | install_dir = "" | 115 | install_dir = "" |
| 116 | arch = platform.machine() | ||
| 115 | 117 | ||
| 116 | parser = argparse.ArgumentParser( | 118 | parser = argparse.ArgumentParser( |
| 117 | description="Buildtools installation helper", | 119 | description="Buildtools installation helper", |
| @@ -194,19 +196,19 @@ def main(): | |||
| 194 | logger.error("Milestone installers require --build-date") | 196 | logger.error("Milestone installers require --build-date") |
| 195 | else: | 197 | else: |
| 196 | if args.with_extended_buildtools: | 198 | if args.with_extended_buildtools: |
| 197 | filename = "x86_64-buildtools-extended-nativesdk-standalone-%s-%s.sh" % ( | 199 | filename = "%s-buildtools-extended-nativesdk-standalone-%s-%s.sh" % ( |
| 198 | args.installer_version, args.build_date) | 200 | arch, args.installer_version, args.build_date) |
| 199 | else: | 201 | else: |
| 200 | filename = "x86_64-buildtools-nativesdk-standalone-%s-%s.sh" % ( | 202 | filename = "%s-buildtools-nativesdk-standalone-%s-%s.sh" % ( |
| 201 | args.installer_version, args.build_date) | 203 | arch, args.installer_version, args.build_date) |
| 202 | safe_filename = quote(filename) | 204 | safe_filename = quote(filename) |
| 203 | buildtools_url = "%s/milestones/%s/buildtools/%s" % (base_url, args.release, safe_filename) | 205 | buildtools_url = "%s/milestones/%s/buildtools/%s" % (base_url, args.release, safe_filename) |
| 204 | # regular release SDK | 206 | # regular release SDK |
| 205 | else: | 207 | else: |
| 206 | if args.with_extended_buildtools: | 208 | if args.with_extended_buildtools: |
| 207 | filename = "x86_64-buildtools-extended-nativesdk-standalone-%s.sh" % args.installer_version | 209 | filename = "%s-buildtools-extended-nativesdk-standalone-%s.sh" % (arch, args.installer_version) |
| 208 | else: | 210 | else: |
| 209 | filename = "x86_64-buildtools-nativesdk-standalone-%s.sh" % args.installer_version | 211 | filename = "%s-buildtools-nativesdk-standalone-%s.sh" % (arch, args.installer_version) |
| 210 | safe_filename = quote(filename) | 212 | safe_filename = quote(filename) |
| 211 | buildtools_url = "%s/%s/buildtools/%s" % (base_url, args.release, safe_filename) | 213 | buildtools_url = "%s/%s/buildtools/%s" % (base_url, args.release, safe_filename) |
| 212 | 214 | ||
| @@ -279,8 +281,8 @@ def main(): | |||
| 279 | # Setup the environment | 281 | # Setup the environment |
| 280 | logger.info("Setting up the environment") | 282 | logger.info("Setting up the environment") |
| 281 | regex = re.compile(r'^(?P<export>export )?(?P<env_var>[A-Z_]+)=(?P<env_val>.+)$') | 283 | regex = re.compile(r'^(?P<export>export )?(?P<env_var>[A-Z_]+)=(?P<env_val>.+)$') |
| 282 | with open("%s/environment-setup-x86_64-pokysdk-linux" % | 284 | with open("%s/environment-setup-%s-pokysdk-linux" % |
| 283 | install_dir, 'rb') as f: | 285 | (install_dir, arch), 'rb') as f: |
| 284 | for line in f: | 286 | for line in f: |
| 285 | match = regex.search(line.decode('utf-8')) | 287 | match = regex.search(line.decode('utf-8')) |
| 286 | logger.debug("export regex: %s" % match) | 288 | logger.debug("export regex: %s" % match) |
