Commit c07dd5b9 authored by christian's avatar christian Committed by osak buildhauer user

added makeDoku.sh still broken

parent e0537684
#!/bin/bash
# Takes 2 arguments, first path where docuparts are stored 2nd list of installed packages
if [ $# -eq 0 ]
then
echo "No path supplied"
exit 1
else
DOCUDIR="$1../Doku"
echo $DOCUDIR
fi
if [ $# -le 1 ]
then
echo "No packages supplied"
exit 1
else
PACKAGELIST=$2
echo $PACKAGELIST
fi
DOCUDIR="$MY_DIR/../Doku"
if [ ! -f "$DOCUDIR/HEADER.tex" ]; then #HEADER muss ex. sonst kommt auf keinen Fall was sinnvolles bei rum
echo "Leider ist keine Dokumentation auf dem LIP-Stick vorhanden..."
return 0 #linuxparty.sh soll auch ohne Doku Verzeichnis laufen
fi
#DOCFILE=$(mktemp --suffix='.tex')
WORKING_DIR=$(mktemp -d)
cp -a "$DOCUDIR/." "$WORKING_DIR"
for PACKAGE in $INSTALLED_PKGS; do
#zenity and kdialog return quoted package names; nice for apt call but bad here
CLEAN_PACKAGE_NAME=$(echo "$PACKAGE" | tr -d "\" ")
echo "Dokumentation fuer $PACKAGE von ${WORKING_DIR}/${CLEAN_PACKAGE_NAME}.tex"
if [ -f "${WORKING_DIR}/${CLEAN_PACKAGE_NAME}.tex" ]; then
echo "\\input{${CLEAN_PACKAGE_NAME}.tex}" >> "$WORKING_DIR/DOCUMENTATION.gen.tex"
#cat "${DOCUDIR}/${CLEAN_PACKAGE_NAME}.tex" >> "$DOCFILE"
fi
done
pushd "$WORKING_DIR"
pdflatex -output-directory "$WORKING_DIR" "DOCUMENTATION.gen.tex"
pdflatex -output-directory "$WORKING_DIR" "DOCUMENTATION.gen.tex" # ja, ist Absicht
if [ $? -ne 0 ]; then
err "Fehler beim kompilieren der Dokumentation."
return 1
fi
popd
USER_HOME=$(getent passwd "${SUDO_USER:-$USER}" | cut -d ':' -f6)
cp "${WORKING_DIR}/DOCUMENTATION.gen.pdf" "${USER_HOME}/Deine-LIP-Dokumentation.pdf"
RC=$?
pressenter "Dokummentation der von dir installierten Paktete wurde in deinem Benutzerverzeichnis ($HOME) als 'Deine-LIP-Dokumentation.pdf' abegelegt."
return $RC
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment