Skip to content

Commit 814476e

Browse files
authored
vscode: 1.101.0 -> 1.101.1 (#418278)
2 parents 92571ef + 606367f commit 814476e

File tree

3 files changed

+31
-78
lines changed

3 files changed

+31
-78
lines changed

pkgs/applications/editors/vscode/update-shell.nix

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 17 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,26 @@
11
#! /usr/bin/env nix-shell
2-
#! nix-shell update-shell.nix -i bash
3-
4-
# Update script for the vscode versions and hashes.
5-
# Usually doesn't need to be called by hand,
6-
# but is called by a bot: https://github.com/samuela/nixpkgs-upkeep/actions
7-
# Call it by hand if the bot fails to automatically update the versions.
2+
#!nix-shell -i bash -p bash curl gawk gnugrep gnused jq nix nix-prefetch nix-prefetch-scripts common-updater-scripts
83

94
set -eou pipefail
105

11-
ROOT="$(dirname "$(readlink -f "$0")")"
12-
if [ ! -f "$ROOT/vscode.nix" ]; then
13-
echo "ERROR: cannot find vscode.nix in $ROOT"
14-
exit 1
15-
fi
16-
17-
# VSCode
18-
19-
VSCODE_VER=$(curl --fail --silent https://api.github.com/repos/Microsoft/vscode/releases/latest | jq --raw-output .tag_name)
20-
sed -i "s/version = \".*\"/version = \"${VSCODE_VER}\"/" "$ROOT/vscode.nix"
21-
22-
TEMP_FOLDER=$(mktemp -d)
6+
latestVersion=$(curl --fail --silent https://api.github.com/repos/Microsoft/vscode/releases/latest | jq --raw-output .tag_name)
7+
currentVersion=$(nix eval --raw -f . vscode.version)
238

24-
VSCODE_X64_LINUX_URL="https://update.code.visualstudio.com/${VSCODE_VER}/linux-x64/stable"
9+
echo "latest version: $latestVersion"
10+
echo "current version: $currentVersion"
2511

26-
# Split output by newlines into Bash array
27-
readarray -t VSCODE_X64_LINUX <<< $(nix-prefetch-url --print-path ${VSCODE_X64_LINUX_URL})
28-
29-
sed -i "s/x86_64-linux = \".\{52\}\"/x86_64-linux = \"${VSCODE_X64_LINUX[0]}\"/" "$ROOT/vscode.nix"
30-
31-
tar xf ${VSCODE_X64_LINUX[1]} -C $TEMP_FOLDER
32-
VSCODE_COMMIT=$(jq --raw-output .commit $TEMP_FOLDER/VSCode-linux-x64/resources/app/product.json)
33-
sed -i "s/rev = \".\{40\}\"/rev = \"${VSCODE_COMMIT}\"/" "$ROOT/vscode.nix"
34-
35-
SERVER_X64_LINUX_URL="https://update.code.visualstudio.com/commit:${VSCODE_COMMIT}/server-linux-x64/stable"
36-
SERVER_X64_LINUX_SHA256=$(nix-prefetch-url ${SERVER_X64_LINUX_URL})
37-
sed -i "s/sha256 = \".\{51,52\}\"/sha256 = \"${SERVER_X64_LINUX_SHA256}\"/" "$ROOT/vscode.nix"
38-
39-
VSCODE_X64_DARWIN_URL="https://update.code.visualstudio.com/${VSCODE_VER}/darwin/stable"
40-
VSCODE_X64_DARWIN_SHA256=$(nix-prefetch-url ${VSCODE_X64_DARWIN_URL})
41-
sed -i "s/x86_64-darwin = \".\{52\}\"/x86_64-darwin = \"${VSCODE_X64_DARWIN_SHA256}\"/" "$ROOT/vscode.nix"
12+
if [[ "$latestVersion" == "$currentVersion" ]]; then
13+
echo "package is up-to-date"
14+
exit 0
15+
fi
4216

43-
VSCODE_AARCH64_LINUX_URL="https://update.code.visualstudio.com/${VSCODE_VER}/linux-arm64/stable"
44-
VSCODE_AARCH64_LINUX_SHA256=$(nix-prefetch-url ${VSCODE_AARCH64_LINUX_URL})
45-
sed -i "s/aarch64-linux = \".\{52\}\"/aarch64-linux = \"${VSCODE_AARCH64_LINUX_SHA256}\"/" "$ROOT/vscode.nix"
17+
update-source-version vscode $latestVersion
4618

47-
VSCODE_AARCH64_DARWIN_URL="https://update.code.visualstudio.com/${VSCODE_VER}/darwin-arm64/stable"
48-
VSCODE_AARCH64_DARWIN_SHA256=$(nix-prefetch-url ${VSCODE_AARCH64_DARWIN_URL})
49-
sed -i "s/aarch64-darwin = \".\{52\}\"/aarch64-darwin = \"${VSCODE_AARCH64_DARWIN_SHA256}\"/" "$ROOT/vscode.nix"
19+
systems=$(nix eval --json -f . vscode.meta.platforms | jq --raw-output '.[]')
20+
for system in $systems; do
21+
hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix eval --raw -f . vscode.src.url --system "$system")))
22+
update-source-version vscode $latestVersion $hash --system=$system --ignore-same-version --ignore-same-hash
23+
done
5024

