Author: rob
Date: Mon Apr 11 12:24:57 2011
New Revision: 26779
URL: https://svn.nixos.org/websvn/nix/?rev=26779&sc=1

Log:
nix-prefetch-hg: if url is local file, do not make clone, but run hg archive on 
it

Modified:
   nixpkgs/trunk/pkgs/build-support/fetchhg/nix-prefetch-hg

Modified: nixpkgs/trunk/pkgs/build-support/fetchhg/nix-prefetch-hg
==============================================================================
--- nixpkgs/trunk/pkgs/build-support/fetchhg/nix-prefetch-hg    Mon Apr 11 
12:20:59 2011        (r26778)
+++ nixpkgs/trunk/pkgs/build-support/fetchhg/nix-prefetch-hg    Mon Apr 11 
12:24:57 2011        (r26779)
@@ -36,14 +36,18 @@
 if test -z "$finalPath"; then
 
     tmpPath=/tmp/hg-checkout-tmp-$$
-    tmpClone=$tmpPath/hg-clone
     tmpArchive=$tmpPath/hg-archive
     mkdir $tmpPath
 
     trap "rm -rf $tmpPath" EXIT
 
     # Perform the checkout.
-    hg clone -q -y -U "$url" $tmpClone >&2
+    if [[ $url != /* ]]; then
+      tmpClone=$tmpPath/hg-clone
+      hg clone -q -y -U "$url" $tmpClone >&2
+    else
+      tmpClone=$url
+    fi
     hg archive -q -y -r "$rev" --cwd $tmpClone $tmpArchive
 
 
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to