nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 34 lines 1.2 kB view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p curl gnused jq nix-update 3 4set -euo pipefail 5 6current_version=$(nix-instantiate --eval -E "with import ./. {}; cef-binary.version or (lib.getVersion cef-binary)" | tr -d '"') 7 8ROOT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")" 9 10version_json=$(curl --silent https://cef-builds.spotifycdn.com/index.json | jq '[.linux64.versions[] | select (.channel == "stable")][0]') 11cef_version=$(echo "$version_json" | jq -r '.cef_version' | cut -d'+' -f1) 12git_revision=$(echo "$version_json" | jq -r '.cef_version' | cut -d'+' -f2 | cut -c 2-) 13chromium_version=$(echo "$version_json" | jq -r '.chromium_version') 14 15echo "Latest version: $cef_version" 16echo "Current version: $current_version" 17 18if [[ "$cef_version" == "$current_version" ]]; then 19 echo "Package is up-to-date" 20 exit 0 21fi 22 23update_nix_value() { 24 local key="$1" 25 local value="${2:-}" 26 sed -i "s|$key ? \".*\"|$key ? \"$value\"|" $ROOT/package.nix 27} 28 29update_nix_value version "$cef_version" 30update_nix_value gitRevision "$git_revision" 31update_nix_value chromiumVersion "$chromium_version" 32 33nix-update pkgsCross.gnu64.cef-binary --version skip 34nix-update pkgsCross.aarch64-multiplatform.cef-binary --version skip