diff options
author | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-10-15 13:02:34 -0500 |
---|---|---|
committer | Ryan S. Arnold <ryan.arnold@linaro.org> | 2016-10-15 13:02:34 -0500 |
commit | c9d2c8ef6ea886c6cccf3b766dc9739060b4c4ca (patch) | |
tree | f427997fd5d505c6787366115418dd514b2b34fc | |
parent | 3cde4a2e1e8e727e9af66fa0aedfe18129780bb6 (diff) | |
parent | 7552cee0afeb84f45ef2d1cfa860a62b974a3808 (diff) |
Merge branch 'master' of ssh://git.linaro.org/toolchain/tcwg-release-tools into tcwg-rngen
Change-Id: Id9fd40b3904a1b46a30d2c43bc6f770e6d921bc1
-rwxr-xr-x | tcwg-release.sh | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/tcwg-release.sh b/tcwg-release.sh index 495ef0b..beecaf9 100755 --- a/tcwg-release.sh +++ b/tcwg-release.sh @@ -429,11 +429,11 @@ export_source() { build() { pushd $REL_DIR/gcc-linaro-${rname} 1>/dev/null - env SOURCEDIR="$PWD/gcc/doc" DESTDIR="$PWD/INSTALL" ./gcc/doc/install.texi2html + env SOURCEDIR="$PWD/gcc/doc" DESTDIR="$PWD/INSTALL" ./gcc/doc/install.texi2html || clean_and_die "Failed to build documentation." env MAKE="make -j4" contrib/gcc_build -d $REL_DIR/gcc-linaro-${rname} \ -o $REL_DIR/objdir -c \ - "--enable-generated-files-in-srcdir --disable-multilib" build - mv -v $REL_DIR/objdir/gcc/po/*.gmo $REL_DIR/gcc-linaro-${rname}/gcc/po/ + "--enable-generated-files-in-srcdir --disable-multilib" build || clean_and_die "Failed to build GCC." + mv -v $REL_DIR/objdir/gcc/po/*.gmo $REL_DIR/gcc-linaro-${rname}/gcc/po/ || clean_and_die "Failed to move gmo files" popd 1>/dev/null } @@ -696,7 +696,61 @@ elif (( VERBOSITY >= 3 )); then set -x; fi -# TODO: Validate BRANCH or TAG as valid. +# If the REMOTE hasn't been specified, default to 'origin'. +: ${REMOTE:=origin} + +# Release-Candidates and Releases are both pushed to the release branch +# since there is a strict linear progression from candidates to releases. +# +# If the user is tracking a release tag or candidate tag to build a new +# candidate or release, we need to checkout from the release branch and not the +# tag so that we don't get merge conflicts with a previous rc 'bump' when the +# new series is pushed, or miss a cherry-picked patch on the release branch. +# The following is a merge-conflict due to checking out linaro-6.1-2018.08-rc2 +# from the linaro-6.1-2016.08-rc1 tag: +# +# linaro-local/releases/linaro-6.1-2016.08 +# o - Backport Commit +# o - FSF Branch Merge Commit +# o - Snapshot Version Commit +# o - -rc1 Version Commit <--- [TAG] linaro-6.1-2016.08-rc1 +# o - -rc2~dev Version Bump Commit | +# o - Cherry-Picked Patch Commit +-- releases/linaro-6.1-2016.08-rc2 +# o - Backport Commit +# ^ o - FSF Branch Merge Commit +# | o - Snapshot Version Commit +# | o - -rc1 Version Commit +# | linaro-6.1-2016.08-rc2 [TAG] ---> o - -rc2 Version Commit +# | +# +- merge conflict & merge commit <--- git push +# +# Pushing release/linaro-6.1-2016.08-rc2 onto the remote +# linaro-local/releases/linaro-6.1-2016.08 release branch will cause a merge +# conflict between the "-rc2 Version Commit", "-rc2~dev Version Bump Commit", +# and the "Cherry-Picked Patch Commit". While a merge commit could be pushed +# to the linaro-local/releases/linaro-6.1-2016.08 remote branch, the newly +# created linaro-6.1-2016.08-rc2 tag would not represent an accurate view of the +# remote branch head. +# +# The correct behavior is use the tag to determine the correct release branch +# and checkout a working branch (releases/linaro-6.2-2016.08-rc2) from that and +# not the tag. +if [ "${CANDIDATE:+set}" = "set" ] || [ "${RELEASE:+set}" = "set" ]; then + # We only redirect track to a branch if the tag being tracked is not + # a snapshot tag. + if [ "${TAG:+set}" = "set" ] && [ `echo $TAG | grep -c "snapshot"` -lt 1 ]; then + + # The git -r switch denotes that we only want remote branches that a tag + # lives on. We then have to grep for '${REMOTE}' because users might + # have more than one remote (e.g., an additional 'gerrit' remote) or have + # a remote named something other than 'origin'. The tag might show up on + # more than one branch so we restrict to the first branch we find. + BRANCH="`git branch -r --contains ${TAG} | grep -m 1 ${REMOTE}`" + # Remove leading whitespace + BRANCH="${BRANCH#"${BRANCH%%[![:space:]]*}"}" + unset TAG + fi +fi # Track either the BRANCH or the TAG track="${BRANCH:+${BRANCH}}${TAG:+${TAG}}" @@ -716,9 +770,6 @@ save_branch="$(git rev-parse --abbrev-ref HEAD)" # Test to make sure the branch or tag exists git rev-parse --abbrev-ref $track &>/dev/null || die "${TAG:+Tag }${BRANCH:+Branch }\"$track\" doesn't exist." -# If the REMOTE hasn't been specified, default to 'origin'. -: ${REMOTE:=origin} - if [[ x"$(git remote -v | grep "${REMOTE}")" = x ]]; then die "remote ${REMOTE} is not in your git repository." fi @@ -905,6 +956,9 @@ if [ "$user_ok" == "y" ]; then print_info "${bold}${red}Manual upload is required." ask "Press [Enter] to continue" fi +else + print_info "${bold}${red}Skipping upload of ${release} since you skipped the build phase" + ask "Press [Enter] to continue" fi popd 1>/dev/null |