Code

Changed to apply to core/plugins split.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Mar 2008 14:11:20 +0000 (14:11 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 14 Mar 2008 14:11:20 +0000 (14:11 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9849 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/update-pdf-help

index bd6bd65f14483d83c4d351fd6627f6869032927e..1c3482a8f580f64bfd64ff022f9ae8bc37b2374e 100755 (executable)
@@ -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