autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unlink configure


From: Alan Modra
Subject: unlink configure
Date: Fri, 23 Nov 2001 16:51:20 +1030
User-agent: Mutt/1.3.17i

In course of my work as a binutils and gcc hacker, I often have many
source trees containing various branches and local edits.  To save
space since my disk isn't infinite, I hard link all common files.
Now with current autoconf, if I make a change to "configure.in" in one
dir, building that tree will run autoconf and effectively update
"configure" in all my trees.  This patch cures the inconvenience,
and fixes a few typos.

ChangeLog
        * lib/Autom4te/General.pm (update_file): Correct error messages.

        * bin/autom4te.in (handle_output): Unlink output file before
        opening so that any hard links are not changed.

-- 
Alan Modra

Index: bin/autom4te.in
===================================================================
RCS file: /cvs/autoconf/bin/autom4te.in,v
retrieving revision 1.53
diff -u -p -r1.53 autom4te.in
--- bin/autom4te.in     2001/11/07 19:34:20     1.53
+++ bin/autom4te.in     2001/11/23 04:09:04
@@ -647,6 +647,11 @@ sub handle_output ($$)
     }
   else
     {
+      if (-e "$output")
+       {
+         unlink ($output)
+           or die "$me: cannot remove $output: $!\n";
+       }
       $out->open($output, O_CREAT | O_WRONLY | O_TRUNC, oct ($mode));
     }
   die "$me: cannot create $output: $!\n"
Index: lib/Autom4te/General.pm
===================================================================
RCS file: /cvs/autoconf/lib/Autom4te/General.pm,v
retrieving revision 1.18
diff -u -p -r1.18 General.pm
--- lib/Autom4te/General.pm     2001/11/03 12:01:36     1.18
+++ lib/Autom4te/General.pm     2001/11/23 04:09:04
@@ -400,7 +400,7 @@ sub update_file ($$)
        }
       $in->close;
       unlink ($from)
-       or die "$me: cannot not remove $from: $!\n";
+       or die "$me: cannot remove $from: $!\n";
       return;
     }
 
@@ -417,15 +417,15 @@ sub update_file ($$)
     {
       # Back up and install the new one.
       move ("$to",  "$to$SIMPLE_BACKUP_SUFFIX")
-       or die "$me: cannot not backup $to: $!\n";
+       or die "$me: cannot backup $to: $!\n";
       move ("$from", "$to")
-       or die "$me: cannot not rename $from as $to: $!\n";
+       or die "$me: cannot rename $from as $to: $!\n";
       print STDERR "$me: `$to' is updated\n";
     }
   else
     {
       move ("$from", "$to")
-       or die "$me: cannot not rename $from as $to: $!\n";
+       or die "$me: cannot rename $from as $to: $!\n";
       print STDERR "$me: `$to' is created\n";
     }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]