diff options
author | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-13 19:19:34 +0000 |
---|---|---|
committer | Lluís Batlle i Rossell <viric@vicerveza.homeunix.net> | 2009-11-13 19:19:34 +0000 |
commit | 686411910497acbf53588c6f2d6610ad9601247f (patch) | |
tree | e9a0af33bbaa25c672883d4d5c9958f1b5b6afef /pkgs/build-support | |
parent | 605b62da110bd550dcc8ae2e5490714e0acef10a (diff) | |
parent | f26614bb789cf4099beb8dfd7d1c9627cb09a4fd (diff) | |
download | nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar.gz nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar.bz2 nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar.lz nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar.xz nixlib-686411910497acbf53588c6f2d6610ad9601247f.tar.zst nixlib-686411910497acbf53588c6f2d6610ad9601247f.zip |
Updating from trunk.
svn path=/nixpkgs/branches/stdenv-updates/; revision=18341
Diffstat (limited to 'pkgs/build-support')
-rw-r--r-- | pkgs/build-support/fetchgit/default.nix | 22 | ||||
-rw-r--r-- | pkgs/build-support/fetchmtn/builder.sh | 7 |
2 files changed, 28 insertions, 1 deletions
diff --git a/pkgs/build-support/fetchgit/default.nix b/pkgs/build-support/fetchgit/default.nix index 6966b5c0bf9b..8fd86cd24815 100644 --- a/pkgs/build-support/fetchgit/default.nix +++ b/pkgs/build-support/fetchgit/default.nix @@ -1,6 +1,28 @@ {stdenv, git}: {url, rev ? "HEAD", md5 ? "", sha256 ? ""}: +/* NOTE: + fetchgit has one problem: git fetch only works for refs. + This is because fetching arbitrary (maybe dangling) commits may be a security risk + and checking whether a commit belongs to a ref is expensive. This may + change in the future when some caching is added to git (?) + Usually refs are either tags (refs/tags/*) or branches (refs/heads/*) + Cloning branches will make the hash check fail when there is an update. + But not all patches we want can be accessed by tags. + + The workaround is getting the last n commits so that it's likly that they + still contain the hash we want. + + for now : increase depth iteratively (TODO) + + real fix: ask git folks to add a + git fetch $HASH contained in $BRANCH + facility because checking that $HASH is contained in $BRANCH is less + expensive than fetching --depth $N. + Even if git folks implemented this feature soon it may take years until + server admins start using the new version? +*/ + stdenv.mkDerivation { name = "git-export"; builder = ./builder.sh; diff --git a/pkgs/build-support/fetchmtn/builder.sh b/pkgs/build-support/fetchmtn/builder.sh index f39e38168802..4e34aad052b5 100644 --- a/pkgs/build-support/fetchmtn/builder.sh +++ b/pkgs/build-support/fetchmtn/builder.sh @@ -11,7 +11,7 @@ header "getting revision $selector"; done=; for source in $dbs; do - if mtn pull --debug --db "$cacheDB" "$source" "${branch}"; then + if mtn pull --db "$cacheDB" "$source" "${branch}"; then revision="$(mtn --db "$cacheDB" au toposort $(mtn --db "$cacheDB" au select "$selector") | tail -1)"; if [ -n "$revision" ]; then if mtn --db "$cacheDB" au get_revision "$revision"; then @@ -44,3 +44,8 @@ fi; stopNest +header "clearing _MTN in the output" + +rm -rf "$out/_MTN" + +stopNest |