diff options
Diffstat (limited to 'pkgs/build-support/fetchhg/nix-prefetch-hg')
-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 b2711392acc4..55501f41bbe8 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 |