51-
VSCODE_ARMV7L_LINUX_URL="https://update.code.visualstudio.com/${VSCODE_VER}/linux-armhf/stable"
52-
VSCODE_ARMV7L_LINUX_SHA256=$(nix-prefetch-url ${VSCODE_ARMV7L_LINUX_URL})
53-
sed -i "s/armv7l-linux = \".\{52\}\"/armv7l-linux = \"${VSCODE_ARMV7L_LINUX_SHA256}\"/" "$ROOT/vscode.nix"
25+
rev=$(curl --fail --silent https://api.github.com/repos/Microsoft/vscode/git/ref/tags/$latestVersion | jq --raw-output .object.sha)
26+
update-source-version vscode $rev --version-key=rev --source-key=vscodeServer.src --ignore-same-version --ignore-same-hash

pkgs/applications/editors/vscode/vscode.nix

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2+
lib,
23
stdenv,
34
stdenvNoCC,
4-
lib,
55
callPackage,
66
fetchurl,
77
nixosTests,
@@ -34,24 +34,24 @@ let
3434

3535
archive_fmt = if stdenv.hostPlatform.isDarwin then "zip" else "tar.gz";
3636

37-
sha256 =
37+
hash =
3838
{
39-
x86_64-linux = "1zc64d1n84kzwmwh8m3j897di5955qlm7glnpjvl8g7q70b4rdax";
40-
x86_64-darwin = "04ycsad1khxjmiph9fk9449w942m8gmq65amwkf8jxqzn0rybh76";
41-
aarch64-linux = "0lhqmp59vccs35fksgvdgvw82b0mr9b2wlyafxlwb8pk2q0l0xga";
42-
aarch64-darwin = "1axzsk6xqlzs3j9irjxp5f4fbdxyi4fffhdk89h45q3zkw8m9m4i";
43-
armv7l-linux = "1rv3a8xj7iv1d8mfikpj58n398ww5cndbyvgy5328nj7dh6azrsw";
39+
x86_64-linux = "sha256-Rr7JNWloV4VkgGk9zDEnD/WRHSYv5su8UrOSIl3247c=";
40+
x86_64-darwin = "sha256-hHAJVmFKwD0Z8YyqvNlM4SpWnSIniVvdMwR3fhk/mKE=";
41+
aarch64-linux = "sha256-/pYykG/1IJU7aJ9wtO5oo3dUdCGtfxklre0SGMpgnq8=";
42+
aarch64-darwin = "sha256-pWMCQlgxoJ4EGfycuz3H76r9Sc3x006el1ITOM6E4wE=";
43+
armv7l-linux = "sha256-M0fK1n/HMuNQvN85I4g5GV8QAg3n6vQtR6V/B1PFAwQ=";
4444
}
4545
.${system} or throwSystem;
4646
in
4747
callPackage ./generic.nix rec {
4848
# Please backport all compatible updates to the stable release.
4949
# This is important for the extension ecosystem.
50-
version = "1.101.0";
50+
version = "1.101.1";
5151
pname = "vscode" + lib.optionalString isInsiders "-insiders";
5252

5353
# This is used for VS Code - Remote SSH test
54-
rev = "dfaf44141ea9deb3b4096f7cd6d24e00c147a4b1";
54+
rev = "18e3a1ec544e6907be1e944a94c496e302073435";
5555

5656
executableName = "code" + lib.optionalString isInsiders "-insiders";
5757
longName = "Visual Studio Code" + lib.optionalString isInsiders " - Insiders";
@@ -61,7 +61,7 @@ callPackage ./generic.nix rec {
6161
src = fetchurl {
6262
name = "VSCode_${version}_${plat}.${archive_fmt}";
6363
url = "https://update.code.visualstudio.com/${version}/${plat}/stable";
64-
inherit sha256;
64+
inherit hash;
6565
};
6666

6767
# We don't test vscode on CI, instead we test vscodium
@@ -75,7 +75,7 @@ callPackage ./generic.nix rec {
7575
src = fetchurl {
7676
name = "vscode-server-${rev}.tar.gz";
7777
url = "https://update.code.visualstudio.com/commit:${rev}/server-linux-x64/stable";
78-
sha256 = "0rjd4f54k58k97gxvnivwj52aha5s8prws1izvmg43vphhfvk014";
78+
hash = "sha256-Myq0OUrwv6bq53Q5FDCVtt+wfGlEX2bjz9CMeVLfd+4=";
7979
};
8080
stdenv = stdenvNoCC;
8181
};
@@ -91,7 +91,7 @@ callPackage ./generic.nix rec {
9191

9292
hasVsceSign = true;
9393

94-
meta = with lib; {
94+
meta = {
9595
description = ''
9696
Open source source code editor developed by Microsoft for Windows,
9797
Linux and macOS
@@ -106,8 +106,8 @@ callPackage ./generic.nix rec {
106106
'';
107107
homepage = "https://code.visualstudio.com/";
108108
downloadPage = "https://code.visualstudio.com/Updates";
109-
license = licenses.unfree;
110-
maintainers = with maintainers; [
109+
license = lib.licenses.unfree;
110+
maintainers = with lib.maintainers; [
111111
eadwu
112112
synthetica
113113
bobby285271

0 commit comments

Comments
 (0)