diff options
author | Zack Weinberg <zackw@panix.com> | 2020-11-02 17:16:00 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-11-02 17:16:00 -0500 |
commit | 73f1be5e42e37644e9e742e9995fac250a9b3f25 (patch) | |
tree | a57803641e95fb0aaa181824f6250ff975a56ec6 | |
parent | 46f384f850b455cdb366bafbcf4e992606b3f2c0 (diff) | |
download | autoconf-73f1be5e42e37644e9e742e9995fac250a9b3f25.tar.gz |
autoreconf.in: improve compatibility with old perl
In very old perls (I noticed this with 5.8.4), File::Temp objects are
not automatically stringified in all contexts where we expect them to
be, causing autoreconf to crash.
* bin/autoreconf.in (install_aux_file): Explicitly extract the
temporary file’s name from $temp, and use that in all the places we
were using $temp.
-rw-r--r-- | bin/autoreconf.in | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/autoreconf.in b/bin/autoreconf.in index 2d427155..ccbd6c47 100644 --- a/bin/autoreconf.in +++ b/bin/autoreconf.in @@ -363,10 +363,13 @@ sub install_aux_file or fatal "rm -f $dest: $!\n"; } my $temp = new File::Temp (UNLINK => 0, DIR => $destdir); - copy ($src, $temp) - or fatal "copying $src to $temp: $!\n"; - make_executable ($temp) if -x $src; - update_file ($temp, $dest, $force); + # Older Perls don't convert $temp to its filename + # in all the places we need it to. + my $tempname = $temp->filename; + copy ($src, $tempname) + or fatal "copying $src to $tempname: $!\n"; + make_executable ($tempname) if -x $src; + update_file ($tempname, $dest, $force); } } |