[Fai-commit] r5245 - in trunk: bin debian

lange at alioth.debian.org lange at alioth.debian.org
Tue Feb 3 11:01:05 UTC 2009


Author: lange
Date: 2009-02-03 11:01:05 +0000 (Tue, 03 Feb 2009)
New Revision: 5245

Modified:
   trunk/bin/ainsl
   trunk/debian/changelog
Log:
ainsl: add test if target file exists

Modified: trunk/bin/ainsl
===================================================================
--- trunk/bin/ainsl	2009-01-12 15:04:07 UTC (rev 5244)
+++ trunk/bin/ainsl	2009-02-03 11:01:05 UTC (rev 5245)
@@ -6,7 +6,7 @@
 # ainsl -- AppendIfNoSuchLine written in Perl
 #
 # This script is part of FAI (Fully Automatic Installation)
-# Copyright (C) 2006-2008 Thomas Lange, lange at informatik.uni-koeln.de
+# Copyright (C) 2006-2009 Thomas Lange, lange at informatik.uni-koeln.de
 # Universitaet zu Koeln
 #
 #*********************************************************************
@@ -27,7 +27,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 #*********************************************************************
 
-my $version = "Version 1.2, 18-june-2008";
+my $version = "Version 1.2.1, 3-february-2009";
 
 use Getopt::Std;
 our ($opt_a,$opt_h,$opt_D,$opt_n,$opt_s,$opt_v,$opt_q,$opt_Q);
@@ -38,7 +38,7 @@
   print << "EOF";
 ainsl, AppendIfNoSuchLine written in Perl. $version
 
-   Copyright (C) 2006-2008 by Thomas Lange
+   Copyright (C) 2006-2009 by Thomas Lange
 
 Usage: ainsl [OPTION] FILE LINE [PATTERN]
 
@@ -104,7 +104,8 @@
 print "ainsl: newline: $line\n" if $debug;
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 # check if pattern already included in file
-open (INFILE, "<$filename") or die "Can't open $filename $!";
+-f $filename || die "ainsl: target file $filename does not exist.\n";
+open (INFILE, "<$filename") or die "ainsl: Can't open $filename $!\n";
 while (<INFILE>) {
   if (/$pattern/o) {
     print "aisnl: Pattern found. Nothing to append.\n" if $debug;

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-01-12 15:04:07 UTC (rev 5244)
+++ trunk/debian/changelog	2009-02-03 11:01:05 UTC (rev 5245)
@@ -1,3 +1,10 @@
+fai (3.2.17) unstable; urgency=low
+
+  [ Thomas Lange ]
+  * ainsl: add test if target file exists
+
+ -- Thomas Lange <lange at debian.org>  Tue, 03 Feb 2009 12:00:28 +0100
+
 fai (3.2.16) unstable; urgency=high
 
   [ Thomas Lange ]




More information about the Fai-commit mailing list