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
|
if test -z "$finalPath"; then
|
||||||
|
|
||||||
tmpPath=/tmp/hg-checkout-tmp-$$
|
tmpPath=/tmp/hg-checkout-tmp-$$
|
||||||
tmpClone=$tmpPath/hg-clone
|
|
||||||
tmpArchive=$tmpPath/hg-archive
|
tmpArchive=$tmpPath/hg-archive
|
||||||
mkdir $tmpPath
|
mkdir $tmpPath
|
||||||
|
|
||||||
trap "rm -rf $tmpPath" EXIT
|
trap "rm -rf $tmpPath" EXIT
|
||||||
|
|
||||||
# Perform the checkout.
|
# Perform the checkout.
|
||||||
|
if [[ $url != /* ]]; then
|
||||||
|
tmpClone=$tmpPath/hg-clone
|
||||||
hg clone -q -y -U "$url" $tmpClone >&2
|
hg clone -q -y -U "$url" $tmpClone >&2
|
||||||
|
else
|
||||||
|
tmpClone=$url
|
||||||
|
fi
|
||||||
hg archive -q -y -r "$rev" --cwd $tmpClone $tmpArchive
|
hg archive -q -y -r "$rev" --cwd $tmpClone $tmpArchive
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user