summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorPaul W. Frields <stickster@gmail.com>2006-01-15 19:18:08 +0000
committerPaul W. Frields <stickster@gmail.com>2006-01-15 19:18:08 +0000
commit0b6b0c95826cd3a0c1983b41fee87550c827a2a4 (patch)
treee5830b4aa82d5119c496f4f92dba1c05d1a17d97 /bin
parent9ce827ddec63987eeef8d37c6955f552cbc2812f (diff)
downloadfedora-doc-utils-0b6b0c95826cd3a0c1983b41fee87550c827a2a4.tar.gz
fedora-doc-utils-0b6b0c95826cd3a0c1983b41fee87550c827a2a4.tar.xz
fedora-doc-utils-0b6b0c95826cd3a0c1983b41fee87550c827a2a4.zip
Script to support Makefile "clog" target
Diffstat (limited to 'bin')
-rwxr-xr-xbin/insert-changelog60
1 files changed, 60 insertions, 0 deletions
diff --git a/bin/insert-changelog b/bin/insert-changelog
new file mode 100755
index 0000000..b386522
--- /dev/null
+++ b/bin/insert-changelog
@@ -0,0 +1,60 @@
+#!/bin/sh
+#
+# insert-changelog - Add a new revision to rpm-info.xml
+#
+
+XSLTPROC=${XSLTPROC:-xsltproc}
+XMLFORMAT=${XMLFORMAT:-../docs-common/bin/xmlformat -f ../docs-common/bin/xmlformat-fdp.conf}
+
+echo -n "Change to [r]pm package or [d]ocument source (q=Abort)? [r/D/q] "
+while test -z "$ROLE" ; do
+ read -s -n 1 R
+ case "$R" in
+ 'r' | 'R' )
+ ROLE="rpm" ;;
+ 'd' | 'D' | '' )
+ ROLE="doc" ;;
+ 'q' | 'Q' )
+ ROLE="ABORT" ;;
+ esac
+done
+echo $ROLE
+
+if test $ROLE = "rpm"; then
+ REVDATE=`date +"%a %b %d %Y"`
+elif test $ROLE = "doc"; then
+ REVDATE=`date +"%Y-%M-%d"`
+else
+ echo "Aborting"
+ exit 1
+fi
+
+LASTREV=$(${XSLTPROC} --stringparam role "$ROLE" \
+ ../docs-common/packaging/doc-version.xsl rpm-info.xml)
+while test -z "$NUMBER"; do
+ echo -n "Enter revision number greater than $LASTREV: "
+ read NUMBER
+ # Yes, it's perfectly safe to assume Python is present
+ if test `python -c "from distutils import version; a=version.LooseVersion('$LASTREV') ; b=version.LooseVersion('$NUMBER'); print b>a"` = "False"; then
+ NUMBER=
+ fi
+done
+
+${XSLTPROC} ../docs-common/packaging/get-all-workers.xsl \
+ rpm-info.xml | sed 's/^ \+//g' | grep -v '^$' | cat -n
+echo -n "Enter number for responsible contributor: "
+read PERSON
+
+ID=$(${XSLTPROC} --stringparam att "id" --param pos $PERSON \
+ ../docs-common/packaging/get-worker.xsl rpm-info.xml)
+echo "Enter a one-line description of the change."
+echo "To add extra details, edit rpm-info.xml afterward."
+read DETAILS
+
+${XSLTPROC} --stringparam role "$ROLE" \
+ --stringparam number "$NUMBER" \
+ --stringparam person "$ID" \
+ --stringparam date "$REVDATE" \
+ --stringparam detail "$DETAILS" \
+ ../docs-common/packaging/insert-changelog.xsl rpm-info.xml | \
+ ${XMLFORMAT}