firefox: use SHA512SUM in update.nix
(cherry picked from commit 8432387de20d211dee2be068955ba23f7920aa58)
This commit is contained in:
parent
bad3ccd099
commit
3987314eba
@ -6,6 +6,7 @@
|
||||
, gnused
|
||||
, gnugrep
|
||||
, curl
|
||||
, gnupg
|
||||
, attrPath
|
||||
, runtimeShell
|
||||
, baseUrl ? "http://archive.mozilla.org/pub/firefox/releases/"
|
||||
@ -15,7 +16,12 @@
|
||||
|
||||
writeScript "update-${attrPath}" ''
|
||||
#!${runtimeShell}
|
||||
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnused xidel ]}
|
||||
PATH=${lib.makeBinPath [ common-updater-scripts coreutils curl gnugrep gnupg gnused xidel ]}
|
||||
|
||||
set -eux
|
||||
HOME=`mktemp -d`
|
||||
export GNUPGHOME=`mktemp -d`
|
||||
gpg --import ${../firefox-bin/mozilla.asc}
|
||||
|
||||
url=${baseUrl}
|
||||
|
||||
@ -31,5 +37,11 @@ writeScript "update-${attrPath}" ''
|
||||
sort --version-sort | \
|
||||
tail -n 1`
|
||||
|
||||
update-source-version ${attrPath} "$version" "" "" --version-key=${versionKey}
|
||||
curl --silent --show-error -o "$HOME"/shasums "$url$version/SHA512SUMS"
|
||||
curl --silent --show-error -o "$HOME"/shasums.asc "$url$version/SHA512SUMS.asc"
|
||||
gpgv --keyring="$GNUPGHOME"/pubring.kbx "$HOME"/shasums.asc "$HOME"/shasums
|
||||
|
||||
hash=$(grep '\.source\.tar\.xz$' "$HOME"/shasums | grep '^[^ ]*' -o)
|
||||
|
||||
update-source-version ${attrPath} "$version" "$hash" "" --version-key=${versionKey}
|
||||
''
|
||||
|
Loading…
x
Reference in New Issue
Block a user