From fca59bea770346cf1c1f9b0e00cb48a61b44a8f3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 25 Oct 2015 21:00:20 +0100 Subject: import of old now defunct presentation slides svn repo --- .../OLS2004-proceedings/bin/makeMainPaper.pl | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100755 2004/netfilter-failover-ols2004/OLS2004-proceedings/bin/makeMainPaper.pl (limited to '2004/netfilter-failover-ols2004/OLS2004-proceedings/bin/makeMainPaper.pl') diff --git a/2004/netfilter-failover-ols2004/OLS2004-proceedings/bin/makeMainPaper.pl b/2004/netfilter-failover-ols2004/OLS2004-proceedings/bin/makeMainPaper.pl new file mode 100755 index 0000000..60f3782 --- /dev/null +++ b/2004/netfilter-failover-ols2004/OLS2004-proceedings/bin/makeMainPaper.pl @@ -0,0 +1,81 @@ +#!/usr/bin/perl -w + +# +# Creates all papers with minimal content. Caution: clobbers existing papers! +# Run from top-level directory (GCC2004 or OLS2004), and relies on the +# Master.tex file being correct. +# +# It's probably easier to make a copy of TEMPLATES/Blank.tex and edit +# it by hand than to mess with this script. But it's included anyway, +# just in case it's handy. + +open(IN,')) { + chomp $ln; + next if ($ln =~ m/^\s*%*\s*$/); # skip blanks/comments + if (($ln =~ m/coltocauthor/) || (1 == $inEntry)) { + if ($ln =~ m/coltocauthor{(.*?)}\s+%\s+(.*)/) { + $author = $1; + $instit = $2; + $inEntry = 1; + $instit =~ s/\s+$//g; + } elsif ($ln =~ m/coltoctitle{(.*?)}/) { + $title = $1; + } elsif ($ln =~ m/import{([^}]+)}/) { + $dirName = $1; + push @hrefs, { + __AUTHOR__ => $author, + __INSTITUTION__ => $instit, + __TITLE__ => $title, + __EMAIL__ => 'your@email.address', + dirName => $dirName, + __ABSTRACT__ => ($dirName . '-abstract')}; + $author = ''; + $instit = ''; + $title = ''; + $dirName = ''; + $inEntry = 0; + } elsif ($ln =~ m/label{gccart/) { + $paperCount++; + } + } +} +close(IN); + +print "found: count: $paperCount with ", (1 + $#hrefs), " entries\n"; +my $i = 1; +for my $h (@hrefs) { + my $paper = $h->{dirName} . '/' . $h->{dirName} . '.tex'; + printf "%02d: %s: %s | %s | %s | %s\n", $i, $paper, + $h->{__AUTHOR__}, + $h->{__INSTITUTION__}, + $h->{__TITLE__}, + $h->{dirName}; + $i++; + + open(OUT, ">$paper") || die "Cannot open $paper for writing"; + open(IN, ')) { + chomp $ln; + for my $r (@keyNames) { + my $v = $h->{$r}; + $ln =~ s/$r/$v/; + } + print OUT "$ln\n"; + } + print OUT "\n"; + close(IN); + close(OUT); +} + + + -- cgit v1.2.3