Bug#831524: dpkg: Add a way to drop the Built-For-Profiles field

2016-07-22 Thread Javier Serrano Polo
Control: tags -1 patch

El dg 17 de 07 de 2016 a les 00:23 +0200, Javier Serrano Polo va
escriure:
> a third way is at
> build time with a build profile named "clean" (or "dirty") in
> DEB_BUILD_PROFILES.

The solution with "clean" is the simplest to implement, keeping the
behavior of setting Built-For-Profiles by default.
--- a/scripts/dpkg-gencontrol.pl	2016-07-04 11:00:33.0 +
+++ b/scripts/dpkg-gencontrol.pl	2016-07-22 20:38:47.0 +
@@ -298,7 +298,9 @@
 }
 }
 
-$fields->{'Built-For-Profiles'} = join ' ', get_build_profiles();
+my @build_profiles = get_build_profiles();
+$fields->{'Built-For-Profiles'} = join ' ', @build_profiles
+unless any { $_ eq 'clean' } @build_profiles;
 
 for my $f (qw(Package Version Architecture)) {
 error(g_('missing information for output field %s'), $f)


smime.p7s
Description: S/MIME cryptographic signature


Bug#831524: dpkg: Add a way to drop the Built-For-Profiles field

2016-07-16 Thread Javier Serrano Polo
Package: dpkg
Version: 1.18.9
Severity: wishlist

As discussed in
https://lists.debian.org/debian-dpkg/2016/07/threads.html#00021 , there
should be a way to include the Built-For-Profiles field only when dirty
build profiles are active. Clean build profiles should yield identical
binary packages to those when no build profiles are active.

This may be useful when building a subset of binary packages for
testing, debugging, derivatives waiting for their changes to be merged
in Debian, and providing faster security updates locally. In Squeeze,
there were 21 packages (including exim4, gcc-4.4, gtk+2.0 and linux-2.6)
where building only a subset reduced compilation time or disk space
significantly.

Building a subset of packages can be achieved with build profiles. This
can also be solved with an independent environment variable, such as
DEB_BUILD_FLAVOURS or DEB_BUILD_PACKAGES, which would avoid
Built-For-Profiles.

The solution for the Built-For-Profiles field is to either drop it and
rely on .buildinfo files, or mark some build profiles as dirty or clean.
One way to mark is in binary stanzas with
"Build-Profiles-Content-Changes"; another way is in source stanzas with
"Clean-Build-Profiles" (or "Dirty-Build-Profiles"); a third way is at
build time with a build profile named "clean" (or "dirty") in
DEB_BUILD_PROFILES.


smime.p7s
Description: S/MIME cryptographic signature