git.iko.soy/typeable/nixpkgs
on master help sign in
fetchgit: improve name detection, discard nix-1.8 check

The name detection didn't work for e.g. http://git.suckless.org/sinit/. I tested the tarball builds now. @shlevy claimed nixpkgs requires nix-1.8 features anyway, so the additional check with message were superfluous.

commit77d66ed83474d2be60aced66b427d5b358138782 authorVladimír Čunát <vcunat@gmail.com> dateTue 13 Jan 2015, 19:43 (12 years ago) parent7d1d89e
1 file changed+4−5
pkgs/build-support/fetchgit/default.nix+4−5
pkgs/build-support/fetchgit/default.nix+4−5
@@ -1,10 +1,8 @@
11{stdenv, git, cacert}: let
22 urlToName = url: rev: let
3− base = baseNameOf url;
3+ base = baseNameOf (stdenv.lib.removeSuffix "/" url);
44
5− matched = (builtins.match or (x: y:
6− abort "This version of fetchgit requires Nix >= 1.8, please upgrade!"
7− )) "(.*).git" base;
5+ matched = builtins.match "(.*).git" base;
86
97 short = builtins.substring 0 7 rev;
108
@@ -12,7 +10,8 @@
1210 then "-${short}"
1311 else "";
1412 in "${if matched == null then base else builtins.head matched}${appendShort}";
15−in {url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? false
13+in
14+{ url, rev ? "HEAD", md5 ? "", sha256 ? "", leaveDotGit ? false
1615, fetchSubmodules ? true
1716, name ? urlToName url rev
1817}: