summary refs log tree commit diff
path: root/pkgs/common-updater
diff options
context:
space:
mode:
authortaku0 <mxxouy6x3m_github@tatapa.org>2018-11-16 23:04:54 +0900
committertaku0 <mxxouy6x3m_github@tatapa.org>2018-11-16 23:04:54 +0900
commit4bb9af228ed2a25edfc7848af856281426080b34 (patch)
treefc448a0e3ac9bf5685d33cb5b6d0a122968366b1 /pkgs/common-updater
parentfa138b55a6d289151a2b4f7b0ea1b18d22ee6576 (diff)
downloadnixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar.gz
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar.bz2
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar.lz
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar.xz
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.tar.zst
nixpkgs-4bb9af228ed2a25edfc7848af856281426080b34.zip
common-updater, firefox: fix updater for firefox
Diffstat (limited to 'pkgs/common-updater')
-rwxr-xr-xpkgs/common-updater/scripts/update-source-version11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/common-updater/scripts/update-source-version b/pkgs/common-updater/scripts/update-source-version
index 3e507660a65..57b52553c2b 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 <attr> <version> [<new-source-hash>] [<new-source-url>]
+# Usage: update-source-hash <attr> <version> [<new-source-hash>] [<new-source-url>] [<version-key>]
 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