Skip to content

Commit

Permalink
Merge branch 'release/2.0'
Browse files Browse the repository at this point in the history
- supporting rng _and_ rnc schemas for validation with jing
- added a --debug switch and error reporting to daps_autobuild
- moved a --meta related warning so it does not get displayed
  when running a *-name subcommand
- fixed a quoting issue in daps-migrate and daps_functions
- fixed an error in the DB4->DB5 migration stylesheet (formatting
  was lost on <term> tags)
  • Loading branch information
fsundermeyer committed Jun 19, 2015
2 parents 404d0e1 + e1e3816 commit bfee898
Show file tree
Hide file tree
Showing 14 changed files with 110 additions and 65 deletions.
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri Jun 19 09:21:31 UTC 2015 - [email protected]

Stable release DAPS 2.0:

- supporting rng _and_ rnc schemas for validation with jing
- added a --debug switch and error reporting to daps_autobuild
- moved a --meta related warning so it does not get displayed
when running a *-name subcommand
- fixed a quoting issue in daps-migrate and daps_functions
- fixed an error in the DB4->DB5 migration stylesheet (formatting
was lost on <term> tags)

-------------------------------------------------------------------
Tue Jun 10 13:50:00 UTC 2015 - [email protected]

Expand Down
75 changes: 51 additions & 24 deletions autobuild/daps_autobuild.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ SCHEMA="@datadir@/xml/daps/schema/daps-autobuild.rnc"

