Commit 28f9989b authored by Christopher Spinrath's avatar Christopher Spinrath Committed by osak buildhauer user

makeDoku: clean up and fix obvious errors

parent c2d49d86
......@@ -6,50 +6,48 @@ then
echo "No path supplied"
exit 1
else
DOCUDIR="$1../Doku"
DOCUDIR="$1/../Doku"
echo $DOCUDIR
shift
fi
if [ $# -le 1 ]
if [ $# -eq 0 ]
then
echo "No packages supplied"
exit 1
else
PACKAGELIST=$2
PACKAGELIST=$@
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..."
exit 0 #linuxparty.sh soll auch ohne Doku Verzeichnis laufen
fi
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..."
exit 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 $PACKAGELIST; 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
exit 1
WORKING_DIR=$(mktemp -d)
cp -a "$DOCUDIR/." "$WORKING_DIR"
for PACKAGE in $PACKAGELIST; 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
popd
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
exit 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."
USER_HOME=$(getent passwd "${SUDO_USER:-$USER}" | cut -d ':' -f6)
cp "${WORKING_DIR}/DOCUMENTATION.gen.pdf" "${USER_HOME}/Deine-LIP-Dokumentation.pdf"
RC=$?
exit $RC
exit $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