summaryrefslogtreecommitdiff
path: root/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh
diff options
context:
space:
mode:
Diffstat (limited to '2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh')
-rwxr-xr-x2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh104
1 files changed, 104 insertions, 0 deletions
diff --git a/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh
new file mode 100755
index 0000000..0bdec4f
--- /dev/null
+++ b/2005/flow-accounting-ols2005/OLS2005/Texmf/addAuthor.sh
@@ -0,0 +1,104 @@
+#!/bin/bash
+
+# This script should be called from the top OLS/GCC directory
+# (eg the one that contains the Texmf directory)
+
+# gccsummit or linuxsymposium ...
+export WEBSITE=linuxsymposium
+
+# Handle fatal errors
+function die {
+ echo $*
+ exit 1
+}
+
+# Prepare new paper/author
+function do_paper {
+ paper="$1"
+ author="$2"
+ bio="$3"
+ key="$4"
+ title="$5"
+
+ Dir=$(echo "$author" | tr '[:upper:]' '[:lower:]' | awk '{ print $NF }')
+ echo Dir is $Dir
+ echo Paper is $paper
+ echo Author is $author
+ echo bio is $bio and key is $key
+ echo Title is "$title"
+ echo " "
+ Start=$PWD
+ MakeAdd="${Dir}/${Dir}-abstract.tex"
+ if [ ! -d $Dir ] ; then mkdir $Dir || die "cannot mkdir $Dir" ; fi
+ cd $Dir || die "cannot cd $Dir"
+
+ if [ ! -r ${Dir}-abstract.tex ] ; then
+ ### CREATE ABSTRACT (pull from $WEBSITE if available)
+ if [ $key -ne 0 ] ; then
+ links -dump 'http://www.'${WEBSITE}'.org/2005/view_abstract.php?content_key='$key > ${Dir}-abstract.tex
+ else
+ echo " " > ${Dir}-abstract.tex
+ fi
+ fi
+
+ if [ ! -r Makefile.inc ] ; then
+ ### CREATE Makefile.inc
+ cat > Makefile.inc <<EOF
+PAPERS += ${Dir}/${Dir}.dvi
+
+## Add any additional .tex or .eps files below:
+${Dir}/${Dir}.dvi ${Dir}/${Dir}-proc.dvi: \\
+ ${Dir}/${Dir}.tex \\
+ ${Dir}/${Dir}-abstract.tex
+
+EOF
+ fi
+ if [ ! -r ${Dir}.tex ] ; then
+ ### CREATE BLANK PAPER
+ ## __TITLE__ __SUBTITLE__ __AUTHOR__ __ABSTRACT__
+ echo 'title : "'${title}'"'
+ echo 'author : "'${author}'"'
+ addMake=$(basename $MakeAdd)
+ echo 'addMake: "'${addMake}'"'
+ cat $Start/TEMPLATES/autoauthor.tex | \
+ sed -e "s|__TITLE__|${title}|g" | \
+ sed -e 's|__SUBTITLE__| |g' | \
+ sed -e "s|__AUTHOR__|${author}|g" | \
+ sed -e 's|__ABSTRACT__|'${addMake}'|g' > ${Dir}.tex
+ fi
+
+ cd $Start
+}
+
+### Example usage...
+## PAPER_ID=1
+## AUTHOR="Andrey Belevantsev"
+## BIO_ID=0
+## CONTENT_KEY=11
+## TITLE="Improving GCC instruction scheduling for Itanium"
+
+## do_paper $PAPER_ID "$AUTHOR" $BIO_ID $CONTENT_KEY "$TITLE"
+function do_help {
+ echo "Usage: $0 PAPER AUTHOR BIO_ID CONTENT_KEY TITLE"
+ echo "Paper = integer greater than last-used one for papers"
+ echo "Author = full author name, quoted"
+ echo "Bio_ID = number from conference website or 0 for not available"
+ echo "Content_Key = number for abstract from conference website, 0 for not available"
+ echo "Title = title of paper, quoted"
+}
+
+if [ -z "$*" ] ; then
+ do_help
+ exit 0
+fi
+if [[ "$1" = *help* ]] ; then
+ do_help
+ exit 0
+fi
+if [[ "$1" = *-h* ]] ; then
+ do_help
+ exit 0
+fi
+
+do_paper ${@}
+
personal git repositories of Harald Welte. Your mileage may vary