forked from mirrors/nixpkgs
vivaldi: Update update.sh
This commit is contained in:
parent
d0506bed9f
commit
8321a448a6
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p libarchive curl common-updater-scripts
|
||||
|
||||
set -eu -o pipefail
|
||||
set -xeu -o pipefail
|
||||
|
||||
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||
root=../../../../..
|
||||
|
@ -15,7 +15,7 @@ vivaldi_version_old=$(version vivaldi)
|
|||
vivaldi_version=$(curl -sS https://vivaldi.com/download/ | sed -rne 's/.*vivaldi-stable_([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+-[0-9]+)_amd64\.deb.*/\1/p')
|
||||
|
||||
if [[ "$vivaldi_version" = "$vivaldi_version_old" ]]; then
|
||||
echo "nothing to do, vivaldi $vivaldi_version is current"
|
||||
echo "vivaldi is already up-to-date"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
@ -25,15 +25,22 @@ mapfile -t prefetch < <(nix-prefetch-url --print-path "$url")
|
|||
hash=${prefetch[0]}
|
||||
path=${prefetch[1]}
|
||||
|
||||
echo "vivaldi: $vivaldi_version_old -> $vivaldi_version"
|
||||
echo "$path"
|
||||
nixpkgs="$(git rev-parse --show-toplevel)"
|
||||
default_nix="$nixpkgs/pkgs/applications/networking/browsers/vivaldi/default.nix"
|
||||
ffmpeg_nix="$nixpkgs/pkgs/applications/networking/browsers/vivaldi/ffmpeg-codecs.nix"
|
||||
|
||||
(cd "$root" && update-source-version vivaldi "$vivaldi_version" "$hash")
|
||||
|
||||
git add "${default_nix}"
|
||||
git commit -m "vivaldi: ${vivaldi_version_old} -> ${vivaldi_version}"
|
||||
|
||||
# Check vivaldi-ffmpeg-codecs version.
|
||||
chromium_version_old=$(version vivaldi-ffmpeg-codecs)
|
||||
chromium_version=$(bsdtar xOf "$path" data.tar.xz | bsdtar xOf - ./opt/vivaldi/vivaldi-bin | strings | grep '^[0-9]\{2,\}\.[0-9]\+\.[0-9]\{4,\}\+\.[0-9]\+$')
|
||||
|
||||
if [[ "$chromium_version" != "$chromium_version_old" ]]; then
|
||||
echo "vivaldi-ffmpeg-codecs: $chromium_version_old -> $chromium_version"
|
||||
(cd "$root" && update-source-version vivaldi-ffmpeg-codecs "$chromium_version")
|
||||
|
||||
git add "${ffmpeg_nix}"
|
||||
git commit -m "vivaldi-ffmepg-codecs: $chromium_version_old -> $chromium_version"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue