From 9a22337a23d6122e13323f3b9e51c4cf037cbf9f Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 6 Oct 2021 23:30:26 +0100 Subject: added features for branch switching --- xibuild | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'xibuild') diff --git a/xibuild b/xibuild index 06fecb8..d16ad41 100755 --- a/xibuild +++ b/xibuild @@ -57,6 +57,7 @@ xibuild () { echo "Passing missing package stage" } + BRANCH=HEAD source $BUILD_FILE @@ -88,7 +89,7 @@ xibuild () { # try get the commit hash for the package if git ls-remote -q $SOURCE &> /dev/null; then - VER_HASH=$(git ls-remote $SOURCE HEAD ) + VER_HASH=$(git ls-remote $SOURCE $BRANCH ) else VER_HASH=$(curl -Ls $SOURCE | md5sum) fi @@ -112,8 +113,9 @@ xibuild () { fi printf "$INFO\tfetching package..."; - if git ls-remote -q $SOURCE &> /dev/null; then + if git ls-remote -q $SOURCE $BRANCH &> /dev/null; then git clone $SOURCE . >> $LOGFILE 2>&1 && printf "$PASS fetched $(du -sh $PKG_BUILD_DIR | awk '{ print $1 }') source\n" || return 1; + git checkout $BRANCH >> $LOGFILE 2>&1 else DOWNLOADED=$(basename $SOURCE) curl -Ls $SOURCE > $DOWNLOADED @@ -221,4 +223,3 @@ if [ $# -gt 0 ]; then else usage; return 1 fi - -- cgit v1.2.1