Skip to content

Commit d9274ce

Browse files
authored
tools: fix nixpkgs updater script
We only want the first match, which by convention is the global pin the script is meant to update. Signed-off-by: Antoine du Hamel <[email protected]> PR-URL: #66337 Refs: https://github.com/nodejs/node/actions/runs/36284249504/job/108521854021 Reviewed-By: Filip Skokan <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
1 parent 6866129 commit d9274ce

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎tools/dep_updaters/update-nixpkgs-pin.sh‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ NIXPKGS_PIN_FILE="$BASE_DIR/tools/nix/pkgs.nix"
88
NIXPKGS_COMPAT_PIN_FILE="$BASE_DIR/tools/nix/pkgs-26.05.nix"
99
OPENSSL_MATRIX_FILE="$BASE_DIR/tools/nix/openssl-matrix.nix"
1010

11-
NIXPKGS_REPO=$(grep 'repo =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
12-
CURRENT_VERSION_SHA1=$(grep 'rev =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
11+
NIXPKGS_REPO=$(grep -m 1 'repo =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
12+
CURRENT_VERSION_SHA1=$(grep -m 1 'rev =' "$NIXPKGS_PIN_FILE" | awk -F'"' '{ print $2 }')
1313

1414
NEW_UPSTREAM_SHA1=$(git ls-remote "$NIXPKGS_REPO.git" nixpkgs-unstable | awk '{print $1}')
1515
NEW_VERSION=$(echo "$NEW_UPSTREAM_SHA1" | head -c 35)
@@ -25,7 +25,7 @@ update_pkgs_file() {
2525
PREVIOUS_SHA1=$2
2626
UPSTREAM_SHA1=$3
2727

28-
CURRENT_TARBALL_HASH=$(grep 'sha256 =' "$PIN_FILE" | awk -F'"' '{ print $2 }')
28+
CURRENT_TARBALL_HASH=$(grep -m 1 'sha256 =' "$PIN_FILE" | awk -F'"' '{ print $2 }')
2929
NEW_TARBALL_HASH=$(nix-prefetch-url --unpack "$NIXPKGS_REPO/archive/$UPSTREAM_SHA1.tar.gz")
3030

3131
TMP_FILE=$(mktemp)
@@ -38,7 +38,7 @@ update_pkgs_file "$NIXPKGS_PIN_FILE" "$CURRENT_VERSION_SHA1" "$NEW_UPSTREAM_SHA1
3838
# Unstable channel no longer supports Intel architecture for macOS. We can use the 26.05 channel
3939
# to keep testing on that platform for a little longer.
4040
# TODO: remove this when 26.05 is EOL (end of 2026)
41-
COMPAT_VERSION_SHA1=$(grep 'rev =' "$NIXPKGS_COMPAT_PIN_FILE" | awk -F'"' '{ print $2 }')
41+
COMPAT_VERSION_SHA1=$(grep -m 1 'rev =' "$NIXPKGS_COMPAT_PIN_FILE" | awk -F'"' '{ print $2 }')
4242
COMPAT_UPSTREAM_SHA1=$(git ls-remote "$NIXPKGS_REPO.git" nixpkgs-26.05-darwin | awk '{print $1}')
4343
update_pkgs_file "$NIXPKGS_COMPAT_PIN_FILE" "$COMPAT_VERSION_SHA1" "$COMPAT_UPSTREAM_SHA1"
4444

0 commit comments

Comments
 (0)