Skip to content

Commit 357d253

Browse files
committed
treewide: substitute pname for strings
Inspired by #387725 (comment), script is based on #336172 using what i learned in #386865, part of #346453 Should be zero rebuilds. All candidates were made using: ```shell export NIXPKGS_ALLOW_UNFREE=1 export NIXPKGS_ALLOW_INSECURE=1 export NIXPKGS_ALLOW_BROKEN=1 git-wait restore . test -s packages.json || ( set -x; time nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f ./. -qaP --json --meta --drv-path --out-path --show-trace --no-allow-import-from-derivation --arg config '{ allowAliases = false; }' > packages.json ) list_attrpath_fname_col() { jq <packages.json 'to_entries[] | select(.value.meta.position==null|not) | "\(.key)\t\(.value.meta.position)"' -r | sed -e "s#\t$(realpath .)/#\t#" | sed -e 's#:\([0-9]*\)$#\t\1#' | grep . | grep -iv haskell | grep -iv /top-level/ | grep -iv chicken | grep pkgs/by-name/ | grep -iv build | grep -E '/(package|default)\.nix' } FLOCKDIR="$(mktemp -d)" N_WORKERS=4 while read attrpath fname col; do grep -qE 'repo *= *("\$\{pname\}"|pname);' "$fname" || continue echo | ( # mutex on fname flock --nonblock 200 || { >&2 echo "failed to aquire lock for $fname" exit 1 } echo "$attrpath" data="$(nix eval --impure --expr 'with import ./. {}; { inherit ('"$attrpath"') pname drvPath passthru meta; drvPath2='"$attrpath"'.src.drvPath; }' --json)" || exit test -n "$data" || exit pname="$(jq <<<"$data" .pname -r)" test -n "$pname" || exit (set -x sd -F '${pname}' "$pname" "$fname" sd -F ' = pname;' " = \"$pname\";" "$fname" ) data2="$(nix eval --impure --expr 'with import ./. {}; { inherit ('"$attrpath"') pname drvPath passthru meta; drvPath2='"$attrpath"'.src.drvPath; }' --json)" if [[ "$data" = "$data2" ]]; then (set -x; git-wait add "$fname") else (set -x; git-wait restore "$fname") exit fi (set -x sd -F ' rec {' ' {' "$fname" ) data3="$(nix eval --impure --expr 'with import ./. {}; { inherit ('"$attrpath"') pname drvPath passthru meta; drvPath2='"$attrpath"'.src.drvPath; }' --json 2>/dev/nul)" if [[ "$data" = "$data3" ]]; then (set -x; git-wait add "$fname") else (set -x; git-wait restore "$fname") fi ) 200>"$FLOCKDIR"/"$(sha256sum - <<<"$fname" | cut -d' ' -f1)".lock & while [[ $(jobs -p | wc -l) -ge $N_WORKERS ]]; do wait -n < <(jobs -p) || true done done < <(list_attrpath_fname_col) wait git restore . time nix-env --extra-experimental-features no-url-literals --option system x86_64-linux -f ./. -qaP --json --meta --drv-path --out-path --show-trace --no-allow-import-from-derivation --arg config '{ allowAliases = false; }' > packages2.json ``` `diff packages{,2}.json` is empty, indicating that no package nor src derivation has changed. I checked and cherry-picked the changes using `GIT_DIFF_OPTS='-u15' git -c interactive.singleKey=true add --patch`
1 parent 5dcaeaa commit 357d253

File tree

1,085 files changed

+1227
-1227
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,085 files changed

+1227
-1227
lines changed

pkgs/by-name/_0/_0verkill/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
libXpm,
99
}:
1010

