Bug#832564: debhelper: udeb packages should not be processed with noudeb

2018-03-02 Thread Javier Serrano Polo
On Wed, 27 Jul 2016 17:38:05 +0200 Helmut Grohne  wrote:
> Just
> adding those headers is more explicit and much harder to get wrong.

It is more explicit and redundant. If you do not add those headers, you
do not get wrong at all.

> It simply isn't worth the maintenance cost.

You described development cost, not maintenance one.

Adding Build-Profiles fields is not an option because maintainers are
reluctant to support build profiles; e.g.,
https://bugs.debian.org/890834 .

I know it is not worth your effort since you do not use noudeb and
similar build profiles; it is worth mine. It is far easier for me to
maintain this code than to add Build-Profiles fields to all packages.


smime.p7s
Description: S/MIME cryptographic signature


Bug#832564: debhelper: udeb packages should not be processed with noudeb

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

This patch fixes the issue.
--- a/Debian/Debhelper/Dh_Lib.pm	2016-07-09 09:53:02.0 +
+++ b/Debian/Debhelper/Dh_Lib.pm	2016-07-27 00:48:29.0 +
@@ -39,6 +39,8 @@
 	_gz
 );
 
+use List::Util qw(any);
+
 # The Makefile changes this if debhelper is installed in a PREFIX.
 my $prefix="/usr";
 
@@ -968,6 +970,9 @@
 		}
 		if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/i) {
 			$package_type=$1;
+			if ($package_type eq 'udeb' and any { $_ eq 'noudeb' } @profiles) {
+$included_in_build_profile=0;
+			}
 		}
 		if (/^Multi-Arch: \s*(.*)\s*/i) {
 			$multiarch = $1;
@@ -977,15 +982,17 @@
 		# high enough version of dpkg-dev is needed anyways
 		if (/^Build-Profiles:\s*(.*)/i) {
 		my $build_profiles=$1;
-			eval {
-require Dpkg::BuildProfiles;
-my @restrictions=Dpkg::BuildProfiles::parse_build_profiles($build_profiles);
-if (@restrictions) {
-	$included_in_build_profile=Dpkg::BuildProfiles::evaluate_restriction_formula(\@restrictions, \@profiles);
+			if ($included_in_build_profile) {
+eval {
+	require Dpkg::BuildProfiles;
+	my @restrictions=Dpkg::BuildProfiles::parse_build_profiles($build_profiles);
+	if (@restrictions) {
+		$included_in_build_profile=Dpkg::BuildProfiles::evaluate_restriction_formula(\@restrictions, \@profiles);
+	}
+};
+if ($@) {
+	error("The control file has a Build-Profiles field. Requires libdpkg-perl >= 1.17.14");
 }
-			};
-			if ($@) {
-error("The control file has a Build-Profiles field. Requires libdpkg-perl >= 1.17.14");
 			}
 		}
 


smime.p7s
Description: S/MIME cryptographic signature


Bug#832564: debhelper: udeb packages should not be processed with noudeb

2016-07-26 Thread Javier Serrano Polo
Package: debhelper
Version: 9.20160709
Severity: wishlist

udeb packages are being processed when the noudeb build profile is
active. It should not be necessary to include:
Build-Profiles: 
in debian/control. 


smime.p7s
Description: S/MIME cryptographic signature