[Koha-patches] [PATCH] [Bug 3354] Modified fines.pl to not throw warning if --out not specified

J. David Bavousett dbavousett at ptfs.com
Thu Jun 25 16:43:39 CEST 2009


It appears, in Ryan's patch, that he wants to throw a warning to the log if
the directory specified in --out is not present.  (Further messages will
be given when the open-or-die occurs a few lines later.)  However, it was
throwing the warning if --out was not specified at all, which is
undesirable.  This patch modifies that bit to check for the presence of
whatever directory is going to be used, either --out, ENV{TMPDIR}, or /tmp.
As before, if the write to the directory fails for any reason--including
its' non-existence--that is handled later, but this message will help
inform the troubleshooter.
---
 misc/cronjobs/fines.pl |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/misc/cronjobs/fines.pl b/misc/cronjobs/fines.pl
index 42498f3..65bfb7a 100755
--- a/misc/cronjobs/fines.pl
+++ b/misc/cronjobs/fines.pl
@@ -105,7 +105,9 @@ if($output_dir){
     $fldir = $output_dir if( -d $output_dir );
 } else {
     $fldir = $ENV{TMPDIR} || "/tmp";
-    warn "Could not write to $output_dir ... does not exist!";
+}
+if (!-d $fldir) {
+    warn "Could not write to $fldir ... does not exist!";
 }
 $filename = $dbname;
 $filename =~ s/\W//;
-- 
1.5.6.5




More information about the Koha-patches mailing list