diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix index f8c1c0837553..3bdf3685a1f6 100644 --- a/pkgs/applications/networking/browsers/firefox/packages.nix +++ b/pkgs/applications/networking/browsers/firefox/packages.nix @@ -43,6 +43,7 @@ rec { }; updateScript = callPackage ./update.nix { attrPath = "firefox-unwrapped"; + versionKey = "ffversion"; }; }; @@ -67,6 +68,7 @@ rec { updateScript = callPackage ./update.nix { attrPath = "firefox-esr-52-unwrapped"; ffversionSuffix = "esr"; + versionKey = "ffversion"; }; }; @@ -92,6 +94,7 @@ rec { updateScript = callPackage ./update.nix { attrPath = "firefox-esr-60-unwrapped"; versionSuffix = "esr"; + versionKey = "ffversion"; }; }; diff --git a/pkgs/applications/networking/browsers/firefox/update.nix b/pkgs/applications/networking/browsers/firefox/update.nix index 8cc03cf8212a..a831d8231187 100644 --- a/pkgs/applications/networking/browsers/firefox/update.nix +++ b/pkgs/applications/networking/browsers/firefox/update.nix @@ -9,6 +9,7 @@ , attrPath , baseUrl ? "http://archive.mozilla.org/pub/firefox/releases/" , versionSuffix ? "" +, versionKey ? "version" }: writeScript "update-${attrPath}" '' @@ -28,5 +29,5 @@ writeScript "update-${attrPath}" '' sort --version-sort | \ tail -n 1` - update-source-version ${attrPath} "$version" + update-source-version ${attrPath} "$version" "" "" ${versionKey} '' diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version index 3e507660a65e..57b52553c2be 100755 --- a/pkgs/common-updater/scripts/update-source-version +++ b/pkgs/common-updater/scripts/update-source-version @@ -6,11 +6,16 @@ die() { exit 1 } -# Usage: update-source-hash [] [] +# Usage: update-source-hash [] [] [] attr=$1 newVersion=$2 newHash=$3 newUrl=$4 +versionKey=$5 + +if [ -z "$versionKey" ]; then + versionKey=version +fi nixFile=$(nix-instantiate --eval --strict -A "$attr.meta.position" | sed -re 's/^"(.*):[0-9]+"$/\1/') if [ ! -f "$nixFile" ]; then @@ -50,8 +55,8 @@ fi oldVersion=$(echo "$oldVersion" | sed -re 's|[.+]|\\&|g') oldUrl=$(echo "$oldUrl" | sed -re 's|[${}.+]|\\&|g') -if [ $(grep -c -E "^\s*(let\b)?\s*version\s*=\s*\"$oldVersion\"" "$nixFile") = 1 ]; then - pattern="/\bversion\b\s*=/ s|\"$oldVersion\"|\"$newVersion\"|" +if [ $(grep -c -E "^\s*(let\b)?\s*$versionKey\s*=\s*\"$oldVersion\"" "$nixFile") = 1 ]; then + pattern="/\b$versionKey\b\s*=/ s|\"$oldVersion\"|\"$newVersion\"|" elif [ $(grep -c -E "^\s*(let\b)?\s*name\s*=\s*\"[^\"]+-$oldVersion\"" "$nixFile") = 1 ]; then pattern="/\bname\b\s*=/ s|-$oldVersion\"|-$newVersion\"|" else