Debian Bug report logs - #440332
fix_la_file in dpkg-cross does not properly match all dependencies

version graph

Package: dpkg-cross; Maintainer for dpkg-cross is Debian Embedded Group <debian-embedded@lists.debian.org>; Source for dpkg-cross is src:dpkg-cross.

Reported by: jeff+debian-bugs@mastfamily.com

Date: Fri, 31 Aug 2007 15:36:02 UTC

Severity: normal

Tags: patch

Found in versions dpkg-cross/1.39, dpkg-cross/2.1.0

Fixed in version dpkg-cross/2.2.0

Done: Neil Williams <codehelp@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#440332; Package dpkg-cross. Full text and rfc822 format available.

Acknowledgement sent to jeff+debian-bugs@mastfamily.com:
New Bug report received and forwarded. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Jeff Mast <jeff.mast@mastfamily.com>
To: submit@bugs.debian.org
Subject: fix_la_file in dpkg-cross does not properly match all dependencies
Date: Fri, 31 Aug 2007 09:30:06 -0600
Package: dpkg-cross
Version: 1.39

The regular expression search/replace doesn't match libraries that have a
'-' or an extra '.' in the version name.

I hacked my version (fix_la_file routine) as follows to fix the problems
I was having:

Version: 1.39:

s/\S+\/(\w+.la)/$crosslib\/$1/g;

My Hack:

s/\S+\/([\w-.]+.la)/$crosslib\/$1/g;


> Problem there - the . is a special character matching anything. You
> probably need to escape the period (and later):
>
> - s/\S+\/([\w-.]+.la)/$crosslib\/$1/g;
> + s/\S+\/([\w-\.]+\.la)/$crosslib\/$1/g;
>
> Otherwise it could inadvertently allow a match with _ or even with
> rubbish like foo%£la or /usr/share/foo/foola.txt
>
> Would you mind testing that?

> If it works, please attach a full 'diff -u' to make a usable patch
> against 1.39 or 1.99+2.0.0pre1, your choice. I'll then check for other
> unescaped periods in regexps in dpkg-cross. :-)

> Actually, the more I look at that regexp, the more problems appear -
> I'll have to check whether '$' should be used at the end too.

You are correct, the escape is needed before the .la (e.g. \.la);
however, inside the [], they are not necessary.
Attached is the diff against 1.39.

dpkg-cross
=======================================
diff -Nru dpkg-cross-1.39.orig/dpkg-cross dpkg-cross-1.39/dpkg-cross
--- dpkg-cross-1.39.orig/dpkg-cross     2007-07-05 14:46:43.000000000 -0600
+++ dpkg-cross-1.39/dpkg-cross  2007-08-31 09:05:11.000000000 -0600
@@ -470,7 +470,7 @@
                               print TO "libdir=\'$crosslib\'\n";
                       } elsif (/^dependency_libs=/) {
                               s/( )?-L\S+//g;
-                               s/\S+\/(\w+.la)/$crosslib\/$1/g;
+                               s/\S+\/([\w-.]+\.la)/$crosslib\/$1/g;
                               print TO;
                       } else {
                               print TO;




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#440332; Package dpkg-cross. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. Full text and rfc822 format available.

Message #10 received at 440332@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 440332@bugs.debian.org
Cc: 440332-submitter@bugs.debian.org, Debian Embedded <debian-embedded@lists.debian.org>
Subject: regexp needs a terminator
Date: Tue, 19 Feb 2008 11:26:23 +0000
[Message part 1 (text/plain, inline)]
A simple test script should illustrate the problem with the proposed
change:

#!/usr/bin/perl

my @tests = qw:/usr/share/foo/foo1.2la /usr/lib/foo/foo1.2la
/usr/share/foo/foo1.2.la /usr/lib/foo/foo1.2.la
/usr/lib/qof.la /usr/lib/qof-1.la /usr/lib/qof-%DF_1.la
/usr/lib/qof.lai /usr/lib/qof.laitrtl /usr/lib/qof]zd.la
/usr/lib/qof-~1.la /usr/lib/qof%d.la /usr/lib/qof-_1.la:;
my $crosslib = "/usr/arm-linux-gnu";
foreach my $t (@tests)
{
	$safe = $t;
	$t =~ s/\S+\/(\w+.la)$/$crosslib\/$1/g;
	print "$t\n";
	$t = $safe;
	$t =~ s/\S+\/([\w-.]+\.la)/$crosslib\/$1/g;
	print "\t$t\n";
	$t = $safe;
	$t =~ s/\S+\/([\w\.\-]+\.la)$/$crosslib\/$1/g;
	print "\t\t$t\n";
}