#VERBOSE=1
CHECK_VCS=1
DEBUG=0
DO_RSYNC=1
RSYNC_DELETE=""
SECTIONS=""
Expand Down Expand Up @@ -57,6 +58,10 @@ Options:
Path to config file. Can be specified relative or absolute.
Default: unset
--debug
In case of a build failure, show a verbose DAPS log.
Default: disabled
--force
Manuals will only be rebuild when the git/svn repository has changed
since the last build. Use this option to force a rebuild even when the
Expand Down Expand Up @@ -227,7 +232,7 @@ function process_git {
git pull -q || return 1
echo " * Updated git branch $GITBRANCH"
if [[ 1 -eq $CHECK_VCS ]]; then
NEWREV="$(git git rev-parse HEAD)" || return 2
NEWREV="$(git rev-parse HEAD)" || return 2
[[ "$NEWREV" != "$_LASTREV" ]] && REBUILD="1"
fi
return 0
Expand All @@ -253,7 +258,7 @@ function process_svn {


function run_daps {
local BUILDDIR DCFILE NAME RESULT _SET SUBCMD
local BUILDDIR DAPS_BASE_CMD DCFILE _FORMAT NAME NAME_CMD_ARGS ORIG_IFS RESULT RUNDAPS _SET SUBCMD
#
# Create the DAPS command and run DAPS
# Expects 4 Arguments:
Expand All @@ -269,42 +274,68 @@ function run_daps {
[[ -z $2 ]] && exit_on_error "Function run_daps must be called with a DC-FILE"
[[ -z $3 ]] && exit_on_error "Function run_daps must be called with a set ID"

SUBCMD="$1"
_FORMAT="$1"
DCFILE="$2"
_SET="$3"

if [[ single-html = "$SUBCMD" ]]; then
if [[ single-html = "$_FORMAT" ]]; then
SUBCMD="html --single"
else
SUBCMD="$_FORMAT"
fi

NAME=${DCFILE//DC-/}
BUILDDIR="${_BUILDDIR}/$_SET"

# build the DAPS command
#
RUNDAPS="${_DAPSROOT}/bin/daps --dapsroot $_DAPSROOT --builddir $BUILDDIR -d $DCFILE"
[[ -n $_STYLEROOT ]] && RUNDAPS="$RUNDAPS --styleroot=$_STYLEROOT"
[[ -n $_FB_STYLEROOT ]] && RUNDAPS="$RUNDAPS --fb_styleroot=$_FB_STYLEROOT"
DAPS_BASE_CMD="${_DAPSROOT}/bin/daps --dapsroot $_DAPSROOT --builddir $BUILDDIR -d $DCFILE"
[[ -n $_STYLEROOT ]] && DAPS_BASE_CMD="$DAPS_BASE_CMD --styleroot=$_STYLEROOT"
[[ -n $_FB_STYLEROOT ]] && DAPS_BASE_CMD="$DAPS_BASE_CMD --fb_styleroot=$_FB_STYLEROOT"
RUNDAPS="$DAPS_BASE_CMD"
[[ 1 -eq $DEBUG ]] && RUNDAPS="$RUNDAPS --debug"
RUNDAPS="$RUNDAPS $SUBCMD --name $NAME"
[[ -n $_DRAFT ]] && RUNDAPS="$RUNDAPS --draft"
[[ -n $_REMARKS ]] && RUNDAPS="$RUNDAPS --remarks"
if [[ -n $_META ]]; then
[[ $SUBCMD = "html" || $SUBCMD = "pdf" ]] && RUNDAPS="$RUNDAPS --meta"
fi

echo -n " * Building $SUBCMD version of $DCFILE ... "
echo -n " * Building $_FORMAT version of $DCFILE ... "
RESULT="$($RUNDAPS)"
if [[ 0 -eq $? ]]; then
$CCECHO "result" "Succeeded"
SYNCDIR_DC="${SYNCDIR}/$NAME"
NAME_CMD_ARGS="--name $NAME"
mkdir -p "$SYNCDIR_DC"
if [[ "pdf" = "$SUBCMD" ]]; then
mkdir -p "${SYNCDIR_DC}/pdf"
mv "$RESULT" "${SYNCDIR_DC}/pdf"
else
mv "$RESULT" "${SYNCDIR_DC}/$_FORMAT"
[[ -n $_DRAFT ]] && NAME_CMD_ARGS="$NAME_CMD_ARGS --draft"
[[ -n $_REMARKS ]] && NAME_CMD_ARGS="$NAME_CMD_ARGS --remarks"
if [[ -n $_META ]]; then
[[ $SUBCMD = "html" || $SUBCMD = "pdf" ]] && NAME_CMD_ARGS="$NAME_CMD_ARGS --meta"
fi
NAME_CMD_ARGS="$NAME_CMD_ARGS 2>/dev/null"
if [[ "pdf" = "$_FORMAT" ]]; then
RESULT="$($DAPS_BASE_CMD pdf-name $NAME_CMD_ARGS)"
mkdir -p "${SYNCDIR_DC}/$_FORMAT"
elif [[ "html" = "$_FORMAT" ]]; then
RESULT="$($DAPS_BASE_CMD html-dir-name $NAME_CMD_ARGS)"
elif [[ "single-html" = "$_FORMAT" ]]; then
RESULT="$($DAPS_BASE_CMD html-dir-name --single $NAME_CMD_ARGS)"
fi
mv "$RESULT" "${SYNCDIR_DC}/$_FORMAT"
return 0
else
$CCECHO "warn" "Failed"
FAILURES=$((FAILURES + 1))
FAILED_BOOKS["$DC"]="${FAILED_BOOKS["$DC"]} $_FORMAT"
ORIG_IFS="$IFS"
IFS=$'\n'
echo -e "\e[33m"
for LINE in $RESULT; do
echo -e "\t$LINE"
done
echo -e "\e[0m"
IFS="$ORIG_IFS"
return 1
fi
}
Expand Down Expand Up @@ -369,7 +400,7 @@ function failure_notification {
#--------------------
# Read command line options

ARGS=$(getopt -o h -l config:,force,help,helpconfig,nosync,notify,rsync,schema:,sections:,validate -n "$ME" -- "$@")
ARGS=$(getopt -o h -l config:,debug,force,help,helpconfig,nosync,notify,rsync,schema:,sections:,validate -n "$ME" -- "$@")

# Exit when getopt returns errors
#
Expand All @@ -384,6 +415,10 @@ while true ; do
CONFIG="$(readlink -e "$2")"
shift 2
;;
--debug)
DEBUG=1
shift
;;
--force)
CHECK_VCS=0
shift
Expand Down Expand Up @@ -489,7 +524,7 @@ for SET in $SECTIONS; do
fi

# set up the sync directory
SYNCDIR="${_BUILDDIR}/$SET/sync"
SYNCDIR="${_BUILDDIR}/$SET/sync/$SET"
rm -rf "$SYNCDIR" && mkdir -p "$SYNCDIR"

echo -e "$SET\n-------------------------"
Expand Down Expand Up @@ -572,14 +607,6 @@ for SET in $SECTIONS; do
for DC in $_DCFILES; do
# Build!
run_daps "$_FORMAT" "$DC" "$SET"
# Check build result
if [[ 0 -eq $? ]]; then
$CCECHO "result" "Succeeded"
else
$CCECHO "warn" "Failed"
FAILURES=$((FAILURES + 1))
FAILED_BOOKS["$DC"]="${FAILED_BOOKS["$DC"]} $_FORMAT"
fi
done
done
else
Expand Down Expand Up @@ -618,7 +645,7 @@ for SET in $SECTIONS; do
# rsync

if [[ 1 -eq $DO_RSYNC ]]; then
$RSYNC $_RSYNC_FLAGS $RSYNC_DELETE "$SYNCDIR/" "$_RSYNC_TARGET"
$RSYNC $_RSYNC_FLAGS $RSYNC_DELETE $SYNCDIR $_RSYNC_TARGET
if [[ 0 -eq $? ]]; then
$CCECHO "result" " Rsync successful"
else
Expand Down
28 changes: 14 additions & 14 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for DAPS 2.0.0-rc7.
# Generated by GNU Autoconf 2.69 for DAPS 2.0.0.
#
# Report bugs to <https://github.com/openSUSE/daps>.
#
Expand Down Expand Up @@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='DAPS'
PACKAGE_TARNAME='daps'
PACKAGE_VERSION='2.0.0-rc7'
PACKAGE_STRING='DAPS 2.0.0-rc7'
PACKAGE_VERSION='2.0.0'
PACKAGE_STRING='DAPS 2.0.0'
PACKAGE_BUGREPORT='https://github.com/openSUSE/daps'
PACKAGE_URL='http://opensuse.github.io/daps'

Expand Down Expand Up @@ -1264,7 +1264,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures DAPS 2.0.0-rc7 to adapt to many kinds of systems.
\`configure' configures DAPS 2.0.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1330,7 +1330,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of DAPS 2.0.0-rc7:";;
short | recursive ) echo "Configuration of DAPS 2.0.0:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1419,7 +1419,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
DAPS configure 2.0.0-rc7
DAPS configure 2.0.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand All @@ -1436,7 +1436,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by DAPS $as_me 2.0.0-rc7, which was
It was created by DAPS $as_me 2.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -1788,8 +1788,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
DAPS_VERSION_MAJOR=2
DAPS_VERSION_MINOR=0
DAPS_VERSION_MICRO=0-rc7
DAPS_VERSION=2.0.0-rc7
DAPS_VERSION_MICRO=0
DAPS_VERSION=2.0.0
DAPS_API_VERSION=2
Expand Down Expand Up @@ -2349,7 +2349,7 @@ fi
# Define the identity of the package.
PACKAGE='daps'
VERSION='2.0.0-rc7'
VERSION='2.0.0'
cat >>confdefs.h <<_ACEOF
Expand Down Expand Up @@ -4537,7 +4537,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by DAPS $as_me 2.0.0-rc7, which was
This file was extended by DAPS $as_me 2.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -4591,7 +4591,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
DAPS config.status 2.0.0-rc7
DAPS config.status 2.0.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down Expand Up @@ -5746,7 +5746,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by DAPS $as_me 2.0.0-rc7, which was
This file was extended by DAPS $as_me 2.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5800,7 +5800,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
DAPS config.status 2.0.0-rc7
DAPS config.status 2.0.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dnl

m4_define(daps_version_major, 2)
m4_define(daps_version_minor, 0)
m4_define(daps_version_micro, [0-rc7])
m4_define(daps_version_micro, [0])
# API version
m4_define([daps_api_version],[daps_version_major])

Expand Down
7 changes: 7 additions & 0 deletions daps-xslt/migrate/suse-upgrade.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,13 @@
</xsl:element>
</xsl:template>

<xsl:template match="varlistentry/term">
<xsl:element name="{local-name(.)}">
<xsl:call-template name="copy.attributes"/>
<xsl:apply-templates />
</xsl:element>
</xsl:template>

<!-- The synopsis elements have child elements that don't work inside phrase, plus
they have attributes that shouldn't be lost. So, leave as is, but warn. -->
<xsl:template
Expand Down
2 changes: 0 additions & 2 deletions etc/config.in
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,6 @@ DOCBOOK5_STYLE_URI="http://docbook.sourceforge.net/release/xsl-ns/current/"
# URI to the DocBook 5 Relax NG schema that can be resolved by xmlcatalog
# There should be no need to change this entry
#
# NOTE: Do not use a link to the compact scheme here (.rnc) !!
#
DOCBOOK5_RNG_URI="http://docbook.org/xml/5.0/rng/docbookxi.rng"

## Key: DRAFT
Expand Down
2 changes: 1 addition & 1 deletion lib/daps_functions
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ EOF
if [[ "fop" = "$FORMATTER" ]]; then
cat <<EOF
FORMATTER WRAPPER: $FOP_WRAPPER
FORMATTER CONFIG: $FOP_CONFIG_FILE"
FORMATTER CONFIG: $FOP_CONFIG_FILE
EOF
elif [[ "xep" = "$FORMATTER" ]]; then
cat <<EOF
Expand Down
4 changes: 2 additions & 2 deletions libexec/daps-migrate
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ for xmlin in ${INPUTDIR}/*$EXT; do
cp "$HEADERFILE" "$xmlout"
get_rootelement "$xmlin"
sed -i "s/$ROOTREPLACE/$ROOTELEMENT/" "$xmlout"
xsltproc --nonet "${p}" "$MIGRATE_XSLT" "$xmlin" >> "$xmlout" 2>> "$XSLTPROCLOG"
xsltproc --nonet ${p} "$MIGRATE_XSLT" "$xmlin" >> "$xmlout" 2>> "$XSLTPROCLOG"
else
xsltproc --nonet --output "$xmlout" "${p}" "$MIGRATE_XSLT" "$xmlin" 2>> "$XSLTPROCLOG"
xsltproc --nonet --output "$xmlout" ${p} "$MIGRATE_XSLT" "$xmlin" 2>> "$XSLTPROCLOG"
fi
# ERRCODE=$?
dump "--------------------------------------------------"
Expand Down
10 changes: 0 additions & 10 deletions make/common_variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,6 @@ ifndef PROFILE_URN
--file $(MAIN) $(XSLTPROCESSOR))
endif

# Issue a warning when specifying --meta without profiling
#
ifeq "$(META)" "1"
ifndef PROFILE_URN
$(warning $(shell ccecho "warn" "Did not find a profiling URN. Displaying meta information only works with profiling."))
endif
endif


#
# 2. Set PROFILEDIR and profiling stringparams
#
# The directory name depends on the profiling values of the
Expand Down
11 changes: 2 additions & 9 deletions make/locdrop.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
# * Color PDF
#

#
# Get translation info from a docmanager header
# xml sel -N ns0="urn:x-suse:ns:docmanager" -N db5="http://docbook.org/ns/docbook" -t -m "/*/db5:info/ns0:docmanager" -v "normalize-space(ns0:translation)" xml/depl_nodes.xml
#
# returns: true|fals|<error>


# Defined in common_variables:
#
#LOCDROP_TMP_DIR
Expand All @@ -41,8 +34,8 @@ endif

define db5_get_trans
for F in $(DOCFILES); do \
R=`$(XMLSTARLET) sel -N dm="urn:x-suse:ns:docmanager" -N db5="http://docbook.org/ns/docbook" -t -m "/*/db5:info/dm:docmanager" -v "normalize-space(dm:translation)" $$F 2>/dev/null || echo "false"`; \
if [ "true" = "$$R" ]; then echo -n "$$F "; fi \
R=`$(XMLSTARLET) sel -N dm="urn:x-suse:ns:docmanager" -N db5="http://docbook.org/ns/docbook" -t -m "/*/db5:info/dm:docmanager" -v "normalize-space(dm:translation)" $$F 2>/dev/null || echo "no"`; \
if [ "yes" = "$$R" ]; then echo -n "$$F "; fi \
done
endef

Expand Down
Loading

0 comments on commit bfee898

Please sign in to comment.