diff options
author | John P. Davis <zhen@gentoo.org> | 2004-01-04 05:15:47 +0000 |
---|---|---|
committer | John P. Davis <zhen@gentoo.org> | 2004-01-04 05:15:47 +0000 |
commit | 668497630fd92dc6cafb486a9c56ee0cfd972bc5 (patch) | |
tree | 3cbc3b9a60157138e91ba40985f02e100e354991 /src/relnotes | |
parent | fix typo (diff) | |
download | gentoo-668497630fd92dc6cafb486a9c56ee0cfd972bc5.tar.gz gentoo-668497630fd92dc6cafb486a9c56ee0cfd972bc5.tar.bz2 gentoo-668497630fd92dc6cafb486a9c56ee0cfd972bc5.zip |
fully working tool now
Diffstat (limited to 'src/relnotes')
-rw-r--r-- | src/relnotes/genrelnotes.sh | 126 | ||||
-rw-r--r-- | src/relnotes/relnotes.xml | 6 |
2 files changed, 92 insertions, 40 deletions
diff --git a/src/relnotes/genrelnotes.sh b/src/relnotes/genrelnotes.sh index 00bb90da4c..e443a554e0 100644 --- a/src/relnotes/genrelnotes.sh +++ b/src/relnotes/genrelnotes.sh @@ -1,7 +1,7 @@ #!/bin/bash # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/relnotes/genrelnotes.sh,v 1.2 2003/12/31 22:38:23 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/relnotes/genrelnotes.sh,v 1.3 2004/01/04 05:15:47 zhen Exp $ ## Gentoo Release Notes generator ## John Davis <zhen@gentoo.org>; 2003 12 30 @@ -11,17 +11,100 @@ source /sbin/functions.sh +XMLLINT="/usr/bin/xmllint" +LYNX="/usr/bin/lynx" +XSLTPROC="/usr/bin/xsltproc" + +usage() { + echo "Gentoo Release Notes Generator (genrelnotes.sh)" + echo "Valid arguments: " + echo + echo "sedme: (genrelnotes.sh sedme output.xml) runs a sed on the template to produce" + echo "a template corrected (output.xml) for the current release." + echo + echo "genall: (genrelnotes.sh genall input.xml) creates txt and html versions on input.xml" + echo + echo "gentxt: (genrelnotes.sh gentxt input.xml) generates txt from input.xml" + echo + echo "genhtml: (genrelnotes.sh genhtml input.xml) generates html from input.xml" +} + +sedme() { + if [ -z $1 ] + then + echo "You need to specify an output file!" + exit 1 + fi + local arch + local email + local name + local release + local reldate + + echo "The following questions will fill out the release notes template: " + echo -n "Name: "; read name + echo -n "e-mail: "; read email + echo -n "Release Architecture: "; read arch + echo -n "Release Version Stamp: "; read release + echo -n "Release Date: "; read reldate + + /usr/bin/sed -e s:##NAME:"${name}": \ + -e s:##EMAIL:"${email}": \ + -e s:##DATE:"${date}": \ + -e s:##ARCH:"${arch}": \ + -e s:##RELEASE:"${release}": \ + -e s:##RELDATE:"${reldate}":\ + relnotes.xml > ${1} +} + +gentxt() { + if [ -z ${1} ] + then + echo "You need to specify an input file!" + exit 1 + fi + if [ -e ${LYNX} ] + then + if [ ! -e "`basename ${1} .xml`.html" ] + then + genhtml ${1} + fi + ${LYNX} --dump "`basename ${1} .xml`.html" > "`basename ${1} .xml`.txt" + else + echo "${LYNX} not found!" + exit 1 + fi +} + +genhtml() { + if [ -z ${1} ] + then + echo "You need to specify an input file!" + exit 1 + fi + if [ -e ${XSLTPROC} ] + then + if [ ! -e guide.xsl ] + then + mkdir xsl + echo "Fetching guide.xsl from gentoo.org for HTML processing: " + /usr/bin/wget -c -O xsl/guide.xsl "http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/xml/htdocs/xsl/guide.xsl?rev=1.91&cvsroot=gentoo" + /usr/bin/wget -c -O xsl/content.xsl "http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/xml/htdocs/xsl/content.xsl?rev=1.2&cvsroot=gentoo" + /usr/bin/wget -c -O xsl/handbook.xsl "http://www.gentoo.org/cgi-bin/viewcvs.cgi/*checkout*/xml/htdocs/xsl/handbook.xsl?rev=1.12&cvsroot=gentoo" + fi + ${XSLTPROC} xsl/guide.xsl ${1} > "`basename ${1} .xml`.html" + else + echo "${XSLTPROC} not found!" + exit 1 + fi +} + case "$1" in "sedme") sedme $2 exit 0 ;; - "validate") - validate - exit 0 - ;; - "genall") genhtml $2 gentxt $2 @@ -43,34 +126,3 @@ case "$1" in exit 1 ;; esac - -usage() { - einfo "Gentoo Release Notes Generator (genrelnotes.sh)" - einfo "Valid arguments: " - echo "sedme: (genrelnotes.sh sedme output.xml) runs a sed on the template to produce" - echo "a template corrected (output.xml) for the current release." - echo - echo "validate: (genrelnotes.sh validate input.xml) validates the XML of the input file" - echo - echo "genall: (genrelnotes.sh genall input.xml) creates txt and html versions on input.xml" - echo - echo "gentxt: (genrelnotes.sh gentxt input.xml) generates txt from input.xml" - echo - echo "genhtml: (genrelnotes.sh genhtml input.xml) generates html from input.xml" -} - -sedme() { -} - -validate() { -} - -genall() { -} - -gentxt() { -} - -genhtml() { -} - diff --git a/src/relnotes/relnotes.xml b/src/relnotes/relnotes.xml index 77c15721a5..cf033dffb2 100644 --- a/src/relnotes/relnotes.xml +++ b/src/relnotes/relnotes.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- $Header: /var/cvsroot/gentoo/src/relnotes/relnotes.xml,v 1.2 2003/12/31 22:24:16 zhen Exp $ --> -<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> +<!-- $Header: /var/cvsroot/gentoo/src/relnotes/relnotes.xml,v 1.3 2004/01/04 05:15:47 zhen Exp $ --> +<!DOCTYPE guide SYSTEM "http://www.gentoo.org/dtd/guide.dtd"> <guide link="releng.xml"> <title>##ARCH Release Notes for Gentoo Linux ##RELEASE</title> @@ -20,7 +20,7 @@ Gentoo ##RELEASE Release Notes <license/> <version>##RELEASE</version> -<date>##RELEASE_DATE</date> +<date>##RELDATE</date> <chapter> <title>The Gentoo Linux Project</title> |