From patchwork Wed Mar 23 14:37:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcin Juszkiewicz X-Patchwork-Id: 755 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:28 -0000 Delivered-To: patches@linaro.org Received: by 10.220.28.198 with SMTP id n6cs10292vcc; Wed, 23 Mar 2011 07:37:33 -0700 (PDT) Received: by 10.213.97.30 with SMTP id j30mr281674ebn.20.1300891052552; Wed, 23 Mar 2011 07:37:32 -0700 (PDT) Received: from smtp.host4.kei.pl (host4.kei.pl [94.152.8.4]) by mx.google.com with ESMTP id s8si11859720eeh.88.2011.03.23.07.37.31; Wed, 23 Mar 2011 07:37:32 -0700 (PDT) Received-SPF: neutral (google.com: 94.152.8.4 is neither permitted nor denied by best guess record for domain of marcin.juszkiewicz@linaro.org) client-ip=94.152.8.4; Authentication-Results: mx.google.com; spf=neutral (google.com: 94.152.8.4 is neither permitted nor denied by best guess record for domain of marcin.juszkiewicz@linaro.org) smtp.mail=marcin.juszkiewicz@linaro.org Received: (qmail 20668 invoked by uid 2404007); 23 Mar 2011 14:37:31 -0000 X-clamdmail: clamdmail 0.18a Received: from 87-206-60-144.dynamic.chello.pl (HELO ?192.168.1.112?) (marcin@juszkiewicz.com.pl@87.206.60.144) by host4.kei.pl with ESMTPA; 23 Mar 2011 14:37:31 -0000 Subject: [PATCH] dpkg-cross: handle multi-arch packages too From: Marcin Juszkiewicz To: debian-embedded@lists.debian.org, Neil Williams Cc: linaro-dev@lists.linaro.org, patches@linaro.org, 739151@bugs.launchpad.net Organization: Linaro Date: Wed, 23 Mar 2011 15:37:34 +0100 Message-ID: <1300891054.14767.30.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Hi Ubuntu 'natty' switched to multiarch recently and my cross toolchain packages started to fail to build. Most of problems were fixed but then dpkg-cross hit us. Today I looked at dpkg-cross and made attached patch to handle problem. What patch does is converting multiarch packages into old style ones. There is no extra switch like "--force-even-when-multiarch" and "--convert-anyway -A" is used instead. This is change against latest CVS code (dpkg-cross r1.83). >From my tests it looks like it does proper job. Index: dpkg-cross =================================================================== RCS file: /cvsroot/dpkg-cross/dpkg-cross/dpkg-cross,v retrieving revision 1.83 diff -u -r1.83 dpkg-cross --- dpkg-cross 23 Feb 2011 14:46:33 -0000 1.83 +++ dpkg-cross 23 Mar 2011 14:32:35 -0000 @@ -507,7 +507,7 @@ } close(CONTROL); - if (defined ($control{'multi-arch'})) { + if (defined ($control{'multi-arch'}) and !$anyway) { my $output = basename ($package); warn sprintf(_g("%s: Skipping the '%s' Multi-Arch package.\n"), $progname, $output); if (not -f $output) { @@ -775,6 +775,16 @@ } elsif ((m:^/emul/ia32-linux/usr/lib/([^/]+\.[ao])$:)) { # regular .a or .o file under /emul/ia32-linux/ for #463588 link_file("$src$_", "$dst$crosslib32/$1") or goto fail; + } elsif (m:^(/usr)?/lib/$crosstype/([^/]+\.[ao])$:) { + # regular .a or .o file under /lib or /usr/lib/TRIPLET/ + link_file("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail; + } elsif (m:^(/usr)?/lib/$crosstype/([^/]+\.so[^/]*)$:) { + # regular .so* file under /lib/TRIPLET or /usr/lib/TRIPLET + if (is_ldscript("$src$_")) { + fix_ldscript("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail; + } else { + link_file("$src$_", "$dst$crosslib/$crosstype/$2") or goto fail; + } } elsif (m:^(/usr(/X11R6)?)?/lib/([^/]+\.so[^/]*)$:) { # regular .so* file under /lib, /usr/lib or /usr/X11R6/lib if (is_ldscript("$src$_")) { @@ -914,7 +924,18 @@ # useful or packaged in the -cross package, basically anything # in a directory beneath /usr/lib/. See #499292 # except pkgconfig symlinks, see #506956 - next if (($lv =~ m:$crosslib/.*/:) and ($lv !~ m:$crosslib/pkgconfig/:)); + # also handle multiarch packages with /usr/lib/TRIPLET/ directory + next if ( + ( + ($lv =~ m:$crosslib/$crosstype/.*/:) and + ($lv !~ m:$crosslib/$crosstype/pkgconfig/:) + ) or + ( + ($lv =~ m:$crosslib/.*/:) and + ($lv !~ m:$crosslib/pkgconfig/:) and + ($lv !~ m:$crosslib/$crosstype/:) + ) + ); $lv =~ m:$crosslib/(.*)$:; # Translators, retain the -> to indicate the direction of the link. printf (_g("Creating symlink %s -> %s\n"), $_, $1) if ($verbose >= 2);