Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions pkgs/build-support/fetchgit/default.nix
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
{
lib,
repoRevToNameMaybe,
stdenvNoCC,
git,
git-lfs,
cacert,
}:

let
urlToName =
url: rev:
let
shortRev = lib.sources.shortRev rev;
appendShort = lib.optionalString ((builtins.match "[a-f0-9]*" rev) != null) "-${shortRev}";
in
"${lib.sources.urlToName url}${appendShort}";
in

lib.makeOverridable (
lib.fetchers.withNormalizedHash { } (
# NOTE Please document parameter additions or changes in
Expand All @@ -24,7 +15,7 @@ lib.makeOverridable (
url,
tag ? null,
rev ? null,
name ? urlToName url (lib.revOrTag rev tag),
name ? repoRevToNameMaybe url (lib.revOrTag rev tag) "git",
leaveDotGit ? deepClone || fetchTags,
outputHash ? lib.fakeHash,
outputHashAlgo ? null,
Expand Down
5 changes: 3 additions & 2 deletions pkgs/build-support/fetchhg/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
lib,
repoRevToNameMaybe,
stdenvNoCC,
mercurial,
}:
{
name ? null,
url,
rev ? null,
name ? repoRevToNameMaybe url rev "hg",
sha256 ? null,
hash ? null,
fetchSubrepos ? false,
Expand All @@ -18,7 +19,7 @@ if hash != null && sha256 != null then
else
# TODO: statically check if mercurial as the https support if the url starts with https.
stdenvNoCC.mkDerivation {
name = "hg-archive" + (lib.optionalString (name != null) "-${name}");
inherit name;
builder = ./builder.sh;
nativeBuildInputs = [ mercurial ];

Expand Down
5 changes: 4 additions & 1 deletion pkgs/build-support/fetchsvn/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
lib,
config,
stdenvNoCC,
buildPackages,
cacert,
Expand Down Expand Up @@ -36,8 +37,10 @@ let
# ../repo (no trunk) -> repo
else
head path;
kind = config.fetchedSourceNameDefault;
suffix = lib.optionalString (kind == "full") "-svn";
in
"${repoName}-r${toString rev}";
if kind == "source" then "source" else "${repoName}-r${toString rev}${suffix}-source";
in

{
Expand Down
Loading