diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build-otp | 2 | ||||
-rwxr-xr-x | scripts/bundle-otp | 14 | ||||
-rwxr-xr-x | scripts/pre-push | 35 |
3 files changed, 47 insertions, 4 deletions
diff --git a/scripts/build-otp b/scripts/build-otp index c38d2c98de..abf8d5d67f 100755 --- a/scripts/build-otp +++ b/scripts/build-otp @@ -57,7 +57,7 @@ if [ "$1" = "docs" ]; then do_and_log "Linting documentation" make xmllint # The code below prepares this build to be used as a deploy to # github pages for documentation. - if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_TAG" = "" ]; then + if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_TAG" = "" -a "$TRAVIS_REPO_SLUG" = "erlang/otp" ]; then set -x rm -rf logs SHA=`git rev-parse --verify HEAD` diff --git a/scripts/bundle-otp b/scripts/bundle-otp index f3ff632b63..aa1f166732 100755 --- a/scripts/bundle-otp +++ b/scripts/bundle-otp @@ -2,6 +2,10 @@ set -e +if [ "$TRAVIS_PULL_REQUEST" = "false" -a "$TRAVIS_REPO_SLUG" != "erlang/otp" ]; then + exit 0 +fi + OTP_META_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.txt OTP_FILE=$ERL_TOP/${TRAVIS_TAG}-bundle.tar.gz @@ -9,6 +13,9 @@ REPOSITORIES="otp,$TRAVIS_TAG corba,.*" mkdir bundle +## Turn off * expansion, needed for the .* regexp to work +set -f + for repo in $REPOSITORIES; do OLD_IFS=$IFS IFS=',' @@ -18,12 +25,17 @@ for repo in $REPOSITORIES; do git clone https://github.com/erlang/$1 $1 cd $1 echo $1 $2 - TAG=`git tag -l | grep -P "$2" | sort -V | tail -1` + TAG=`git tag -l | grep -P "^$2$" | sort -V | tail -1` git checkout $TAG SHA=`git rev-parse --verify HEAD` rm -rf .git echo "$1 $TAG $SHA" >> $OTP_META_FILE done +## Turn on * expansion +set +f + cd $ERL_TOP/bundle/ tar czf $OTP_FILE * + +exit 0 diff --git a/scripts/pre-push b/scripts/pre-push index 945fb3519a..71e9fd1e75 100755 --- a/scripts/pre-push +++ b/scripts/pre-push @@ -22,7 +22,9 @@ # <local ref> <local sha1> <remote ref> <remote sha1> # -RELEASES="21 20 19 18 17 r16 r15 r14 r13" +NEW_RELEASES="21 20 19 18 17" +OLD_RELEASES="r16 r15 r14 r13" +RELEASES="$NEW_RELEASES $OLD_RELEASES" # First commit on master, not allowed in other branches MASTER_ONLY=aea2a053e28a11497796879715be29ab0c3cd1a0 @@ -31,6 +33,19 @@ MASTER_ONLY=aea2a053e28a11497796879715be29ab0c3cd1a0 NCOMMITS_MAX=100 NFILES_MAX=100 + +# Example testing this script for "git push upstream OTP-20.3.8.2": +# +#> null=0000000000000000000000000000000000000000 +#> echo "refs/tags/OTP-20.3.8.2 dummysha refs/tags/OTP-20.3.8.2 $null" | scripts/pre-push upstream https://github.com/erlang/otp.git + +# Example to test "git push upstream master" +# +#> local_sha=`git rev-parse master` +#> remote_sha=`git rev-parse upstream/master` +#> echo "refs/heads/master $local_sha refs/heads/master $remote_sha" | scripts/pre-push upstream https://github.com/erlang/otp.git + + remote="$1" url="$2" @@ -158,8 +173,24 @@ then exit 1 fi ;; - refs/tags/OTP-21.* | refs/tags/OTP-20.* | refs/tags/OTP-19.* | refs/tags/OTP-18.* | refs/tags/OTP-17.*) + refs/tags/OTP-*) tag=${remote_ref#refs/tags/} + REL="UNKNOWN" + for x in $NEW_RELEASES; do + if [ ${tag#OTP-$x.} != $tag ] + then + REL=$x + break + fi + done + if [ $REL = "UNKNOWN" ] + then + echo "$0 says:" + echo "***" + echo "*** Unknown OTP release number in tag '$tag'" + echo "***" + exit 1 + fi if [ "$remote_sha" != $null ] then echo "$0 says:" |