mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
fetchtorrent: test single-file torrents
This commit is contained in:
@@ -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
3
.gitattributes
vendored
@@ -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
|
||||
|
||||
1
pkgs/build-support/fetchtorrent/test-single-file.torrent
Normal file
1
pkgs/build-support/fetchtorrent/test-single-file.torrent
Normal 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
|
||||
@@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user