From 85291005091d94271b13a68d537a91e2ba8c0624 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 14 Mar 2008 14:11:20 +0000 Subject: [PATCH] Changed to apply to core/plugins split. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9849 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/update-pdf-help | 67 +++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 13 deletions(-) diff --git a/gosa-core/update-pdf-help b/gosa-core/update-pdf-help index bd6bd65f1..1c3482a8f 100755 --- a/gosa-core/update-pdf-help +++ b/gosa-core/update-pdf-help @@ -1,40 +1,81 @@ -#!/bin/sh +#!/bin/bash # Defaults for Debian -LYX=lyx-qt +LYX=lyx # Sanity checks -if [ ! -d doc/guide/user ]; then - echo "Can't find usable documentation structure - aborting" +if [ ! -d doc/core ]; then + echo "Can't find usable core documentation structure - aborting" exit 1 fi # Commands present? -for cmd in $LYX; do - if ! which $cmd &> /dev/null; then +for cmd in $CNV $LYX; do + if [[ ! `which $cmd` ]]; then echo "Can't find executable for '$cmd' - aborting" exit 2 fi done +# Core help +echo -en "Processing core\n" pushd . &> /dev/null -cd doc/guide/user - +cd doc/core for lang in *; do [ ! -d "$lang" ] && continue pushd . &> /dev/null - echo "Processing language $lang..." + echo -en "\tProcessing language $lang...\n" cd $lang/lyx-source - for source in *.lyx; do - $LYX -e pdf $source; d=../pdf/${source%%\.*}/; pdf=${source%lyx}pdf > /dev/null - [ -d $d ] || mkdir -p $d && cp $pdf ../pdf/${source%%\.*}/ >/dev/null + for source in $(find . -name \*.lyx -exec basename {} \;); do + echo -en "\t\tProcessing $source..." + echo -en " pdf" + $LYX -e pdf $source &> /dev/null + d=../pdf/${source%%\.*}/ + pdf=${source%lyx}pdf + [ -d $d ] || mkdir -p $d && mv $pdf ../pdf/${source%%\.*}/ &>/dev/null + d=../html/${source%%\.*}/ + echo -en " done.\n" done - popd &> /dev/null done +popd &> /dev/null + +# Plugin help +pushd . &> /dev/null +if [ -d doc/plugins ]; then + cd doc/plugins + + for plugin in *; do + pushd . &> /dev/null + echo -en "Processing $plugin\n" + cd $plugin + for lang in *; do + [ ! -d "$lang" ] && continue + + pushd . &> /dev/null + echo -en "\tProcessing language $lang...\n" + cd $lang/lyx-source + + for source in $(find . -name \*.lyx -exec basename {} \;); do + echo -en "\t\tProcessing $source..." + echo -en " pdf" + $LYX -e pdf $source &> /dev/null + d=../pdf/${source%%\.*}/ + pdf=${source%lyx}pdf + [ -d $d ] || mkdir -p $d && mv $pdf ../pdf/${source%%\.*}/ &>/dev/null + d=../html/${source%%\.*}/ + echo -en " done.\n" + continue + done + popd &> /dev/null + done + popd &> /dev/null + done + +fi popd &> /dev/null echo exit 0 -- 2.30.2