First reg exp is the current version (buggy).
Second reg exp is the proposal from this bug report.
Third is my proposed fix.

output:

/usr/share/foo/foo1.2la
	/usr/share/foo/foo1.2la
		/usr/share/foo/foo1.2la
/usr/lib/foo/foo1.2la
	/usr/lib/foo/foo1.2la
		/usr/lib/foo/foo1.2la
/usr/share/foo/foo1.2.la
	/usr/arm-linux-gnu/foo1.2.la
		/usr/arm-linux-gnu/foo1.2.la
/usr/lib/foo/foo1.2.la
	/usr/arm-linux-gnu/foo1.2.la
		/usr/arm-linux-gnu/foo1.2.la
/usr/arm-linux-gnu/qof.la
	/usr/arm-linux-gnu/qof.la
		/usr/arm-linux-gnu/qof.la
/usr/lib/qof-1.la
	/usr/arm-linux-gnu/qof-1.la
		/usr/arm-linux-gnu/qof-1.la
/usr/lib/qof-%DF_1.la
	/usr/lib/qof-%DF_1.la
		/usr/lib/qof-%DF_1.la
/usr/lib/qof.lai
	/usr/arm-linux-gnu/qof.lai
		/usr/lib/qof.lai
/usr/lib/qof.laitrtl
	/usr/arm-linux-gnu/qof.laitrtl
		/usr/lib/qof.laitrtl
/usr/lib/qof]zd.la
	/usr/lib/qof]zd.la
		/usr/lib/qof]zd.la
/usr/lib/qof-~1.la
	/usr/lib/qof-~1.la
		/usr/lib/qof-~1.la
/usr/lib/qof%d.la
	/usr/lib/qof%d.la
		/usr/lib/qof%d.la
/usr/lib/qof-_1.la
	/usr/arm-linux-gnu/qof-_1.la
		/usr/arm-linux-gnu/qof-_1.la

The difference is here:

/usr/lib/qof.lai
	/usr/arm-linux-gnu/qof.lai
		/usr/lib/qof.lai
/usr/lib/qof.laitrtl
	/usr/arm-linux-gnu/qof.laitrtl
		/usr/lib/qof.laitrtl

lai and laitrl (made-up) files should not match this reg exp.

Escaping the '.' makes no difference.

Is '~' valid in such a context? Is it worth specifically including?

-	$t =~ s/\S+\/([\w\.\-]+\.la)$/$crosslib\/$1/g;
+	$t =~ s/\S+\/([\w\.\-\~]+\.la)$/$crosslib\/$1/g;


-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[signature.asc (application/pgp-signature, inline)]

Message sent on to jeff+debian-bugs@mastfamily.com:
Bug#440332. Full text and rfc822 format available.

Bug marked as found in version 2.1.0. Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 19 Feb 2008 11:30:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Embedded Group <debian-embedded@lists.debian.org>:
Bug#440332; Package dpkg-cross. Full text and rfc822 format available.

Acknowledgement sent to Neil Williams <codehelp@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Embedded Group <debian-embedded@lists.debian.org>. Full text and rfc822 format available.

Message #20 received at 440332@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 440332@bugs.debian.org
Cc: Debian Embedded <debian-embedded@lists.debian.org>
Subject: probable patch
Date: Tue, 19 Feb 2008 12:52:32 +0000
[Message part 1 (text/plain, inline)]
package dpkg-cross
tag 440332 + patch pending
quit

Patch against 2.1.1

