Control: tag -1 patch

On Sat, 2014-12-06 at 22:06:22 +0100, Guillem Jover wrote:
> On Sat, 2014-12-06 at 21:15:29 +0100, folkert wrote:
> > > > Package: dpkg-build
> > > > Version: any
> > > > Severity: important

> At least Debian::Debhelper::Dh_Lib, /usr/share/cdbs/1/rules/buildcore.mk,
> /usr/share/cdbs/1/rules/buildvars.mk and /usr/lib/cdbs/list-packages
> do parse control files but do not handle the field names in a
> case-insensitive way. There might be other instances on those packages.

Attached a patch that should fix this.

Thanks,
Guillem
From beaa9494228d780ae88eb68e306611964b09d6d2 Mon Sep 17 00:00:00 2001
From: Guillem Jover <guil...@debian.org>
Date: Thu, 11 Dec 2014 02:31:11 +0100
Subject: [PATCH] Parse control file fields case-insensitively

Closes: #772129
---
 Debian/Debhelper/Dh_Lib.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index 0519d20..e9c9b54 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -771,7 +771,7 @@ sub sourcepackage {
 	while (<CONTROL>) {
 		chomp;
 		s/\s+$//;
-		if (/^Source:\s*(.*)/) {
+		if (/^Source:\s*(.*)/i) {
 			close CONTROL;
 			return $1;
 		}
@@ -813,7 +813,7 @@ sub getpackages {
 	while (<CONTROL>) {
 		chomp;
 		s/\s+$//;
-		if (/^Package:\s*(.*)/) {
+		if (/^Package:\s*(.*)/i) {
 			$package=$1;
 			# Detect duplicate package names in the same control file.
 			if (! $seen{$package}) {
@@ -825,16 +825,16 @@ sub getpackages {
 			$package_type="deb";
 			$included_in_build_profile=1;
 		}
-		if (/^Architecture:\s*(.*)/) {
+		if (/^Architecture:\s*(.*)/i) {
 			$arch=$1;
 		}
-		if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/) {
+		if (/^(?:X[BC]*-)?Package-Type:\s*(.*)/i) {
 			$package_type=$1;
 		}
 		# rely on libdpkg-perl providing the parsing functions because
 		# if we work on a package with a Build-Profiles field, then a
 		# high enough version of dpkg-dev is needed anyways
-		if (/^Build-Profiles:\s*(.*)/) {
+		if (/^Build-Profiles:\s*(.*)/i) {
 		        my $build_profiles=$1;
 			eval {
 				require Dpkg::BuildProfiles;
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to