rust-analyzer: 2021-04-05 -> 2021-04-12

This commit is contained in:
Riey
2021-04-13 03:05:22 +09:00
parent 8fd3894d85
commit 62b44d8dfa
2 changed files with 15 additions and 19 deletions
@@ -8,23 +8,23 @@ nixpkgs=../../../../..
# Update lsp
rev=$(
ver=$(
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
)
old_rev=$(sed -nE 's/.*\brev = "(.*)".*/\1/p' ./default.nix)
old_ver=$(sed -nE 's/.*\bversion = "(.*)".*/\1/p' ./default.nix)
if grep -q 'cargoSha256 = ""' ./default.nix; then
old_rev='broken'
old_ver='broken'
fi
if [[ "$rev" == "$old_rev" ]]; then
echo "Up to date: $rev"
if [[ "$ver" == "$old_ver" ]]; then
echo "Up to date: $ver"
exit
fi
echo "$old_rev -> $rev"
echo "$old_ver -> $ver"
sha256=$(nix-prefetch -f "$nixpkgs" rust-analyzer-unwrapped.src --rev "$rev")
sha256=$(nix-prefetch -f "$nixpkgs" rust-analyzer-unwrapped.src --rev "$ver")
# Clear cargoSha256 to avoid inconsistency.
sed -e "s#rev = \".*\"#rev = \"$rev\"#" \
sed -e "s#version = \".*\"#version = \"$ver\"#" \
-e "/fetchFromGitHub/,/}/ s#sha256 = \".*\"#sha256 = \"$sha256\"#" \
-e "s#cargoSha256 = \".*\"#cargoSha256 = \"sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\"#" \
--in-place ./default.nix