1
0
forked from ports/opt

git: allow the git port driver to use alternative local repository paths, implements FS#1364

This commit is contained in:
Thomas Penteker 2017-02-15 00:20:15 +01:00
parent e3c467469f
commit 43ed834f19
2 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,7 @@
untrusted comment: verify with /etc/ports/opt.pub
RWSE3ohX2g5d/XkNSnlsZHvZr+Ee276eVOJSruY/Ey+KG9cGhLuag4ClS1P0lFew5AklBTu/wprgtfZEDDKZWzg7XlkWPjjE8QU=
RWSE3ohX2g5d/YMF3Jm6ktKhiSMYt26bFYonkVfE4/unLJAF0JMpRB/HOwLXkd6R18xj28OBx7ViW8t3tuMtH9SJRx8mSb9lygk=
SHA256 (Pkgfile) = 9de9f59a4e9344f2d45193837cedc8284b5e924340efd008e0ce1654794a4868
SHA256 (.footprint) = 26ac574bbaa0d50e4e5fc583003b6e9e2f239be20343f2d4c5e8c923b02b55a8
SHA256 (git-2.11.1.tar.xz) = c0a779cae325d48a1d5ba08b6ee1febcc31d0657a6da01fd1dec1c6e10976415
SHA256 (git-manpages-2.11.1.tar.xz) = 69486ed339ee0591001ae83d43c888aa26351b9680b6ceb59e06b593051bca31
SHA256 (git) = c8c405015dbce8103956966c89477fc3c04ca0da71c2b16663b882d639e25487
SHA256 (git) = 432108f8c5f5abeb429cab25181b43ee42060d46fa7fbe7e4b02790b56f61e8a

11
git/git
View File

@ -23,10 +23,15 @@ if [ -z "$BRANCH" ]; then
exit 2
fi
REPOSITORY="$PORTS_DIR/$NAME"
if [ -n "$LOCAL_REPOSITORY" ]; then
REPOSITORY="$LOCAL_REPOSITORY"
fi
echo "Fetching updates from $URL"
echo "Updating collection $NAME"
cd "$PORTS_DIR/$NAME" 2> "/dev/null"
cd "$REPOSITORY" 2> "/dev/null"
if [ $? -lt 1 ]; then
git checkout -q "$BRANCH"
@ -35,8 +40,8 @@ if [ $? -lt 1 ]; then
git clean -q -f
git reset -q --hard origin/"$BRANCH"
else
git clone -q -b "$BRANCH" "$URL" "$PORTS_DIR/$NAME"
ls /usr/ports/$NAME | sed "s/^/ Checkout /g"
git clone -q -b "$BRANCH" "$URL" "$REPOSITORY"
ls -1 $REPOSITORY | sed "s/^/ Checkout /"
fi
echo "Finished successfully"