From b97338144e253fc4c2cfe17d484e730077fabe82 Mon Sep 17 00:00:00 2001 From: richardg867 Date: Fri, 15 Jul 2022 22:59:49 -0300 Subject: [PATCH 1/2] Jenkins: Allow macOS to make source tarballs --- .ci/Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index cb58e1fd8..b0c865083 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -215,7 +215,7 @@ pipeline { /* Create source tarball. */ try { retry(10) { - node('Linux') { + node('Linux || macOS') { /* Run git clone. */ gitClone(repository[buildBranch], branch[buildBranch]) From a1744ddbd209c54bce97deb62e86a4bc617d38e6 Mon Sep 17 00:00:00 2001 From: richardg867 Date: Fri, 15 Jul 2022 23:04:36 -0300 Subject: [PATCH 2/2] Jenkins: Install and use gnutar on macOS for source tarballs --- .ci/build.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index eeb22c9c2..da4169516 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -52,8 +52,20 @@ make_tar() { # Install dependencies. if ! which tar xz > /dev/null 2>&1 then - which apt-get > /dev/null 2>&1 && DEBIAN_FRONTEND=noninteractive sudo apt-get install -y tar xz-utils + if which apt-get > /dev/null 2>&1 + then + sudo apt-get update + DEBIAN_FRONTEND=noninteractive sudo apt-get install -y tar xz-utils + sudo apt-get clean + elif which port > /dev/null 2>&1 + then + sudo port install gnutar xz + fi fi + + # Prefer gnutar on macOS. + local tar_cmd=tar + which gnutar > /dev/null 2>&1 && tar_cmd=gnutar # Determine the best supported compression type. local compression_flag= @@ -80,7 +92,7 @@ make_tar() { # --uid/gid (bsdtar) or even none at all (MSYS2 bsdtar). Account for such # flag differences by checking if they're mentioned on the help text. local ownership_flags= - local tar_help=$(tar --help 2>&1) + local tar_help=$("$tar_cmd" --help 2>&1) if echo $tar_help | grep -q -- --owner then local ownership_flags="--owner=0 --group=0" @@ -90,7 +102,7 @@ make_tar() { fi # Run tar. - tar -c $compression_flag -f "$1$compression_ext" $ownership_flags * + "$tar_cmd" -c $compression_flag -f "$1$compression_ext" $ownership_flags * return $? }