From 47f67a822bdedb1a4c72caecc37c60328ae2229f Mon Sep 17 00:00:00 2001 From: mafoo Date: Mon, 5 Dec 2016 11:23:53 +0000 Subject: [PATCH] BugFix-Artifact in ls-remote it seems ls-remote filtering isn't working right, switched to using grep, although it means more data as all tags have to be downloaded and piped to grep it provides a more consistent result (1.6.13 could not be filtered to) --- debian/resources/fusionpbx.sh | 2 +- debian/resources/switch/source-release.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/resources/fusionpbx.sh b/debian/resources/fusionpbx.sh index ef14f6a..1cdd1b7 100755 --- a/debian/resources/fusionpbx.sh +++ b/debian/resources/fusionpbx.sh @@ -18,7 +18,7 @@ if [ $USE_SYSTEM_MASTER = true ]; then BRANCH="" else FUSION_MAJOR=$(git ls-remote --heads https://github.com/fusionpbx/fusionpbx.git | cut -d/ -f 3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f1) - FUSION_MINOR=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git $FUSION_MAJOR.* | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2) + FUSION_MINOR=$(git ls-remote --tags https://github.com/fusionpbx/fusionpbx.git | grep "$FUSION_MAJOR.*" | cut -d/ -f3 | grep -P '^\d+\.\d+' | sort | tail -n 1 | cut -d. -f2) FUSION_VERSION=$FUSION_MAJOR.$FUSION_MINOR verbose "Using version $FUSION_VERSION" BRANCH="-b $FUSION_VERSION" diff --git a/debian/resources/switch/source-release.sh b/debian/resources/switch/source-release.sh index 82891ca..598225f 100755 --- a/debian/resources/switch/source-release.sh +++ b/debian/resources/switch/source-release.sh @@ -14,7 +14,7 @@ CWD=$(pwd) #git clone https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch #git clone -b v1.6 https://freeswitch.org/stash/scm/fs/freeswitch.git /usr/src/freeswitch SWITCH_MAJOR=$(git ls-remote --heads https://freeswitch.org/stash/scm/fs/freeswitch.git "v*" | cut -d/ -f 3 | grep -P '^v\d+\.\d+' | sort | tail -n 1| cut -dv -f2) -SWITCH_MINOR=$(git ls-remote --tags https://freeswitch.org/stash/scm/fs/freeswitch.git v$SWITCH_MAJOR.* | cut -d/ -f3 | cut -dv -f2 | cut -d. -f3 | sort -n | tail -n1) +SWITCH_MINOR=$(git ls-remote --tags https://freeswitch.org/stash/scm/fs/freeswitch.git | grep "v$SWITCH_MAJOR\.*" | cut -d/ -f3 | cut -dv -f2 | cut -d. -f3 | sort -n | tail -n1) SWITCH_VERSION=$SWITCH_MAJOR.$SWITCH_MINOR echo "Using version $SWITCH_VERSION" cd /usr/src