mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 23:20:55 +00:00
a8c3649dd4
The old builder failed for: - remote HEAD != master - local repositories svn path=/nixpkgs/trunk/; revision=26984
28 lines
592 B
Bash
28 lines
592 B
Bash
source $stdenv/setup
|
|
|
|
header "exporting $url (rev $rev) into $out"
|
|
|
|
git init $out
|
|
cd $out
|
|
git remote add origin "$url"
|
|
git fetch origin
|
|
git remote set-head origin -a
|
|
|
|
# If no revision was specified, the remote HEAD will be used
|
|
git checkout -b __nixos_build__ origin/HEAD
|
|
|
|
if test -n "$rev"; then
|
|
echo "Trying to checkout: $rev"
|
|
parsed_rev=$(
|
|
git rev-parse --verify "$rev" 2>/dev/null ||
|
|
git rev-parse --verify origin/"$rev" 2>/dev/null
|
|
)
|
|
git reset --hard $parsed_rev
|
|
fi
|
|
|
|
if test -z "$leaveDotGit"; then
|
|
find $out -name .git\* | xargs rm -rf
|
|
fi
|
|
|
|
stopNest
|