[Top][All Lists]

[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 "" 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.

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

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

Alan Modra

Index: bin/
RCS file: /cvs/autoconf/bin/,v
retrieving revision 1.53
diff -u -p -r1.53
--- bin/     2001/11/07 19:34:20     1.53
+++ bin/     2001/11/23 04:09:04
@@ -647,6 +647,11 @@ sub handle_output ($$)
+      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/
RCS file: /cvs/autoconf/lib/Autom4te/,v
retrieving revision 1.18
diff -u -p -r1.18
--- lib/Autom4te/     2001/11/03 12:01:36     1.18
+++ lib/Autom4te/     2001/11/23 04:09:04
@@ -400,7 +400,7 @@ sub update_file ($$)
       unlink ($from)
-       or die "$me: cannot not remove $from: $!\n";
+       or die "$me: cannot remove $from: $!\n";
@@ -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";
       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]