From d7ac5cd0142093d0230aaec49e0d613ff6af0bc7 Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Mon, 11 Apr 2011 12:24:57 +0000 Subject: [PATCH] nix-prefetch-hg: if url is local file, do not make clone, but run hg archive on it svn path=/nixpkgs/trunk/; revision=26779 --- pkgs/build-support/fetchhg/nix-prefetch-hg | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/fetchhg/nix-prefetch-hg b/pkgs/build-support/fetchhg/nix-prefetch-hg index b2711392acc..55501f41bbe 100755 --- a/pkgs/build-support/fetchhg/nix-prefetch-hg +++ b/pkgs/build-support/fetchhg/nix-prefetch-hg @@ -36,14 +36,18 @@ fi 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