diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-04-22 21:15:06 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-04-22 21:18:23 +0000 |
commit | b935ae5f3cfb2bb4f9a3746d284f156a6dece505 (patch) | |
tree | 5efe4e2e7a7723a737d0130a333b057c5e76df40 /nixpkgs/pkgs/applications/audio/spotify | |
parent | dc9566e91c9453378c24e98b5737234364670df5 (diff) | |
parent | d26027792812fbfad4d0f451b5f47fdabf7fdeb9 (diff) | |
download | nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar.gz nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar.bz2 nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar.lz nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar.xz nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.tar.zst nixlib-b935ae5f3cfb2bb4f9a3746d284f156a6dece505.zip |
Merge commit 'd26027792812fbfad4d0f451b5f47fdabf7fdeb9'
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/spotify')
-rwxr-xr-x | nixpkgs/pkgs/applications/audio/spotify/update.sh | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/nixpkgs/pkgs/applications/audio/spotify/update.sh b/nixpkgs/pkgs/applications/audio/spotify/update.sh index 0e19ca1920b4..a8836214f2fc 100755 --- a/nixpkgs/pkgs/applications/audio/spotify/update.sh +++ b/nixpkgs/pkgs/applications/audio/spotify/update.sh @@ -29,10 +29,10 @@ spotify_nix="$nixpkgs/pkgs/applications/audio/spotify/default.nix" # create bash array from snap info snap_info=($( - curl -H 'X-Ubuntu-Series: 16' \ - "https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=$channel" \ - | jq --raw-output \ - '.revision,.download_sha512,.version,.last_updated' + curl -s -H 'X-Ubuntu-Series: 16' \ + "https://api.snapcraft.io/api/v1/snaps/details/spotify?channel=$channel" \ + | jq --raw-output \ + '.revision,.download_sha512,.version,.last_updated' )) # "revision" is the actual version identifier on snapcraft, the "version" is @@ -50,8 +50,8 @@ echo "Latest $channel release is $upstream_version from $last_updated." # current_nix_version=$( - grep 'version\s*=' "$spotify_nix" \ - | sed -Ene 's/.*"(.*)".*/\1/p' + grep 'version\s*=' "$spotify_nix" \ + | sed -Ene 's/.*"(.*)".*/\1/p' ) echo "Current nix version: $current_nix_version" @@ -61,36 +61,28 @@ echo "Current nix version: $current_nix_version" # if [[ "$current_nix_version" = "$upstream_version" ]]; then - echo "Spotify is already up ot date" - exit 0 + echo "Spotify is already up-to-date" + exit 0 fi echo "Updating from ${current_nix_version} to ${upstream_version}, released on ${last_updated}" # search-and-replace revision, hash and version sed --regexp-extended \ - -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ - -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \ - -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ - -i "$spotify_nix" + -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ + -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \ + -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ + -i "$spotify_nix" # # try to build the updated version # if ! nix-build -A spotify "$nixpkgs"; then - echo "The updated spotify failed to build." - exit 1 + echo "The updated spotify failed to build." + exit 1 fi -# -# give instructions for upstreaming -# - +# Commit changes git add "$spotify_nix" -# show changes for review -git status -echo 'Please review and test the changes (./result/bin/spotify).' -echo 'Then stage the changes with `git add` and commit with:' -# prepare commit message -echo "git commit -m 'spotify: $current_nix_version -> $upstream_version'" +git commit -m "spotify: ${current_nix_version} -> ${upstream_version}" |