From a24fa4c525934922a6035470556051d50ad4da02 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Thu, 3 Jan 2008 09:38:11 +0200 Subject: [PATCH] Do not automatically enable -j if DEB_BUILD_OPTIONS contains parallel=n Allow overriding its value from the environment. Closes: #458589 --- ChangeLog | 6 ++++++ debian/changelog | 2 ++ man/ChangeLog | 4 ++++ man/dpkg-buildpackage.1 | 6 +++--- scripts/dpkg-buildpackage.pl | 16 +++++++--------- 5 files changed, 22 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 883e4368..69815525 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-03 Guillem Jover + + * scripts/dpkg-buildpackage.pl: Do not automatically enable '-j' + if DEB_BUILD_OPTIONS contains parallel=n, and allow overriding + its value from the environment. + 2008-01-02 Guillem Jover * utils/start-stop-daemon.c [!__GNUC__] (fatal, badusage): Remove diff --git a/debian/changelog b/debian/changelog index 05163433..7b8f0246 100644 --- a/debian/changelog +++ b/debian/changelog @@ -29,6 +29,8 @@ dpkg (1.14.15) UNRELEASED; urgency=low compressed sources. Closes: #458519 * Promote bzip2 Recommends to Depends for dpkg-dev. Closes: #458521 * Add lzma to dpkg-dev Depends. + * Do not automatically enable -j if DEB_BUILD_OPTIONS contains parallel=n, + and allow overriding its value from the environment. Closes: #458589 [ Updated dpkg translations ] * Norwegian Bokmål (Hans Fredrik Nordhaug). Closes: #457918, #458732 diff --git a/man/ChangeLog b/man/ChangeLog index c1803235..76f7fab4 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,7 @@ +2008-01-03 Guillem Jover + + * dpkg-buildpackage.1: Document new -j behaviour. + 2008-01-02 Christian Perrier * po/fr.po: converted to UTF-8. Updated to 1171t139f74u diff --git a/man/dpkg-buildpackage.1 b/man/dpkg-buildpackage.1 index 50414570..2a84119e 100644 --- a/man/dpkg-buildpackage.1 +++ b/man/dpkg-buildpackage.1 @@ -1,4 +1,4 @@ -.TH dpkg\-buildpackage 1 "2007-09-28" "Debian Project" "dpkg utilities" +.TH dpkg\-buildpackage 1 "2008-01-03" "Debian Project" "dpkg utilities" .SH NAME dpkg\-buildpackage \- build binary or source packages from sources . @@ -55,8 +55,8 @@ environment variable, which should cause all subsequent make invocations to inherit the option. Also adds \fBparallel=\fP\fIjobs\fP to the DEB_BUILD_OPTIONS environment variable which allows debian/rules files to use this information for their own purposes. -If no \fB-j\fP option is given, an existing value for \fBparallel\fP will be -honoured and added to MAKEFLAGS. +The \fBparallel=\fP\fIjobs\fP in DEB_BUILD_OPTIONS environment variable +will override the \fB-j\fP value if this option is given. .TP .BI \-v version Use changelog information from all versions strictly later than diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl index dfa0041b..84b984b5 100755 --- a/scripts/dpkg-buildpackage.pl +++ b/scripts/dpkg-buildpackage.pl @@ -241,17 +241,15 @@ if ($signcommand && ($signinterface !~ /^(gpg|pgp)$/)) { warning(_g("unknown sign command, assuming pgp style interface")); } -if ($parallel || $ENV{DEB_BUILD_OPTIONS}) { +if ($parallel) { my $build_opts = Dpkg::BuildOptions::parse(); - $parallel ||= $build_opts->{parallel}; - if (defined $parallel) { - $ENV{MAKEFLAGS} ||= ''; - if ($parallel eq '-1') { - $ENV{MAKEFLAGS} .= " -j"; - } else { - $ENV{MAKEFLAGS} .= " -j$parallel"; - } + $parallel = $build_opts->{parallel} if (defined $build_opts->{parallel}); + $ENV{MAKEFLAGS} ||= ''; + if ($parallel eq '-1') { + $ENV{MAKEFLAGS} .= " -j"; + } else { + $ENV{MAKEFLAGS} .= " -j$parallel"; } $build_opts->{parallel} = $parallel; Dpkg::BuildOptions::set($build_opts); -- 2.39.5