summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2009-08-13 12:50:49 +0100
committerReuben Thomas <rrt@sc3d.org>2009-08-13 12:50:49 +0100
commit58f1084c58874f22d412a810030d0fdae4896443 (patch)
tree3fe8e2cff9771041ddfbfd11ef7727669c199033
parentb8ad5a26173d41d683808ffdc5136b352582a196 (diff)
downloadautoconf-archive-58f1084c58874f22d412a810030d0fdae4896443.tar.gz
Fix script to add AU_ALIAS call to new file, not old one.
-rwxr-xr-xalias-macro.pl16
1 files changed, 8 insertions, 8 deletions
diff --git a/alias-macro.pl b/alias-macro.pl
index 5fa107e..060b7b1 100755
--- a/alias-macro.pl
+++ b/alias-macro.pl
@@ -18,15 +18,15 @@ $new_name =~ s/\..*$//;
my $uc_new_name = uc($new_name);
$new_name = lc($new_name);
-# Check new name exists
-die "could not find `$new_file'\n" unless -e $new_file;
+# Check old name exists
+die "could not find `$old_file'\n" unless -e $old_file;
-# Read file
-open IN, $old_file or die "could not read `$old_file'\n";
+# Read new file
+open IN, $new_file or die "could not read `$new_file'\n";
my $text = do { local $/, <IN> };
# Alias the macro
-my $old_text = $text;
-$old_text =~ s/^AC_DEFUN\(\[$uc_old_name/AU_ALIAS([$uc_old_name], [$uc_new_name])\nAC_DEFUN([$uc_old_name/m;
-open OUTFILE, ">$old_file" or die "could not write `$old_file'";
-print OUTFILE $old_text;
+my $new_text = $text;
+$new_text =~ s/^AC_DEFUN\(\[$uc_new_name/AU_ALIAS([$uc_old_name], [$uc_new_name])\nAC_DEFUN([$uc_new_name/m;
+open OUTFILE, ">$new_file" or die "could not write `$new_file'";
+print OUTFILE $new_text;