summaryrefslogtreecommitdiff
path: root/pkgs/build-support/fetchpatch
diff options
context:
space:
mode:
authorMorgan Jones <me@numin.it>2025-10-12 23:23:57 -0700
committerMorgan Jones <me@numin.it>2025-10-12 23:23:57 -0700
commit03ff9b06537b95477d8cfb9a2cff00c10809ab27 (patch)
treee2e9dd4f8bb383dce0eb1363174bf39b311278a7 /pkgs/build-support/fetchpatch
parentfetchpatch: support `hunks` option (diff)
downloadnixpkgs-03ff9b06537b95477d8cfb9a2cff00c10809ab27.tar.gz
fetchpatch: add tests for hunks
Diffstat (limited to 'pkgs/build-support/fetchpatch')
-rw-r--r--pkgs/build-support/fetchpatch/tests.nix26
1 files changed, 21 insertions, 5 deletions
diff --git a/pkgs/build-support/fetchpatch/tests.nix b/pkgs/build-support/fetchpatch/tests.nix
index 77fe380d9710..3e79e9dd5469 100644
--- a/pkgs/build-support/fetchpatch/tests.nix
+++ b/pkgs/build-support/fetchpatch/tests.nix
@@ -24,18 +24,34 @@ in
"sha256-KlmIbixcds6GyKYt1fx5BxDIrU7msrgDdYo9Va/KJR4=";
};
+ hunks = testers.invalidateFetcherByDrvHash fetchpatch {
+ url = "https://github.com/openssh/openssh-portable/commit/35d5917652106aede47621bb3f64044604164043.patch";
+ stripLen = 1;
+ hunks = [
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ ];
+ sha256 =
+ if isFetchpatch2 then
+ "sha256-SXJALY4zC4y/ZV7uVglf+XB5cpC5tS4M8QDGlFRmcFM="
+ else
+ "sha256-MV7uGgA1ESMR7W6H5FjAIxKcpySdQjWB+L2zaHjd96M=";
+ };
+
full = testers.invalidateFetcherByDrvHash fetchpatch {
url = "https://github.com/boostorg/math/commit/7d482f6ebc356e6ec455ccb5f51a23971bf6ce5b.patch";
relative = "test";
stripLen = 1;
extraPrefix = "foo/bar/";
excludes = [ "foo/bar/bernoulli_no_atomic_mp.cpp" ];
+ # Should result in no change.
+ hunks = [ "1-" ];
revert = true;
- sha256 =
- if isFetchpatch2 then
- "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM="
- else
- "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM=";
+ sha256 = "sha256-+UKmEbr2rIAweCav/hR/7d4ZrYV84ht/domTrHtm8sM=";
};
decode = testers.invalidateFetcherByDrvHash fetchpatch {