[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#440332: fix_la_file in dpkg-cross does not properly match all dependencies

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:


My Hack:


> 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.

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;

Reply to: