~ubuntu-branches/ubuntu/utopic/debhelper/utopic-proposed

« back to all changes in this revision

Viewing changes to Debian/Debhelper/Dh_Lib.pm

  • Committer: Steve Langasek
  • Author(s): Martin Pitt
  • Date: 2011-10-16 06:51:20 UTC
  • mfrom: (1.4.35 sid)
  • Revision ID: steve.langasek@canonical.com-20111016065120-3qbjooj2ai6a783a
Tags: 8.9.8ubuntu1
merge 8.9.8 from Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
            &inhibit_log &load_log &write_log &commit_override_log
19
19
            &dpkg_architecture_value &sourcepackage
20
20
            &is_make_jobserver_unavailable &clean_jobserver_makeflags
21
 
            &cross_command &set_buildflags);
 
21
            &cross_command &set_buildflags &get_buildoption);
22
22
 
23
23
my $max_compat=9;
24
24
 
146
146
        my $cmd=shift;
147
147
        my @packages=@_;
148
148
 
 
149
        return if $dh{NO_ACT};
 
150
 
149
151
        foreach my $package (@packages) {
150
152
                my $log=logfile($package);
151
153
                open(LOG, ">>", $log) || error("failed to write to ${log}: $!");
157
159
sub commit_override_log {
158
160
        my @packages=@_;
159
161
 
 
162
        return if $dh{NO_ACT};
 
163
 
160
164
        foreach my $package (@packages) {
161
165
                my @log=map { remove_override($_) } load_log($package);
162
166
                my $log=logfile($package);
324
328
 
325
329
        sub compat {
326
330
                my $num=shift;
 
331
                my $nowarn=shift;
327
332
        
328
333
                if (! defined $c) {
329
334
                        $c=1;
345
350
                        }
346
351
                }
347
352
 
348
 
                if ($c <= 4 && ! $warned_compat) {
 
353
                if ($c <= 4 && ! $warned_compat && ! $nowarn) {
349
354
                        warning("Compatibility levels before 5 are deprecated.");
350
355
                        $warned_compat=1;
351
356
                }
903
908
# Sets environment variables from dpkg-buildflags. Avoids changing
904
909
# any existing environment variables.
905
910
sub set_buildflags {
906
 
        # optimisation
907
 
        return if $ENV{DH_INTERNAL_BUILDFLAGS};
 
911
        return if $ENV{DH_INTERNAL_BUILDFLAGS} || compat(8);
908
912
        $ENV{DH_INTERNAL_BUILDFLAGS}=1;
909
913
 
910
914
        eval "use Dpkg::BuildFlags";
923
927
        }
924
928
}
925
929
 
 
930
# Gets a DEB_BUILD_OPTIONS option, if set.
 
931
sub get_buildoption {
 
932
        my $wanted=shift;
 
933
 
 
934
        return undef unless exists $ENV{DEB_BUILD_OPTIONS};
 
935
 
 
936
        foreach my $opt (split(/\s+/, $ENV{DEB_BUILD_OPTIONS})) {
 
937
                # currently parallel= is the only one with a parameter
 
938
                if ($opt =~ /^parallel=(-?\d+)$/ && $wanted eq 'parallel') {
 
939
                        return $1;
 
940
                }
 
941
                elsif ($opt eq $wanted) {
 
942
                        return 1;
 
943
                }
 
944
        }
 
945
}
 
946
 
926
947
1