From de55a96e9c0e967737e5e91dc304a89218aa8b32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 14:09:46 +0200 Subject: [PATCH 01/13] bz2 support --- utils/buildLabel.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/buildLabel.sh b/utils/buildLabel.sh index 6b200df..17b2663 100755 --- a/utils/buildLabel.sh +++ b/utils/buildLabel.sh @@ -265,7 +265,7 @@ echo "archivePath: $archivePath" # So we want to investigate which one has the filename try1archiveName=${${archiveTempName##*/}%%\?*} try2archiveName=${${archivePath##*/}%%\?*} -fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz|gz)$' # regular expression for matching +fileName_re='^([a-zA-Z0-9\_.%-]*)\.(dmg|pkg|zip|tbz|gz|bz2)$' # regular expression for matching if [[ "${try1archiveName}" =~ $fileName_re ]]; then archiveName=${try1archiveName} elif [[ "${try2archiveName}" =~ $fileName_re ]]; then @@ -293,7 +293,7 @@ if [ "$archiveExt" = "pkg" ]; then elif [ "$archiveExt" = "dmg" ]; then echo "Diskimage found" dmgInvestigation -elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ]; then +elif [ "$archiveExt" = "zip" ] || [ "$archiveExt" = "tbz" ] || [ "$archiveExt" = "bz2" ]; then echo "Compressed file found" # unzip the archive tar -xf "$archiveName" From cd441c88d9d1dc5c7ca594e2756cd9db2c6f6e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 14:13:31 +0200 Subject: [PATCH 02/13] bz2 support as tbz. --- fragments/main.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fragments/main.sh b/fragments/main.sh index 4cf42fb..48b277c 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -75,7 +75,7 @@ printlog "Label type: $type" INFO # MARK: extract info from data if [ -z "$archiveName" ]; then case $type in - dmg|pkg|zip|tbz) + dmg|pkg|zip|tbz|bz2) archiveName="${name}.$type" ;; pkgInDmg) @@ -101,7 +101,7 @@ fi if [ -z "$targetDir" ]; then case $type in - dmg|zip|tbz|app*) + dmg|zip|tbz|bz2|app*) targetDir="/Applications" ;; pkg*) @@ -282,7 +282,7 @@ case $type in zip) installFromZIP ;; - tbz) + tbz|bz2) installFromTBZ ;; pkgInDmg) From 759974f051d5b9c356cf4d4435492eb453c190c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 14:13:41 +0200 Subject: [PATCH 03/13] cocoapods labels --- fragments/labels/cocoapods.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 fragments/labels/cocoapods.sh diff --git a/fragments/labels/cocoapods.sh b/fragments/labels/cocoapods.sh new file mode 100644 index 0000000..1ebc7a3 --- /dev/null +++ b/fragments/labels/cocoapods.sh @@ -0,0 +1,7 @@ +cocoapods) + name="CocoaPods" + type="bz2" + downloadURL="$(downloadURLFromGit CocoaPods CocoaPods-app)" + appNewVersion="$(versionFromGit CocoaPods CocoaPods-app)" + expectedTeamID="AX2Q2BH2XR" + ;; From 780bc3924b24c8e4c6817578b07b8a8e211371be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 14:30:29 +0200 Subject: [PATCH 04/13] Minor change if `archiveName` is used Only return the last URL, if more lines are returned on the `archiveName` grep. --- fragments/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index a14c406..011f45c 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -160,7 +160,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name if [ -n "$archiveName" ]; then #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*") + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1) else #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype") From 9c155d3fed5b83ca2f5c97225f384dce0c5c1840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 14:30:41 +0200 Subject: [PATCH 05/13] WIth `archiveName` --- fragments/labels/cocoapods.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/fragments/labels/cocoapods.sh b/fragments/labels/cocoapods.sh index 1ebc7a3..6b5c8a2 100644 --- a/fragments/labels/cocoapods.sh +++ b/fragments/labels/cocoapods.sh @@ -1,6 +1,7 @@ cocoapods) name="CocoaPods" type="bz2" + archiveName="CocoaPods.app-[0-9.]*.tar.bz2" downloadURL="$(downloadURLFromGit CocoaPods CocoaPods-app)" appNewVersion="$(versionFromGit CocoaPods CocoaPods-app)" expectedTeamID="AX2Q2BH2XR" From 25c39caafccc180cf38246a9fa8413673542a105 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Fri, 19 Aug 2022 15:07:44 +0200 Subject: [PATCH 06/13] =?UTF-8?q?Also=20without=20`archiveName`=20?= =?UTF-8?q?=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … do we only need on line result. So `tail -1` has been added to the other part as well. Several labels failed in test. --- fragments/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 011f45c..63e7049 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -163,7 +163,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1) else #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype") + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1) fi if [ -z "$downloadURL" ]; then cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR From f689f7e10cf3bc97d03fdf03599b24445f836f8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 23 Aug 2022 13:37:30 +0200 Subject: [PATCH 07/13] a fix for how this script detect versions in github Replaced it with the one from functions.sh --- utils/checkLabels.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index c682717..90b9433 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -63,7 +63,7 @@ versionFromGit() { # $1 git user name, $2 git repo name gitusername=${1?:"no git user name"} gitreponame=${2?:"no git repo name"} - appNewVersion=$(curl --silent --fail "https://github.com/$gitusername/$gitreponame/releases/latest" | sed -E 's/.*tag\/(.*)\">.*/\1/g' | sed 's/[^0-9\.]//g') + appNewVersion=$(curl -sLI "https://github.com/$gitusername/$gitreponame/releases/latest" | grep -i "^location" | tr "/" "\n" | tail -1 | sed 's/[^0-9\.]//g') if [ -z "$appNewVersion" ]; then printlog "could not retrieve version number for $gitusername/$gitreponame: $appNewVersion" exit 9 From 1521ade445bad523ce14961401d03577eff187ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 23 Aug 2022 14:35:27 +0200 Subject: [PATCH 08/13] `bz2` support in `checkLabels.sh` --- utils/checkLabels.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 90b9433..19b2e41 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -54,7 +54,14 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name #githubPart="$gitusername/$gitreponame/releases/download" #echo "$githubPart" - downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest" + #downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest" + if [ -n "$archiveName" ]; then + #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1) + else + #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1) + fi echo "$downloadURL" return 0 } @@ -188,7 +195,7 @@ for fixedArch in i386 arm64; do echo "Download URL: $downloadURL" echo "Type: $type" case $type in - dmg|pkg|zip|tbz) + dmg|pkg|zip|tbz|bz2) expectedExtension="$type" ;; pkgInDmg) From 916da6283e1f7227e5bffb192906b24a1c9d1863 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 23 Aug 2022 15:10:55 +0200 Subject: [PATCH 09/13] Change mathing on `archiveName` for GitHub. --- fragments/functions.sh | 2 +- utils/checkLabels.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 63e7049..3ecf8b0 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -160,7 +160,7 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name if [ -n "$archiveName" ]; then #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1) + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1) else #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1) diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 19b2e41..0cbccb6 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -56,11 +56,9 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name #echo "$githubPart" #downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest" if [ -n "$archiveName" ]; then - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName.*" | tail -1) + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1) else - #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1) + downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$type" | tail -1) fi echo "$downloadURL" return 0 @@ -249,6 +247,9 @@ for fixedArch in i386 arm64; do fi else githubPart="$(echo "$downloadURL" | cut -d "/" -f4-6)" + echo "type: $type" + echo "archiveName: $archiveName" + echo "githubPart: $githubPart" if [[ "$(curl -fsL "$downloadURL" | grep -io "${githubPart}.*\.${expectedExtension}")" != "" ]]; then echo "${GREEN}OK: download extension MATCH on ${expectedExtension}${NC}" else From a2d2abf4f53f38a9e0e94971184844059ae8046d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 23 Aug 2022 15:28:57 +0200 Subject: [PATCH 10/13] Update checkLabels.sh Removing these lines again. They don't tell much. --- utils/checkLabels.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 0cbccb6..921d49f 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -247,9 +247,6 @@ for fixedArch in i386 arm64; do fi else githubPart="$(echo "$downloadURL" | cut -d "/" -f4-6)" - echo "type: $type" - echo "archiveName: $archiveName" - echo "githubPart: $githubPart" if [[ "$(curl -fsL "$downloadURL" | grep -io "${githubPart}.*\.${expectedExtension}")" != "" ]]; then echo "${GREEN}OK: download extension MATCH on ${expectedExtension}${NC}" else From cf412bda3c07025bdba65b3a2b1b3c87eb97eab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Tue, 23 Aug 2022 16:47:29 +0200 Subject: [PATCH 11/13] Output label variables in DEBUG log --- fragments/main.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/fragments/main.sh b/fragments/main.sh index 48b277c..f16ea39 100644 --- a/fragments/main.sh +++ b/fragments/main.sh @@ -15,6 +15,29 @@ fi # MARK: application download and installation starts here +# Debug output of all variables in a label +printlog "name=${name}" DEBUG +printlog "appName=${appName}" DEBUG +printlog "type=${type}" DEBUG +printlog "archiveName=${archiveName}" DEBUG +printlog "downloadURL=${downloadURL}" DEBUG +printlog "curlOptions=${curlOptions}" DEBUG +printlog "appNewVersion=${appNewVersion}" DEBUG +printlog "appCustomVersion function: $(if type 'appCustomVersion' 2>/dev/null | grep -q 'function'; then echo "Defined. ${appCustomVersion}"; else; echo "Not defined"; fi)" DEBUG +printlog "versionKey=${versionKey}" DEBUG +printlog "packageID=${packageID}" DEBUG +printlog "pkgName=${pkgName}" DEBUG +printlog "choiceChangesXML=${choiceChangesXML}" DEBUG +printlog "expectedTeamID=${expectedTeamID}" DEBUG +printlog "blockingProcesses=${blockingProcesses}" DEBUG +printlog "installerTool=${installerTool}" DEBUG +printlog "CLIInstaller=${CLIInstaller}" DEBUG +printlog "CLIArguments=${CLIArguments}" DEBUG +printlog "updateTool=${updateTool}" DEBUG +printlog "updateToolArguments=${updateToolArguments}" DEBUG +printlog "updateToolRunAsCurrentUser=${updateToolRunAsCurrentUser}" DEBUG +#printlog "Company=${Company}" DEBUG # Not used + if [[ ${INTERRUPT_DND} = "no" ]]; then # Check if a fullscreen app is active if hasDisplaySleepAssertion; then From 9157d4763b1d8740e47f9f2c27bf876fa5d19999 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Mon, 29 Aug 2022 09:45:27 +0200 Subject: [PATCH 12/13] Better new GitHub `downloadURL` --- fragments/functions.sh | 4 ++-- utils/checkLabels.sh | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index 3ecf8b0..e43d607 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -160,10 +160,10 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name if [ -n "$archiveName" ]; then #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*$archiveName" | head -1) else #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$filetype" | tail -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*\.$filetype" | head -1) fi if [ -z "$downloadURL" ]; then cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 921d49f..5a83f9b 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -52,13 +52,21 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name gitusername=${1?:"no git user name"} gitreponame=${2?:"no git repo name"} + if [[ $type == "pkgInDmg" ]]; then + filetype="dmg" + elif [[ $type == "pkgInZip" ]]; then + filetype="zip" + else + filetype=$type + fi + #githubPart="$gitusername/$gitreponame/releases/download" #echo "$githubPart" #downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest" if [ -n "$archiveName" ]; then - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*$archiveName" | tail -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*$archiveName" | head -1) else - downloadURL=https://github.com$(curl -sL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -o "\/$gitusername\/$gitreponame.*\.$type" | tail -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*\.$filetype" | head -1) fi echo "$downloadURL" return 0 From f7e2c5e00065a1bf52e289f0cc679c7769140484 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Theilgaard?= Date: Mon, 29 Aug 2022 12:50:28 +0200 Subject: [PATCH 13/13] Final fix for GitHub `downloadURL` For all labels tested it gives the same results as API-URL. --- fragments/functions.sh | 4 ++-- fragments/labels/cocoapods.sh | 1 - utils/checkLabels.sh | 5 +++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/fragments/functions.sh b/fragments/functions.sh index e43d607..6c11f42 100644 --- a/fragments/functions.sh +++ b/fragments/functions.sh @@ -160,10 +160,10 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name if [ -n "$archiveName" ]; then #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$archiveName\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*$archiveName" | head -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1) else #downloadURL=$(curl -L --silent --fail "https://api.github.com/repos/$gitusername/$gitreponame/releases/latest" | awk -F '"' "/browser_download_url/ && /$filetype\"/ { print \$4; exit }") - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*\.$filetype" | head -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1) fi if [ -z "$downloadURL" ]; then cleanupAndExit 14 "could not retrieve download URL for $gitusername/$gitreponame" ERROR diff --git a/fragments/labels/cocoapods.sh b/fragments/labels/cocoapods.sh index 6b5c8a2..1ebc7a3 100644 --- a/fragments/labels/cocoapods.sh +++ b/fragments/labels/cocoapods.sh @@ -1,7 +1,6 @@ cocoapods) name="CocoaPods" type="bz2" - archiveName="CocoaPods.app-[0-9.]*.tar.bz2" downloadURL="$(downloadURLFromGit CocoaPods CocoaPods-app)" appNewVersion="$(versionFromGit CocoaPods CocoaPods-app)" expectedTeamID="AX2Q2BH2XR" diff --git a/utils/checkLabels.sh b/utils/checkLabels.sh index 5a83f9b..3063846 100755 --- a/utils/checkLabels.sh +++ b/utils/checkLabels.sh @@ -64,9 +64,9 @@ downloadURLFromGit() { # $1 git user name, $2 git repo name #echo "$githubPart" #downloadURL="https://github.com/$gitusername/$gitreponame/releases/latest" if [ -n "$archiveName" ]; then - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*$archiveName" | head -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*$archiveName" | head -1) else - downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "\/releases\/download\/.*\.$filetype" | head -1) + downloadURL=https://github.com$(curl -sfL "https://github.com/$gitusername/$gitreponame/releases/latest" | tr '"' "\n" | grep -i "^/.*\/releases\/download\/.*\.$filetype" | head -1) fi echo "$downloadURL" return 0 @@ -195,6 +195,7 @@ for fixedArch in i386 arm64; do #caseLabel if cat "${labels_dir}/${label}.sh" | grep -v -E '^[a-z0-9\_-]*(\)|\|\\)$' | grep -v ";;" > checkLabelCurrent.sh; then + INSTALL=force # This is only to prevent various Microsoft labels from running "msupdate --list" source checkLabelCurrent.sh echo "Name: $name"