Why is it taking so long implement Build-Options? It seems to me that the implementation is trivial: right before actually doing something (ie: checking build-dependencies), check for the Build-Options (plus adding it to the legal fields). The attached patch does that. Or is there some other stuff to do?
-- Felipe Sateler
From 821c5ae3860f0314daf0fa2c19a7d36f2c5c2dcb Mon Sep 17 00:00:00 2001
From: Felipe Sateler <[EMAIL PROTECTED]>
Date: Thu, 14 Feb 2008 01:11:11 -0300
Subject: [PATCH] Add support for Build-Options.
Add Build-Options as a legal keyword in the source control file.
Also implement build-arch as the first build option. This option
causes dpkg-buildpackage to call debian/rules with the build-arch
target if called with the -B option.
---
scripts/Dpkg/Fields.pm | 2 +-
scripts/dpkg-buildpackage.pl | 11 ++++++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/scripts/Dpkg/Fields.pm b/scripts/Dpkg/Fields.pm
index f1b9df3..ebc1e1e 100644
--- a/scripts/Dpkg/Fields.pm
+++ b/scripts/Dpkg/Fields.pm
@@ -15,7 +15,7 @@ our %EXPORT_TAGS = ('list' => [qw(%control_src_fields %control_pkg_fields
# Some variables (list of fields)
our %control_src_fields;
our %control_pkg_fields;
-$control_src_fields{$_} = 1 foreach (qw(Bugs Dm-Upload-Allowed
+$control_src_fields{$_} = 1 foreach (qw(Bugs Build-Options Dm-Upload-Allowed
Homepage Origin Maintainer Priority Section Source Standards-Version
Uploaders Vcs-Browser Vcs-Arch Vcs-Bzr Vcs-Cvs Vcs-Darcs Vcs-Git Vcs-Hg
Vcs-Mtn Vcs-Svn));
diff --git a/scripts/dpkg-buildpackage.pl b/scripts/dpkg-buildpackage.pl
index 72854dd..25f54c5 100755
--- a/scripts/dpkg-buildpackage.pl
+++ b/scripts/dpkg-buildpackage.pl
@@ -14,6 +14,7 @@ use Dpkg::BuildOptions;
use Dpkg::Compression;
use Dpkg::Version qw(check_version);
use Dpkg::Changelog qw(parse_changelog);
+use Dpkg::Control;
textdomain("dpkg-dev");
@@ -99,6 +100,7 @@ my $checkbuilddep = 1;
my $signsource = 1;
my $signchanges = 1;
my $diffignore = '';
+my $buildtarget = 'build';
my $binarytarget = 'binary';
my $targetarch = my $targetgnusystem = '';
@@ -299,6 +301,13 @@ unless ($sourceonly) {
my $pv = "${pkg}_$sversion";
my $pva = "${pkg}_${sversion}_$arch";
+my $source = Dpkg::Control->new()->get_source();
+if (defined($source->{"Build-Options"}) ) {
+ if($source->{"Build-Options"} =~ /build-arch/ && $binaryonly eq "-B") {
+ $buildtarget = "build-arch";
+ }
+}
+
if ($checkbuilddep) {
if ($admindir) {
push @checkbuilddep_args, "--admindir=$admindir";
@@ -329,7 +338,7 @@ unless ($binaryonly) {
chdir($dir) or failure("chdir $dir");
}
unless ($sourceonly) {
- withecho(@debian_rules, 'build');
+ withecho(@debian_rules, $buildtarget);
withecho(@rootcommand, @debian_rules, $binarytarget);
}
if ($usepause &&
--
1.5.4.1
signature.asc
Description: This is a digitally signed message part.

