X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=dh;h=2a91b92d7af29d34de874baf57a62753aad37451;hb=defe98b290826ce9fd4ee098b3cdccb5513a7f06;hp=7cba15610e39fd806187c0934cbe34b3d04bce9d;hpb=e7ab4dca7d240f48a51960a6978c05d2f5aa7a97;p=debhelper.git diff --git a/dh b/dh index 7cba156..2a91b92 100755 --- a/dh +++ b/dh @@ -50,8 +50,8 @@ you should Build-Depend on debhelper 7.0.50 or above.) Add the debhelper commands specified by the given addon to appropriate places in the sequence of commands that is run. This option can be repeated more than once, and is used when there is a third-party package that provides -debhelper commands. See "SEQUENCE ADDONS" below for documentation about what -such packages should do to be supported by --with. +debhelper commands. See the PROGRAMMING file for documentation about +the sequence addon interface. =item B<--until> I @@ -82,28 +82,6 @@ search for a command in the sequence exactly matching the name, to avoid any ambiguity. If there are multiple substring matches, the last one in the sequence will be used. -=head1 SEQUENCE ADDONS - -When B<--with> I is used, dh loads the perl module -Debian::Debhelper::Sequence::I. Two functions are provided to let -the module add its commands to sequences: - -=over 4 - -=item Debian::Debhelper::Dh_Lib::insert_before(existing_command, new_command) - -Insert I in sequences before I. - -=item Debian::Debhelper::Dh_Lib::insert_after(existing_command, new_command) - -Insert I in sequences after I. - -=item Debian::Debhelper::Dh_Lib::remove_command(existing_command) - -Remove I from the list of commands to run. - -=back - =cut sub command_pos { @@ -249,8 +227,8 @@ $sequences{install} = [@{$sequences{build}}, qw{ dh_installudev dh_installwm dh_installxfonts + dh_bugfiles dh_lintian - dh_desktop dh_gconf dh_icons dh_perl @@ -375,7 +353,7 @@ while (@ARGV_orig) { my %logged; my %startpoint; foreach my $package (@packages) { - my @log=loadlog($package); + my @log=load_log($package, \%logged); if ($dh{AFTER}) { # Run commands in the sequence that come after the # specified command. @@ -385,7 +363,7 @@ foreach my $package (@packages) { # no commands remain to run after it, communicating to # future dh instances that the specified command should not # be run again. - writelog($sequence[$startpoint{$package}-1], $package); + write_log($sequence[$startpoint{$package}-1], $package); } elsif ($dh{REMAINING}) { # Start at the beginning so all remaining commands will get @@ -442,6 +420,10 @@ sub run { my @exclude=@{shift()}; my @options=@_; + # If some packages are excluded, add flags + # to prevent them from being acted on. + push @options, map { "-N$_" } @exclude; + # Check for override targets in debian/rules and # run them instead of running the command directly. my $override_command; @@ -453,11 +435,6 @@ sub run { $command="debian/rules"; @options="override_".$override_command; } - else { - # If some packages are excluded, add flags - # to prevent them from being acted on. - push @options, map { "-N$_" } @exclude; - } # 3 space indent lines the command being run up under the # sequence name after "dh ". @@ -479,30 +456,11 @@ sub run { # been run by the rules file target. my %packages=map { $_ => 1 } @packages; map { delete $packages{$_} } @exclude; - writelog($override_command, keys %packages); + write_log($override_command, keys %packages); } } } -sub loadlog { - my $package=shift; - my $ext=pkgext($package); - - my @log; - open(LOG, "<", "debian/${ext}debhelper.log") || return; - while () { - chomp; - push @log, $_; - $logged{$package}{$_}=1; - } - close LOG; - return @log; -} - -sub writelog { - Debian::Debhelper::Dh_Lib::write_log(@_); -} - { my %targets; my $rules_parsed; @@ -515,7 +473,7 @@ sub rules_explicit_target { if (! $rules_parsed) { my $processing_targets = 0; my $not_a_target = 0; - open(MAKE, "LANG=C make -Rrnpsf debian/rules debhelper-fail-me 2>/dev/null |"); + open(MAKE, "LC_ALL=C make -Rrnpsf debian/rules debhelper-fail-me 2>/dev/null |"); while () { if ($processing_targets) { if (/^# Not a target:/) {