fetchtorrent: test single-file torrents

This commit is contained in:
Steven Allen
2026-03-07 16:21:29 -08:00
parent d0a09641e4
commit b077f0d117
4 changed files with 22 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ indent_size = unset
trim_trailing_whitespace = true
# binaries
[*.nib]
[*.{nib,torrent}]
end_of_line = unset
insert_final_newline = unset
trim_trailing_whitespace = unset

3
.gitattributes vendored
View File

@@ -62,3 +62,6 @@ ci/OWNERS linguist-language=CODEOWNERS
# patching CRLF line endings from an upstream source package.
*.diff !text !eol
*.patch !text !eol
# Torrent files are binary files and should not be re-encoded.
*.torrent !text !eol

View File

@@ -0,0 +1 @@
d10:created by13:mktorrent 1.113:creation datei1772926249e4:infod6:lengthi1097e4:name7:COPYING12:piece lengthi262144e6:pieces20:€åÏÊ\c™èçæÉ\Q3Ní-e8:url-list96:https://raw.githubusercontent.com/NixOS/nixpkgs/3d82431ec4b51262989559b821b83abe4a9f6dbd/COPYINGe

View File

@@ -75,7 +75,7 @@ let
);
in
# Seems almost but not quite worth using lib.mapCartesianProduct...
builtins.mapAttrs (n: v: testers.invalidateFetcherByDrvHash fetchtorrentWithHash v) {
(builtins.mapAttrs (n: v: testers.invalidateFetcherByDrvHash fetchtorrentWithHash v) {
http-link = {
inherit (http) url;
inherit (flattened) postFetch;
@@ -140,4 +140,20 @@ builtins.mapAttrs (n: v: testers.invalidateFetcherByDrvHash fetchtorrentWithHash
# flatten = false;
# inherit (unflattened) postFetch;
#};
})
// {
# Make sure we can download and "flatten" single-file torrents.
# We only test with transmission because we use a web-seed and rqbit
# doesn't support web-seeds.
single-file = fetchtorrent {
hash = "sha256-u5c/ZN5V79Jg1aN6spbui4OdhExsXjofk1JpvUdW7Ro=";
backend = "transmission";
flatten = true;
url = "${./test-single-file.torrent}";
meta = {
hydraPlatforms = [ ];
license = lib.licenses.mit;
description = "The license file for the Nixpkgs repository as of 7 March 2026";
};
};
}