r367 - scripts/trunk

Eddy Petrisor eddyp-guest at costa.debian.org
Sun Mar 26 22:59:58 UTC 2006


Author: eddyp-guest
Date: 2006-03-26 22:59:57 +0000 (Sun, 26 Mar 2006)
New Revision: 367

Added:
   scripts/trunk/prepare-release
Log:
Generic prepare script - only help and error functions

Added: scripts/trunk/prepare-release
===================================================================
--- scripts/trunk/prepare-release	2006-03-26 21:04:19 UTC (rev 366)
+++ scripts/trunk/prepare-release	2006-03-26 22:59:57 UTC (rev 367)
@@ -0,0 +1,138 @@
+#!/bin/sh
+# vim:tw=75:wrap:fo=tcqn2:sw=4:sts=4:et
+
+# Prepare-release script, author "Eddy Petrișor" <eddy.petrisor AT gmail DOT com>
+# Copyright Eddy Petrișor, 2006
+# Licensed under the terms of GNU General Public License version 2, or 
+# later, at your choice.
+#
+
+
+
+# It is desirable that it should do most of the grunt work at a release, and
+# of course not mess anything ;-).
+#
+#
+# Task for the prepare script:
+# - fetch the next debian release version and the upstream relase version
+#   from the trunk of debian/changelog (save in internal VARIABLES)
+# - handles a release properly (if is told to do so):
+#   * change the suite from UNRELEASED to unstable (should be tunable)
+#   * auto tag (if specified) (assumes the developer uses a ssh-agent or will
+#     input password/passphrase)
+#   * autoincrement debian version and autoadd a changelog entry in trunk
+#   * prepare for next release's work the changelog entry
+#     (s/unstable/UNRELEASED)
+#   * commit in SVN
+# - handles a rebuild (must provide debian release version; no release will
+#   be done)
+#
+# (Idealy) the invocation should be of the form:
+#
+#  prepare --forrelease GAME
+#  or
+#  prepare --rebuild DEBVERSION GAME
+#
+# This should do the right thing for either cases.
+#
+#
+# NOTE: maybe some data in the repo that associate a package name with a
+# repo path, upstream path (watch files?) and subpackages might be a good
+# idea - see boson's packages for examples about such packages
+#
+
+
+help ()
+{
+    echo "SVN Debian package releaser" ; echo
+    echo " This program helps at releasing or rebuilding older relased"
+    echo " Debian packages kept in SVN. It should be able to deal both"
+    echo " with full packages as well as with Debian patches (diff.gz)."
+    echo; echo " Invocation:"
+    echo " \t$0 --release [[-n|--nocommit]|[-t|--notag]] [--suite SUITE] PACK"
+    echo " \t or"
+    echo " \t$0 --rebuild DEBVERSION PACK" ; echo
+    echo " --forrelease\n \tSearches through the file packs.prep for the"
+    echo " \tSVN link to the package in question, identifies the latest"
+    echo " \tDebian package version (by reading debian/changelog) that"
+    echo " \tshould have the suite set to UNRELEASED; then, if --nocommit"
+    echo " \tis absent, it will change the suite and commit into SVN, tag"
+    echo " \tthe newly committed version, increment the Debian version,"
+    echo " \tchange the suite to UNRELEASED and then commit yet again."
+    echo " -n | --nocommit"
+    echo " \tIf this parameter is given, no automatic SVN commiting will"
+    echo " \tbe done. This will not allow the relased version to be tagged."
+    echo " -t | --notag"
+    echo " \tBy default, the relased versions are also tagged in SVN. This"
+    echo " \toption allows the preapring to be done without tagging. Note"
+    echo " \tthat --notag will imply that there will be commits after suit"
+    echo " \tchanges. Please use --nocommit if you don't want this either."
+    echo " --suite SUITE"
+    echo " \tThe default suite name is 'unstable'. The suite name can be"
+    echo " \toverridden with this option." ; echo
+    echo " Note: in the current directory there should be a file called"
+    echo "    packs.prep which should contain the package options needed by"
+    echo "    the prepare script."
+}
+
+syntax_error()
+{
+    echo 2>&1 "$(basename $0): $*"
+    help
+    exit 1
+}
+
+warning()
+{
+    echo 2>&1 "$(basename $0): $*"
+}
+
+init ()
+{
+    # Assume a few default variables
+    [ -z $SUITE ] && SUITE=unstable
+    [ -z $COMMIT ] && COMMIT=yes
+    [ -z $TAG ] && TAG=yes
+    [ -z $PACK ] && PACK="NOPACK"
+
+    while [ $# -gt 0 ]
+    do
+        case $1 in
+        --suite=*)
+            SUITE=${1#--suite=}
+            shift
+            ;;
+        --suite|-s)
+            if [ $# -lt 2 ]; then syntax_error "$1 needs an argument"; fi
+            METHOD=$2
+            shift
+            shift
+            ;;
+        --notag|-t)
+            TAG=no
+            shift
+            ;;
+        --nocommit|-)
+            COMMIT=no
+            TAG=no
+            [ "$TAG" = "yes" ] && warning "$1 will not allow tagging"
+            shift
+            ;;
+        -*)
+            syntax_error "Unknown option \`$1'"
+            ;;
+        *)
+            [ $# -ne 1 ] && syntax_error "Only one package name is allowed"
+            ;;
+        esac
+    done
+}
+
+
+warning "$0 is not yet complete. Please be patient."
+warning "\n Help follows:"
+
+help
+exit 13
+
+


Property changes on: scripts/trunk/prepare-release
___________________________________________________________________
Name: svn:executable
   + *




More information about the Pkg-games-devel mailing list