From: Bob Stayton Date: Sat, 4 May 2013 21:01:09 +0000 (+0000) Subject: Check in previously unsaved changes made earlier for snapshot builds. X-Git-Tag: release/1.79.1~6^2~201 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1ba3c129a57c71ae9204b1cdb0499797bf24de4;p=docbook-dsssl Check in previously unsaved changes made earlier for snapshot builds. --- diff --git a/releasetools/Targets.mk b/releasetools/Targets.mk index 1e9c59ca9..823edf96f 100644 --- a/releasetools/Targets.mk +++ b/releasetools/Targets.mk @@ -32,11 +32,12 @@ RELEASE-NOTES.pdf: RELEASE-NOTES.xml NEWS.xml $(XINCLUDE) $< > RELEASE-NOTES-TMP.xml ifeq ($(PDF_MAKER),xep) $(XSLT) RELEASE-NOTES-TMP.xml $(FO_STYLE) $(basename $<).fo $(PDF_MAKER).extensions=1 \ + profile.condition="$(RELEASE_TYPE)" \ && $(XEP) $(XEP_FLAGS) $(basename $<).fo $(RM) RELEASE-NOTES-TMP.xml else ifeq ($(PDF_MAKER),dblatex) - $(XSLT) RELEASE-NOTES-TMP.xml $(STRIP_NS) RELEASE-NOTES-STRIPPED-TMP.xml + $(XSLT) RELEASE-NOTES-TMP.xml $(STRIP_NS) RELEASE-NOTES-STRIPPED-TMP.xml \ -$(DBLATEX) $(DBLATEX_FLAGS) \ -p $(DBX_STYLE) \ -o $@ \ diff --git a/releasetools/docbook-build b/releasetools/docbook-build index ff8d66453..138c325d7 100755 --- a/releasetools/docbook-build +++ b/releasetools/docbook-build @@ -1,9 +1,8 @@ -#!/bin/sh +#!/bin/bash # vim: number # docbook-build - Build script for generating DocBook project snapshots # $Id$ -# # fail if no CLASSPATH set if [ -z "$CLASSPATH" ]; then @@ -39,14 +38,15 @@ fi umask 002 # set up some defaults +SVNCHECK=no ENGINE=xsltproc PDF_MAKER=dblatex TAR=tar TARFLAGS=P ZIPTARG=zip -SITEUSER=`whoami` -SITEBASE=/home/groups/d/do/docbook/htdocs/snapshots -SITEHOST=web.sourceforge.net +SITEBASE=/var/www +#SITEUSER=`whoami` +#SITEHOST=web.sourceforge.net RELEASEVERSION=snapshot if [ -z "$TMP" ]; then TMP=/tmp @@ -107,7 +107,8 @@ Options: If specified, read commit message from standard input. -s - If specified, scp the distro to upload site (after tar/zipping). + If specified, do an svn check to see if the workspace is up + to date, and if it is, stop the build. -t TMPDIR Specifies the directory to which the script writes temporary @@ -160,7 +161,7 @@ while getopts ":a:b:e:f:d:hl:p:rst:u:v:x:z:" opt; do u ) SITEUSER=$OPTARG ;; d ) SITEHOST=$OPTARG ;; p ) SITEBASE=$OPTARG ;; - s ) UPLOAD="yes" ;; + s ) SVNCHECK="yes" ;; x ) ZIPTARG=$OPTARG ;; z ) TZ=$OPTARG alias date="TZ=$TZ date" ;; @@ -190,7 +191,17 @@ if [ -z "$DISTROS" ]; then printf "$opts_admon" exit 1; else + svn cleanup + REVISION=$(svn update > /dev/null 2>&1 && svn info | grep "^Revision:" | sed -r 's/^Revision: (.+)$/\1/') for DISTRO in $DISTROS; do + printf "Running svn update in gentext and $DISTRO working directories...\n" 1>&2 + if test "$SVNCHECK" = "yes"; then + if test $(cat $DISTRO/REVISION) = $REVISION; then + printf "$DISTRO distro is up to date. Skipping.\n" 1>&2 + break + fi + fi + echo $REVISION > $DISTRO/REVISION lock_timer=0 # wait for lock file (if any) to clear printf "Waiting for lock file to clear..." 1>&2 @@ -243,8 +254,17 @@ else cp -p $DISTRO/VERSION $DISTRO/VERSION.tmp # FIXME: we really should be doing this using a modifiled XSLT identity # transform, but anyway, this works OK for now... - sed "s/Version>.\+$RELEASEVERSION\_$REVISION\ $DISTRO/VERSION + if test "$SVNCHECK" = "yes"; then + sed "s/Version>.\+$RELEASEVERSION\_$REVISION\ $DISTRO/VERSION + else + # forced builds omit $REVISION suffix + sed "s/Version>.\+$RELEASEVERSION\ $DISTRO/VERSION + fi rm $DISTRO/VERSION.tmp + + # copy VERSION to VERSION.xsl + cp $DISTRO/VERSION $DISTRO/VERSION.xsl + printf "Done.\n" 1>&2 # start re-directing stout and stderr to log file (if logging enabled) @@ -260,18 +280,22 @@ else set | grep "^CHANGE\|REVISION" echo - echo "Running svn update in gentext and $DISTRO working directories..." - svn cleanup - svn update gentext || exit 1 - svn update $DISTRO || exit 1 - echo - + #echo "Running svn update in gentext and $DISTRO working directories..." + #svn cleanup + #svn update gentext || exit 1 + #svn update $DISTRO || exit 1 + #echo +# echo date echo "Building $DISTRO distribution..." echo - make distrib -C $DISTRO XSLT="$DOCBOOK_SVN/buildtools/xslt -$ENGINE" PDF_MAKER=$PDF_MAKER + if test "$SVNCHECK" = "yes"; then + make distrib -C $DISTRO XSLT="$DOCBOOK_SVN/buildtools/xslt -$ENGINE" PDF_MAKER=$PDF_MAKER + else + make release -C $DISTRO XSLT="$DOCBOOK_SVN/buildtools/xslt -$ENGINE" PDF_MAKER=$PDF_MAKER + fi cat <<- EOF > HEADER.txt The snapshot for a particular distribution is re-built automatically each time @@ -283,8 +307,6 @@ These snapshots are intended for testing purposes only and otherwise come with no guarantees. Any of them may in fact be broken at any given time. EOF - if [ "$UPLOAD" = "yes" ]; then - make $ZIPTARG -C $DISTRO ZIPVER=$RELEASEVERSION TMP=$TMP XSLT="$DOCBOOK_SVN/buildtools/xslt -$ENGINE" PDF_MAKER=$PDF_MAKER || exit 1 cat <<- EOF > $TMP/line.tmp @@ -321,12 +343,11 @@ EOF cp -pR $TMP/docbook-$DISTRO-$ADDEDSUFFIX-$RELEASEVERSION/* $DISTRO-$ADDEDSUFFIX; \ fi; \ ) - - scp \ + cp \ $TMP/docbook*-$DISTRO*$RELEASEVERSION.zip \ README.txt \ LatestChanges \ - $SITEUSER@$SITEHOST:$SITEBASE + $SITEBASE rm -rf $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.bz2 rm -rf $TMP/docbook-$DISTRO*$RELEASEVERSION.tar.gz @@ -338,17 +359,6 @@ EOF date - if [ -f $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp ]; then - # filter raw log and copy to site - cat $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp \ - | grep -v '^cvs log: \|cvs update\|^tar: \|^tar \|^ adding: \|^find \|^cd \|rm \|^mkdir \|^touch \|cvs2log\|mergechangelogs\|\s*(\|^ inflating: docbook-\|^ extracting: docbook-\|^docbook-' \ - > $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log - scp $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log $SITEUSER@$SITEHOST:$SITEBASE - fi - # FIXME: uncomment below when SF fixes their shell server - #ssh -l $SITEUSER $SITEHOST "(cd $SITEBASE; chmod 664 *.zip *.log; touch $DISTRO)" - fi - # set up the e-mail From and To headers for buildbot message cat <<- EOF > $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt From: docbook buildbot @@ -401,7 +411,7 @@ EOF # send the buildbot message /usr/sbin/sendmail -f buildbot@sideshowbarker.net docbook-snapshots@lists.sourceforge.net < $TMP/docbook-$DISTRO-$RELEASEVERSION-message.txt - rm -f $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log + cp $LOGDIR/docbook-$DISTRO-$RELEASEVERSION.log.tmp $SITEBASE/docbook-$DISTRO-$RELEASEVERSION.log rm -f $TMP/docbook-$DISTRO-$RELEASEVERSION.lock cd -