Skip to content
Snippets Groups Projects
Commit e7aa5da6 authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

small POD section; renamed conversion subroutine: conversion from latex to PDF, not the other way

parent d93838c9
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/perl #!/usr/bin/perl
=head1 NAME
lc1.pl
=head1 USAGE
./lc1.pl &
=head1 DESCRIPTION
Upon start, searches for old LaTeX to PDF conversion jobs and perfoms
them. Then the script monitors the current directory for new conversion
jobs and executes them.
=cut
use strict; use strict;
use Filesys::Notify::Simple; use Filesys::Notify::Simple;
...@@ -30,7 +46,7 @@ sub watch ...@@ -30,7 +46,7 @@ sub watch
{ {
my ($job, $tex_file)= ($1, $2); my ($job, $tex_file)= ($1, $2);
print __LINE__, " job=[$job] tex_file=[$tex_file]\n"; print __LINE__, " job=[$job] tex_file=[$tex_file]\n";
pdf2latex ($job, $tex_file); latex2pdf ($job, $tex_file);
} }
elsif ($path =~ m#/var/www/html/dlbt/DLBTUploads/TeiConverter/lc1.pl$#) elsif ($path =~ m#/var/www/html/dlbt/DLBTUploads/TeiConverter/lc1.pl$#)
{ {
...@@ -73,12 +89,12 @@ sub check_old_jobs ...@@ -73,12 +89,12 @@ sub check_old_jobs
else else
{ {
# print __LINE__, " job=[$job] tex_file=[$tex_file]\n"; # print __LINE__, " job=[$job] tex_file=[$tex_file]\n";
pdf2latex ($job, $tex_file); latex2pdf ($job, $tex_file);
} }
} }
} }
sub pdf2latex sub latex2pdf
{ {
my $jobname= shift; my $jobname= shift;
my $tex_file= shift; my $tex_file= shift;
...@@ -111,7 +127,7 @@ sub pdf2latex ...@@ -111,7 +127,7 @@ sub pdf2latex
} }
print "converting: [", join (' ', @convert), "]\n"; print "converting: [", join (' ', @convert), "]\n";
sleep (5); sleep (5); # wait some time to avoid possible race conditions
system (@convert); system (@convert);
if (-d $media_dir) if (-d $media_dir)
...@@ -120,3 +136,10 @@ sub pdf2latex ...@@ -120,3 +136,10 @@ sub pdf2latex
unlink ('media') unlink ('media')
} }
} }
__END__
=head1 AUTHOR
Gerhard Gonter <ggonter@cpan.org>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment