From 8e2e47d3de7e98b58fab285e4449cf146a012a53 Mon Sep 17 00:00:00 2001 From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Fri, 11 Dec 2009 21:25:59 +0000 Subject: [PATCH] do_release: Add support to release from a dir below 'branches'. Accept partial checkouts. git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2997 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- smartmontools/CHANGELOG | 3 +++ smartmontools/do_release | 35 +++++++++++++++++------------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG index 009b49b10..7569b6a1c 100644 --- a/smartmontools/CHANGELOG +++ b/smartmontools/CHANGELOG @@ -43,6 +43,9 @@ NOTES FOR FUTURE RELEASES: see TODO file. <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> + [CF] do_release: Add support to release from a dir below 'branches'. + Accept partial checkouts. + smartmontools 5.39 2009-12-09 [CF] do_release: Commit CHANGELOG and NEWS also. Allow to review changes. diff --git a/smartmontools/do_release b/smartmontools/do_release index 73e3dd2f9..3070bfef5 100755 --- a/smartmontools/do_release +++ b/smartmontools/do_release @@ -43,25 +43,26 @@ esac # Check workdir case "`/bin/pwd`" in - */trunk/smartmontools) ;; - *) echo "not run from trunk checkout"; exit 1 ;; + */trunk/smartmontools) WDROOT="../.."; DIRPAT="trunk" ;; + */branches/*/smartmontools) WDROOT="../../.."; DIRPAT="branches/*" ;; + *) echo "`/bin/pwd`: no trunk or branch working dir"; exit 1 ;; esac -if [ ! -d ../../tags ]; then +if [ ! -d "$WDROOT/tags" ]; then echo "tags directory missing"; exit 1 fi -REV=`(cd ../.. && svnversion)` || exit 1 -if [ -z "`echo "$REV" | sed -n '/^[0-9][0-9]*M\?$/p'`" ]; then - echo "Working directory not clean: $REV"; exit 1 +REVX="`(cd $WDROOT && svnversion)`" || exit 1 +REV="${REVX/%[PM]/}"; REV="${REV/%[PM]/}" +if [ -n "${REV//[0-9]/}" ]; then + echo "Working directory not clean: $REVX"; exit 1 fi -REV="${REV%M}" -(cd ../.. && svn status) | while read s; do +(cd $WDROOT && svn status) | while read s; do case "$s" in - "M trunk/smartmontools/CHANGELOG") echo "$s: OK";; - "M trunk/smartmontools/NEWS") echo "$s: OK";; - "M trunk/smartmontools/configure.in") echo "$s: OK";; + "M "$DIRPAT/smartmontools/CHANGELOG) echo "$s: OK";; + "M "$DIRPAT/smartmontools/NEWS) echo "$s: OK";; + "M "$DIRPAT/smartmontools/configure.in) echo "$s: OK";; *) echo "$s: not allowed"; exit 1;; esac done @@ -82,7 +83,7 @@ if [ "$RC" ]; then RELEASE="${RELEASE}_${RC}" fi -if [ -e "../../tags/$RELEASE" ]; then +if [ -e "$WDROOT/tags/$RELEASE" ]; then echo "tags/$RELEASE exists"; exit 1 fi @@ -103,13 +104,11 @@ sleep 20 set -v # Create tag and commit -cd ../.. if [ "$COMMIT" = "yes" ]; then - svn mkdir tags/$RELEASE - svn copy trunk/smartmontools tags/$RELEASE/smartmontools - svn commit -m "Release $VERSIONRC $RELEASE" + svn mkdir $WDROOT/tags/$RELEASE + svn copy ../smartmontools $WDROOT/tags/$RELEASE/smartmontools + svn commit -m "Release $VERSIONRC $RELEASE" $WDROOT fi -cd trunk/smartmontools # Build ./autogen.sh @@ -130,7 +129,7 @@ md5sum $TARFILE > $TARFILE.md5 sha1sum $TARFILE > $TARFILE.sha1 # Increase release number -if [ -z "$RC" ]; then +if [ -z "$RC" -a "$DIRPAT" = "trunk" ]; then inc_release if [ "$COMMIT" = "yes" ]; then perl -p -i.bak -e "s/$PERL_OLD/$PERL_NEW/" configure.in -- GitLab