Index: dpkg-cross
===================================================================
RCS file: /cvsroot/dpkg-cross/dpkg-cross/dpkg-cross,v
retrieving revision 1.46
diff -p -u -b -B -r1.46 dpkg-cross
--- dpkg-cross	7 Dec 2007 21:06:44 -0000	1.46
+++ dpkg-cross	19 Feb 2008 12:40:55 -0000
@@ -481,7 +481,7 @@ sub sub_build {
 				print TO "libdir=\'$crosslib\'\n";
 			} elsif (/^dependency_libs=/) {
 				s/( )?-L\S+//g;
-				s/\S+\/(\w+.la)/$crosslib\/$1/g;
+				s/\S+\/([\w\.\-]+\.la)$/$crosslib\/$1/g;
 				print TO;
 			} else {
 				print TO;

I'll upload a new version with this patch to Debian unstable before
Fosdem.

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/


[signature.asc (application/pgp-signature, inline)]

Tags added: patch, pending Request was from Neil Williams <codehelp@debian.org> to control@bugs.debian.org. (Tue, 19 Feb 2008 12:54:02 GMT) Full text and rfc822 format available.

Reply sent to Neil Williams <codehelp@debian.org>:
You have taken responsibility. Full text and rfc822 format available.

Notification sent to jeff+debian-bugs@mastfamily.com:
Bug acknowledged by developer. Full text and rfc822 format available.

Message #27 received at 440332-close@bugs.debian.org (full text, mbox):

From: Neil Williams <codehelp@debian.org>
To: 440332-close@bugs.debian.org
Subject: Bug#440332: fixed in dpkg-cross 2.2.0
Date: Wed, 20 Feb 2008 12:02:03 +0000
Source: dpkg-cross
Source-Version: 2.2.0

We believe that the bug you reported is fixed in the latest version of
dpkg-cross, which is due to be installed in the Debian FTP archive:

dpkg-cross_2.2.0.dsc
  to pool/main/d/dpkg-cross/dpkg-cross_2.2.0.dsc
dpkg-cross_2.2.0.tar.gz
  to pool/main/d/dpkg-cross/dpkg-cross_2.2.0.tar.gz
dpkg-cross_2.2.0_all.deb
  to pool/main/d/dpkg-cross/dpkg-cross_2.2.0_all.deb
libdebian-dpkgcross-perl_2.2.0_all.deb
  to pool/main/d/dpkg-cross/libdebian-dpkgcross-perl_2.2.0_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 440332@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Neil Williams <codehelp@debian.org> (supplier of updated dpkg-cross package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Tue, 19 Feb 2008 12:53:11 +0000
Source: dpkg-cross
Binary: dpkg-cross libdebian-dpkgcross-perl
Architecture: source all
Version: 2.2.0
Distribution: unstable
Urgency: low
Maintainer: Debian Embedded Group <debian-embedded@lists.debian.org>
Changed-By: Neil Williams <codehelp@debian.org>
Description: 
 dpkg-cross - tools for cross compiling Debian packages
 libdebian-dpkgcross-perl - functions to aid cross-compiling Debian packages
Closes: 440332 466514
Changes: 
 dpkg-cross (2.2.0) unstable; urgency=low
 .
   * Post remove script fails on purge (Closes: #466514)
   * fix_la_file in dpkg-cross does not properly match all dependencies
     (Closes: #440332)
 .
 dpkg-cross (2.1.1) unstable; urgency=low
 .
   * Fix typo in keep temp logic
Files: 
 44269b622e6bd6a8ed50ea13610328cc 966 utils extra dpkg-cross_2.2.0.dsc
 efaae6aa4711a8cafedd44838e553dcd 83966 utils extra dpkg-cross_2.2.0.tar.gz
 4ddf0dc74403e04cf8aac009bc3b3f47 48652 utils extra dpkg-cross_2.2.0_all.deb
 e862d5f7807cd23b072156ed0afd844d 29782 perl extra libdebian-dpkgcross-perl_2.2.0_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHvBP3iAEJSii8s+MRAs3oAKDnvX8GU1+mbtx4r++i2rmvVmoQIwCguQn1
sqilBr9uL5wd44IUJrhAohk=
=byoa
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 31 Mar 2008 07:29:52 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Thu Apr 24 06:35:02 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.