]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - do_release
Updated changelog
[mirror_smartmontools-debian.git] / do_release
index 0a4beee5c0336442c7c3519af1f6d09137acf50e..66c6fc76f2f87d67957cf3da64b829728f5ef7cf 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/bash
 #
 # do a smartmontools release
-# (C) 2003-9 Bruce Allen <ballen4705@users.sourceforge.net>,
-#            Guido Guenther <agx@sigxcpu.org>
-#            Christian Franke <smartmontools-support@lists.sourceforge.net>
-# $Id: do_release 2970 2009-10-26 18:36:22Z chrfranke $
+# (C) 2003-11 Bruce Allen <ballen4705@users.sourceforge.net>,
+#             Guido Guenther <agx@sigxcpu.org>
+#             Christian Franke <smartmontools-support@lists.sourceforge.net>
+# $Id: do_release 3282 2011-03-04 19:26:59Z chrfranke $
 
 # Notes on generating releases:
 # (1) update NEWS
@@ -15,6 +15,9 @@
 
 set -e
 
+# Smartmontools Signing Key (through 2012)
+KEYID=0x2753E77A
+
 inc_release()
 {
   MINOR=`echo $VERSION | cut -d. -f2`
@@ -43,17 +46,31 @@ 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]*$/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
+
+(cd $WDROOT && svn status) | while read s; do
+  case "`echo $s | tr -s ' '`" in
+    "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
+if [ $? -ne 0 ]; then
+  exit 1
 fi
 
 # Get release number
@@ -69,12 +86,11 @@ 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
 
 echo "r$REV: Release $VERSIONRC $RELEASE"
-set -v
 
 # Update timestamp
 smartmontools_release_date=`date -u +"%Y-%m-%d"`
@@ -83,14 +99,19 @@ cat configure.in  | sed "s|smartmontools_release_date=.*|smartmontools_release_d
 cat configure.tmp | sed "s|smartmontools_release_time=.*|smartmontools_release_time=\"${smartmontools_release_time}\"|" > configure.in
 rm -f configure.tmp
 
+# Review changes
+svn diff
+echo "==================================================================="
+echo ">>> Continuing in 20 seconds ..."
+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
@@ -108,10 +129,9 @@ mv -f build/smartmontools-$VERSION.tar.gz $TARFILE
 rm -rvf build
 
 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
@@ -119,3 +139,8 @@ if [ -z "$RC" ]; then
   fi
 fi
 
+# Sign tarball
+if [ -n "$KEYID" ] && gpg --list-secret-keys $KEYID >/dev/null 2>/dev/null; then
+  gpg --default-key $KEYID --armor --detach-sign ./smartmontools-$VERSIONRC.tar.gz
+fi
+