On Thu, Nov 13, 2003 at 07:47:03PM -0600, Adam Heath wrote: > On Wed, 12 Nov 2003, Bill Allombert wrote: > > > Hello, > > > > I am offering a third patch that implement the Build-Options control > > field proposal. > > I reject this proposal, until such time as the code has implemented it. > > hint: send patches to the bts for dpkg-dev
Well, here a patch that implement Build-Options: build-arch as described in the patch #3 I sent here. Cheers, -- Bill. <[EMAIL PROTECTED]> Imagine a large red swirl here.
--- dpkg-1.10.18/scripts/controllib.pl 2003-09-19 19:29:09.000000000 +0200 +++ dpkg-1.10.18.new/scripts/controllib.pl 2003-11-17 18:03:25.000000000 +0100 @@ -15,7 +15,8 @@ grep($capit{lc $_}=$_, qw(Pre-Depends Standards-Version Installed-Size Build-Depends Build-Depends-Indep - Build-Conflicts Build-Conflicts-Indep)); + Build-Conflicts Build-Conflicts-Indep + Build-Options)); @pkg_dep_fields = qw(Replaces Provides Depends Pre-Depends Recommends Suggests Conflicts Enhances); @src_dep_fields = qw(Build-Depends Build-Depends-Indep @@ -300,6 +301,15 @@ $index || &syntax("empty file"); return $index; } +sub parsebuildoption +{ + $controlfile=$_[0]; + &parsecontrolfile; + my $opts=$fi{'C Build-Options'}; + return if (!defined($opts)); + $opts=~ s/ //; + return split(',',$opts); +} sub unknown { &warn("unknown information field " . $fi{"o:$_"} . " in input data in $_[0]"); @@ -328,4 +338,8 @@ } } +if ($0 =~ /controllib\.pl$/ ) +{ + eval join(' ',@ARGV); +} 1; --- dpkg-1.10.18/scripts/dpkg-buildpackage.sh 2003-09-20 02:57:39.000000000 +0200 +++ dpkg-1.10.18.new/scripts/dpkg-buildpackage.sh 2003-11-17 18:18:17.000000000 +0100 @@ -2,7 +2,8 @@ set -e -version="1.10.10"; # This line modified by Makefile +version="1.10.18"; # This line modified by Makefile +dpkglibdir="."; # This line modified by Makefile progname="`basename \"$0\"`" usageversion () { @@ -61,6 +62,7 @@ checkbuilddep=true checkbuilddep_args='' binarytarget=binary +buildtarget=build sourcestyle='' version='' since='' @@ -156,6 +158,16 @@ sversion=`echo "$version" | perl -pe 's/^\d+://'` pv="${package}_${sversion}" pva="${package}_${sversion}_${arch}" +buildoptions=(`perl $dpkglibdir/controllib.pl \ + 'print parsebuildoption("debian/control")'`) + +if [ $binarytarget = binary-arch ] ; then + for opt in $buildoptions; do + if [ $opt = build-arch ] ; then + buildtarget='build-arch' + fi + done +fi signfile () { if test "$signinterface" = "gpg" ; then @@ -196,7 +208,7 @@ cd ..; withecho dpkg-source $passopts $diffignore $tarignore -b "$dirn"; cd "$dirn" fi if [ x$sourceonly = x ]; then - withecho debian/rules build + withecho debian/rules $buildtarget withecho $rootcommand debian/rules $binarytarget fi if [ "$usepause" = "true" ] && \ --- dpkg-1.10.18/scripts/Makefile.in 2002-05-20 06:40:27.000000000 +0200 +++ dpkg-1.10.18.new/scripts/Makefile.in 2003-11-16 21:01:09.000000000 +0100 @@ -108,3 +108,5 @@ %: %.sh $(SED) -e "s:version=\"[^\"]*\":version=\"$(VERSION)\":" \ < $< > $@ + $(SED) -e "s:dpkglibdir=\"[^\"]*\":dpkglibdir=\"$(dpkglibdir)\":" \ + < $< > $@