[csw-devel] SF.net SVN: opencsw:[589] utilities/cswch

skayser at users.sourceforge.net skayser at users.sourceforge.net
Sun Nov 27 00:40:27 CET 2011


Revision: 589
          http://opencsw.svn.sourceforge.net/opencsw/?rev=589&view=rev
Author:   skayser
Date:     2011-11-26 23:40:27 +0000 (Sat, 26 Nov 2011)
Log Message:
-----------
utilities: add cswch (helper to build changelog.CSW files)

Added Paths:
-----------
    utilities/cswch

Added: utilities/cswch
===================================================================
--- utilities/cswch	                        (rev 0)
+++ utilities/cswch	2011-11-26 23:40:27 UTC (rev 589)
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# cswch [msg]:
+#   Assemble and display a changelog section (related to $PWD's build recipe)
+#   that's suitable for inclusion in changelog.CSW. Doesn't support parsing
+#   or extending existing changelog.CSW files, i.e. changelog.CSW editing needs
+#   to be done manually.
+#
+# TODO:
+# * Feature: prepend a new section to an existing changelog.CSW
+
+[ -f Makefile ] && ggrep -q NAME Makefile || {
+    echo "Needs to be run from within a GAR trunk/ directory" >&2
+    exit 1
+}
+
+CHANGETEXT="Describe changes"
+[ -n "$1" ] && CHANGETEXT="$1"
+
+NAME=`grep ^NAME Makefile | cut -d= -f2 | tr -d " "`
+GARNAME=`grep ^GARNAME Makefile | cut -d= -f2 | tr -d " "`
+VERSION=`grep ^VERSION Makefile | cut -d= -f2 | tr -d " "`
+GARVERSION=`grep ^GARVERSION Makefile | cut -d= -f2 | tr -d " "`
+REV=`date +%Y.%m.%d`
+USERNAME=`getent passwd $USER | cut -d: -f5`
+RFC822TS=`gdate -R`
+
+echo `pwd` | ggrep -q pkg/cpan && \
+        NAME=`grep ^CATALOGNAME Makefile | cut -d= -f2 | tr -d " "`
+
+[ -z "$NAME" ] && NAME=$GARNAME
+[ -z "$VERSION" ] && VERSION=$GARVERSION
+
+cat <<EOM
+$NAME ($VERSION,REV=$REV)
+
+  * $CHANGETEXT
+
+ -- $USERNAME <$USER at opencsw.org>  $RFC822TS
+EOM

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list