diff options
| author | davidovski <david@davidovski.xyz> | 2021-10-06 23:30:26 +0100 | 
|---|---|---|
| committer | davidovski <david@davidovski.xyz> | 2021-10-06 23:30:26 +0100 | 
| commit | 9a22337a23d6122e13323f3b9e51c4cf037cbf9f (patch) | |
| tree | a54c067f41ee7cb71e14e235fea5dcb9af84cfe2 | |
| parent | 2939f4d1c36d784773f6ab642e83b48e413adbfc (diff) | |
added features for branch switching
| -rwxr-xr-x | build-repo.sh | 2 | ||||
| -rwxr-xr-x | xibuild | 7 | 
2 files changed, 5 insertions, 4 deletions
| diff --git a/build-repo.sh b/build-repo.sh index c3dd2b0..6cfc416 100755 --- a/build-repo.sh +++ b/build-repo.sh @@ -9,7 +9,7 @@ fetch () {  }  build () { -    for REPO in $(du -h xipkgs/repo/* | awk '{print $2}'); do +    for REPO in $(du -h xipkgs/repo/* | awk '{print $2}' | sort -r); do          REPO_NAME=$(echo $REPO | cut -d"/" -f2-)          REPO_INDEX=dist/$REPO_NAME/index.html @@ -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 - | 
