diff options
Diffstat (limited to 'dh_update_autotools_config')
-rwxr-xr-x | dh_update_autotools_config | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/dh_update_autotools_config b/dh_update_autotools_config index e26073ad..7c28bcef 100755 --- a/dh_update_autotools_config +++ b/dh_update_autotools_config @@ -2,7 +2,7 @@ =head1 NAME -dh_update_autotools_config - Update autotools config files +dh_update_autotools_config - Update autotools config files =cut @@ -10,6 +10,8 @@ use strict; use warnings; use Debian::Debhelper::Dh_Lib; +our $VERSION = DH_BUILTIN_VERSION; + =head1 SYNOPSIS B<dh_update_autotools_config> [S<I<debhelper options>>] @@ -42,19 +44,28 @@ for my $basename (qw(config.guess config.sub)) { sub is_autotools_config_file { my ($file) = @_; - my ($saw_timestamp); + my ($is_autoconf_file); open(my $fd, '<', $file) or error("open $file for reading failed: $!"); while (my $line = <$fd>) { chomp($line); # This is the test lintian uses. if ($line =~ m{^timestamp=['"]\d{4}-\d{2}-\d{2}['"]\s*$}) { - $saw_timestamp = 1; + $is_autoconf_file = 1; + last; + } + $line =~ s/\s++$//; + if ($line eq q{# Attempt to guess a canonical system name.} + or $line =~ q{^# Configuration validation subroutine script}) { + # Very old scripts do not have that timestamp line, but + # they do have these headers (which even new files also + # have). + $is_autoconf_file = 1; last; } last if $. >= 10; } close($fd); - return $saw_timestamp; + return $is_autoconf_file; } @@ -69,9 +80,3 @@ This program is a part of debhelper. Niels Thykier <niels@thykier.net> =cut - -# Local Variables: -# indent-tabs-mode: t -# tab-width: 4 -# cperl-indent-level: 4 -# End: |