merged firefoxesr_intl, closes #496

This commit is contained in:
Armin Briegel
2022-05-12 15:04:11 +02:00

View File

@@ -1,24 +1,26 @@
firefoxesr_intl) firefoxesr_intl)
# This label will try to figure out the selected language of the user, # This label will try to figure out the selected language of the user,
# and install corrosponding version of Firefox ESR # and install corrosponding version of Firefox ESR
name="Firefox" name="Firefox"
type="dmg" type="dmg"
userLanguage=$(runAsUser defaults read .GlobalPreferences AppleLocale) userLanguage=$(runAsUser defaults read .GlobalPreferences AppleLocale | tr '_' '-')
printlog "Found language $userLanguage to be used for Firefox." WARN printlog "Found language $userLanguage to be used for $name."
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest-esr/README.txt" | grep -o "=$userLanguage"; then releaseURL="https://ftp.mozilla.org/pub/firefox/releases/latest-esr/README.txt"
userLanguage=$(echo $userLanguage | cut -c 1-2) until curl -fs $releaseURL | grep -q "=$userLanguage"; do
if ! curl -fs "https://ftp.mozilla.org/pub/firefox/releases/latest-esr/README.txt" | grep "=$userLanguage"; then if [ ${#userLanguage} -eq 2 ]; then
userLanguage="en_US" break
fi fi
fi printlog "No locale matching '$userLanguage', trying '${userLanguage:0:2}'"
printlog "Using language $userLanguage for download." WARN userLanguage=${userLanguage:0:2}
done
printlog "Using language '$userLanguage' for download."
downloadURL="https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx&lang=$userLanguage" downloadURL="https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx&lang=$userLanguage"
# https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx&lang=en-US if ! curl -sfL --output /dev/null -r 0-0 $downloadURL; then
if ! curl -sfL --output /dev/null -r 0-0 "$downloadURL" ; then printlog "Download not found for '$userLanguage', using default ('en-US')."
printlog "Download not found for that language. Using en-US" WARN downloadURL="https://download.mozilla.org/?product=firefox-esr-latest-ssl&os=osx"
downloadURL="https://download.mozilla.org/?product=firefox-latest&os=osx&lang=en-US"
fi fi
appNewVersion=$(curl -fsIL "$downloadURL" | grep -i "^location" | awk '{print $2}' | sed -E 's/.*releases\/([0-9.]*)esr.*/\1/g') appNewVersion=$(curl -fsIL $downloadURL | awk -F releases/ '/Location:/ {split($2,a,"esr/"); print a[1]}')
expectedTeamID="43AQ936H96" expectedTeamID="43AQ936H96"
blockingProcesses=( firefox ) blockingProcesses=( firefox )
printlog "WARNING for ERROR: Label firefox and firefox_intl should not be used. Instead use firefoxpkg and firefoxpkg_intl as per recommendations from Firefox. It's not fully certain that the app actually gets updated here. firefoxpkg and firefoxpkg_intl will have built in updates and make sure the client is updated in the future." REQ
;; ;;