fetchFromBittorrent: Rename to fetchtorrent

authored by

Eirik Wittersø and committed by
Emery Hemingway
2fd6af19 9b3fcd48

+14 -14
+5 -5
doc/builders/fetchers.chapter.md
··· 243 243 244 244 *** 245 245 ``` 246 - ## `fetchFromBittorrent` {#fetchfrombittorrent} 246 + ## `fetchtorrent` {#fetchtorrent} 247 247 248 - `fetchFromBittorrent` expects two arguments. `url` which can either be a Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file. It can also take a `config` argument which will craft a `settings.json` configuration file and give it to `transmission`, the underlying program that is performing the fetch. The available config options for `transmission` can be found [here](https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options) 248 + `fetchtorrent` expects two arguments. `url` which can either be a Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file. It can also take a `config` argument which will craft a `settings.json` configuration file and give it to `transmission`, the underlying program that is performing the fetch. The available config options for `transmission` can be found [here](https://github.com/transmission/transmission/blob/main/docs/Editing-Configuration-Files.md#options) 249 249 250 250 ``` 251 - { fetchFromBittorrent }: 251 + { fetchtorrent }: 252 252 253 - fetchFromBittorrent { 253 + fetchtorrent { 254 254 config = { peer-limit-global = 100; }; 255 255 url = "magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c"; 256 256 sha256 = ""; 257 257 } 258 258 ``` 259 259 260 - ### Parameters {#fetchfrombittorrent-parameters} 260 + ### Parameters {#fetchtorrent-parameters} 261 261 262 262 - `url`: Magnet URI (Magnet Link) such as `magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c` or an HTTP URL pointing to a `.torrent` file. 263 263
+2 -2
pkgs/build-support/fetchbittorrent/default.nix pkgs/build-support/fetchtorrent/default.nix
··· 30 30 jsonConfig = (formats.json {}).generate "jsonConfig" config; 31 31 in 32 32 runCommand name { 33 - nativeBuildInputs = [ cacert ] ++ (if (backend == "transmission" ) then [ transmission_noSystemd ] else if (backend == "rqbit") then [ rqbit ] else throw "rqbit or transmission are the only available backends for fetchbittorrent"); 33 + nativeBuildInputs = [ cacert ] ++ (if (backend == "transmission" ) then [ transmission_noSystemd ] else if (backend == "rqbit") then [ rqbit ] else throw "rqbit or transmission are the only available backends for fetchtorrent"); 34 34 outputHashAlgo = if hash != "" then null else "sha256"; 35 35 outputHash = hash; 36 36 outputHashMode = if recursiveHash then "recursive" else "flat"; 37 37 38 38 # url will be written to the derivation, meaning it can be parsed and utilized 39 - # by external tools, such as tools that may want to seed fetchBittorrent calls 39 + # by external tools, such as tools that may want to seed fetchtorrent calls 40 40 # in nixpkgs 41 41 inherit url; 42 42 }
+5 -5
pkgs/build-support/fetchbittorrent/tests.nix pkgs/build-support/fetchtorrent/tests.nix
··· 1 - { testers, fetchFromBittorrent, ... }: 1 + { testers, fetchtorrent, ... }: 2 2 3 3 { 4 - http-link = testers.invalidateFetcherByDrvHash fetchFromBittorrent { 4 + http-link = testers.invalidateFetcherByDrvHash fetchtorrent { 5 5 url = "https://webtorrent.io/torrents/wired-cd.torrent"; 6 6 hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; 7 7 backend = "transmission"; 8 8 }; 9 - magnet-link = testers.invalidateFetcherByDrvHash fetchFromBittorrent { 9 + magnet-link = testers.invalidateFetcherByDrvHash fetchtorrent { 10 10 url = "magnet:?xt=urn:btih:a88fda5954e89178c372716a6a78b8180ed4dad3&dn=The+WIRED+CD+-+Rip.+Sample.+Mash.+Share&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fwired-cd.torrent"; 11 11 hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; 12 12 backend = "transmission"; 13 13 }; 14 - http-link-rqbit = testers.invalidateFetcherByDrvHash fetchFromBittorrent { 14 + http-link-rqbit = testers.invalidateFetcherByDrvHash fetchtorrent { 15 15 url = "https://webtorrent.io/torrents/wired-cd.torrent"; 16 16 hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; 17 17 backend = "rqbit"; 18 18 }; 19 - magnet-link-rqbit = testers.invalidateFetcherByDrvHash fetchFromBittorrent { 19 + magnet-link-rqbit = testers.invalidateFetcherByDrvHash fetchtorrent { 20 20 url = "magnet:?xt=urn:btih:a88fda5954e89178c372716a6a78b8180ed4dad3&dn=The+WIRED+CD+-+Rip.+Sample.+Mash.+Share&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fwired-cd.torrent"; 21 21 hash = "sha256-OCsC22WuanqoN6lPv5wDT5ZxPcEHDpZ1EgXGvz1SDYo="; 22 22 backend = "rqbit";
+1 -1
pkgs/test/default.nix
··· 104 104 cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; }; 105 105 106 106 fetchurl = callPackages ../build-support/fetchurl/tests.nix { }; 107 - fetchFromBittorrent = callPackages ../build-support/fetchbittorrent/tests.nix { }; 107 + fetchtorrent = callPackages ../build-support/fetchtorrent/tests.nix { }; 108 108 fetchpatch = callPackages ../build-support/fetchpatch/tests.nix { }; 109 109 fetchpatch2 = callPackages ../build-support/fetchpatch/tests.nix { fetchpatch = fetchpatch2; }; 110 110 fetchDebianPatch = callPackages ../build-support/fetchdebianpatch/tests.nix { };
+1 -1
pkgs/top-level/all-packages.nix
··· 1118 1118 1119 1119 fetchs3 = callPackage ../build-support/fetchs3 { }; 1120 1120 1121 - fetchFromBittorrent = callPackage ../build-support/fetchbittorrent { }; 1121 + fetchtorrent = callPackage ../build-support/fetchtorrent { }; 1122 1122 1123 1123 fetchsvn = if stdenv.buildPlatform != stdenv.hostPlatform 1124 1124 # hack around splicing being crummy with things that (correctly) don't eval.