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

Re: dpkg-cross lib*.la fix_la_file bug



Neil Williams wrote:
It would help me if you could report this as a bug against dpkg-cross
in the Debian BTS because it is easier to track. Thanks.
Sure.
The regular expression search/replace you have 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.

Jeff
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: