docs-common/bin insert-changelog,1.1,1.2

Paul W. Frields (pfrields) fedora-docs-commits at redhat.com
Sun Jan 15 22:33:05 UTC 2006


Author: pfrields

Update of /cvs/docs/docs-common/bin
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26228/docs-common/bin

Modified Files:
	insert-changelog 
Log Message:
Use new abstracted functions


Index: insert-changelog
===================================================================
RCS file: /cvs/docs/docs-common/bin/insert-changelog,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- insert-changelog	15 Jan 2006 19:18:08 -0000	1.1
+++ insert-changelog	15 Jan 2006 22:32:57 -0000	1.2
@@ -3,10 +3,12 @@
 # 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}
+. "$(dirname $0)/fdp-functions"
 
-echo -n "Change to [r]pm package or [d]ocument source (q=Abort)? [r/D/q] "
+RPMINFO="rpm-info.xml"
+OUTPUT="${1:-${PWD}/$RPMINFO.clog$$}"
+
+echo -n "Change to [r]pm package or [d]ocument source? [r/D] "
 while test -z "$ROLE" ; do
     read -s -n 1 R
     case "$R" in
@@ -14,8 +16,6 @@
 	    ROLE="rpm" ;;
 	'd' | 'D' | '' )
 	    ROLE="doc" ;;
-	'q' | 'Q' )
-	    ROLE="ABORT" ;;
     esac
 done
 echo $ROLE
@@ -25,12 +25,11 @@
 elif test $ROLE = "doc"; then
     REVDATE=`date +"%Y-%M-%d"`
 else
-    echo "Aborting"
+    echo "This should never happen; aborting"
     exit 1
 fi
 
-LASTREV=$(${XSLTPROC} --stringparam role "$ROLE" \
-    ../docs-common/packaging/doc-version.xsl rpm-info.xml)
+LASTREV=$(get_latest_revision "$ROLE")
 while test -z "$NUMBER"; do
     echo -n "Enter revision number greater than $LASTREV: "
     read NUMBER
@@ -40,13 +39,11 @@
     fi
 done
 
-${XSLTPROC} ../docs-common/packaging/get-all-workers.xsl \
-    rpm-info.xml | sed 's/^ \+//g' | grep -v '^$' | cat -n
+get_all_workers
 echo -n "Enter number for responsible contributor: "
 read PERSON
+ID=$(get_worker_attribute "id" $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
@@ -56,5 +53,6 @@
     --stringparam person "$ID" \
     --stringparam date "$REVDATE" \
     --stringparam detail "$DETAILS" \
-    ../docs-common/packaging/insert-changelog.xsl rpm-info.xml | \
-    ${XMLFORMAT}
+    ../docs-common/packaging/insert-changelog.xsl "$RPMINFO" | \
+    ${XMLFORMAT} > ${OUTPUT}
+echo "New $RPMINFO written to $OUTPUT"




More information about the Fedora-docs-commits mailing list