11-
gccStdenv.mkDerivation rec {
11+
gccStdenv.mkDerivation {
1212
pname = "0verkill";
1313
version = "unstable-2011-01-13";
1414

1515
src = fetchFromGitHub {
1616
owner = "hackndev";
17-
repo = pname;
17+
repo = "0verkill";
1818
rev = "522f11a3e40670bbf85e0fada285141448167968";
1919
sha256 = "WO7PN192HhcDl6iHIbVbH7MVMi1Tl2KyQbDa9DWRO6M=";
2020
};

pkgs/by-name/_3/_3proxy/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
1111

1212
src = fetchFromGitHub {
1313
owner = "3proxy";
14-
repo = pname;
14+
repo = "3proxy";
1515
rev = version;
1616
sha256 = "sha256-4bLlQ/ULvpjs6fr19yBBln5mRRc+yj+zVLiTs1e/Ypc=";
1717
};

pkgs/by-name/_4/_4ti2/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
1212
version = "1.6.10";
1313

1414
src = fetchFromGitHub {
15-
owner = pname;
16-
repo = pname;
15+
owner = "4ti2";
16+
repo = "4ti2";
1717
rev = "Release_${builtins.replaceStrings [ "." ] [ "_" ] version}";
1818
hash = "sha256-Rz8O1Tf81kzpTGPq7dkZJvv444F1/VqKu7VuRvH59kQ=";
1919
};

pkgs/by-name/_6/_6tunnel/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
1111

1212
src = fetchFromGitHub {
1313
owner = "wojtekka";
14-
repo = pname;
14+
repo = "6tunnel";
1515
rev = version;
1616
sha256 = "0zsx9d6xz5w8zvrqsm8r625gpbqqhjzvjdzc3z8yix668yg8ff8h";
1717
};

pkgs/by-name/_9/_9menu/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
libXext,
1010
}:
1111

12-
stdenv.mkDerivation rec {
12+
stdenv.mkDerivation {
1313
pname = "9menu";
1414
version = "unstable-2021-02-24";
1515

1616
src = fetchFromGitHub {
1717
owner = "arnoldrobbins";
18-
repo = pname;
18+
repo = "9menu";
1919
rev = "00cbf99c48dc580ca28f81ed66c89a98b7a182c8";
2020
sha256 = "arca8Gbr4ytiCk43cifmNj7SUrDgn1XB26zAhZrVDs0=";
2121
};

pkgs/by-name/aa/aaa/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ rustPlatform.buildRustPackage rec {
1010

1111
src = fetchFromGitHub {
1212
owner = "DomesticMoth";
13-
repo = pname;
13+
repo = "aaa";
1414
rev = "v${version}";
1515
sha256 = "sha256-gIOlPjZOcmVLi9oOn4gBv6F+3Eq6t5b/3fKzoFqxclw=";
1616
};

pkgs/by-name/aa/aardvark-dns/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
1111

1212
src = fetchFromGitHub {
1313
owner = "containers";
14-
repo = pname;
14+
repo = "aardvark-dns";
1515
rev = "v${version}";
1616
hash = "sha256-mWaB1E/n/N2Tb5bqrMJX2XfPvZBCG+dxar3kGCHgv0I=";
1717
};

pkgs/by-name/aa/aaxtomp3/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resholve.mkDerivation rec {
2323

2424
src = fetchFromGitHub {
2525
owner = "krumpetpirate";
26-
repo = pname;
26+
repo = "aaxtomp3";
2727
rev = "v${version}";
2828
hash = "sha256-7a9ZVvobWH/gPxa3cFiPL+vlu8h1Dxtcq0trm3HzlQg=";
2929
};

pkgs/by-name/ac/acsccid/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
2020

2121
src = fetchFromGitHub {
2222
owner = "acshk";
23-
repo = pname;
23+
repo = "acsccid";
2424
rev = "v${version}";
2525
sha256 = "12aahrvsk21qgpjwcrr01s742ixs44nmjkvcvqyzhqb307x1rrn3";
2626
};

pkgs/by-name/ad/adbfs-rootless/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
1313

1414
src = fetchFromGitHub {
1515
owner = "spion";
16-
repo = pname;
16+
repo = "adbfs-rootless";
1717
rev = "fd56381af4dc9ae2f09b904c295686871a46ed0f";
1818
sha256 = "atiVjRfqvhTlm8Q+3iTNNPQiNkLIaHDLg5HZDJvpl2Q=";
1919
};

0 commit comments

Comments
 (0)