diff options
author | Rob Vermaas <rob.vermaas@gmail.com> | 2011-04-11 12:24:57 +0000 |
---|---|---|
committer | Rob Vermaas <rob.vermaas@gmail.com> | 2011-04-11 12:24:57 +0000 |
commit | d7ac5cd0142093d0230aaec49e0d613ff6af0bc7 (patch) | |
tree | 957c0284fa6b9a1ae8f3828a5d4104915c39da54 /pkgs/build-support/fetchhg | |
parent | 3756e6021ad2883791731195298858f0aa677e05 (diff) | |
download | nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar.gz nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar.bz2 nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar.lz nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar.xz nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.tar.zst nixpkgs-d7ac5cd0142093d0230aaec49e0d613ff6af0bc7.zip |
nix-prefetch-hg: if url is local file, do not make clone, but run hg archive on it
svn path=/nixpkgs/trunk/; revision=26779
Diffstat (limited to 'pkgs/build-support/fetchhg')
-rwxr-xr-x | pkgs/build-support/fetchhg/nix-prefetch-hg | 8 |
1 files 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 |