diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2020-06-11 15:58:44 +0200 |
---|---|---|
committer | Ilya Leoshkevich <iii@linux.ibm.com> | 2020-06-24 17:57:53 +0200 |
commit | 796190e538c96c28b5803f6d3dab1add87950c0e (patch) | |
tree | 995eeb0571ca077a3fae0c26138f2c76483c2e84 /contrib | |
parent | 134f7c941929b3d099322a89928c04e5ac69267e (diff) | |
download | gcc-796190e538c96c28b5803f6d3dab1add87950c0e.zip gcc-796190e538c96c28b5803f6d3dab1add87950c0e.tar.gz gcc-796190e538c96c28b5803f6d3dab1add87950c0e.tar.bz2 |
Make contrib/download_prerequisites work on AIX and OpenBSD
contrib/ChangeLog:
2020-06-11 Ilya Leoshkevich <iii@linux.ibm.com>
* download_prerequisites: Support AIX and OpenBSD unames.
Pipe `{gzip,bzip2} -d` to `tar -xf -`.
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/download_prerequisites | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites index aa0356e6..da19913 100755 --- a/contrib/download_prerequisites +++ b/contrib/download_prerequisites @@ -47,9 +47,12 @@ force=0 OS=$(uname) case $OS in - "Darwin"|"FreeBSD"|"DragonFly") + "Darwin"|"FreeBSD"|"DragonFly"|"AIX") chksum='shasum -a 512 --check' ;; + "OpenBSD") + chksum='sha512 -c' + ;; *) chksum='sha512sum -c' ;; @@ -242,8 +245,19 @@ for ar in $(echo_archives) do package="${ar%.tar*}" if [ ${force} -gt 0 ]; then rm -rf "${directory}/${package}"; fi + case $ar in + *.gz) + uncompress='gzip -d' + ;; + *.bz2) + uncompress='bzip2 -d' + ;; + *) + uncompress='cat' + ;; + esac [ -e "${directory}/${package}" ] \ - || ( cd "${directory}" && tar -xf "${ar}" ) \ + || ( cd "${directory}" && $uncompress <"${ar}" | tar -xf - ) \ || die "Cannot extract package from ${ar}" unset package done |