forked from mirrors/nixpkgs
nix-prefetch-hg: if url is local file, do not make clone, but run hg archive on it
svn path=/nixpkgs/trunk/; revision=26779
This commit is contained in:
parent
3756e6021a
commit
d7ac5cd014
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue