dpkg: Fix caching of architecture name

Our deb-closure script would causes zillions of invocations of "dpkg
--print-architecture", which is rather slow.
This commit is contained in:
Eelco Dolstra 2012-12-04 19:54:44 +01:00
parent f4ec141869
commit 6751fac418
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,15 @@
Don't invoke "dpkg --print-architecture" for every call to
Dpkg::Arch::get_raw_build_arch().
diff -ru -x '*~' dpkg-1.16.9/scripts/Dpkg/Arch.pm dpkg-1.16.9-new/scripts/Dpkg/Arch.pm
--- dpkg-1.16.9/scripts/Dpkg/Arch.pm 2012-10-20 06:34:17.000000000 +0200
+++ dpkg-1.16.9-new/scripts/Dpkg/Arch.pm 2012-12-04 19:42:20.451002537 +0100
@@ -59,7 +59,7 @@
# dpkg-architecture itself, by avoiding computing the DEB_BUILD_
# variables when they are not requested.
- my $build_arch = `dpkg --print-architecture`;
+ $build_arch = `dpkg --print-architecture`;
syserr("dpkg --print-architecture failed") if $? >> 8;
chomp $build_arch;

View File

@ -10,6 +10,8 @@ stdenv.mkDerivation {
sha256 = "0ykby9x4x2zb7rfj30lfjcsrq2q32z2lnsrl8pbdvb2l9sx7zkbk";
};
patches = [ ./cache-arch.patch ];
configureFlags = "--disable-dselect --with-admindir=/var/lib/dpkg PERL_LIBDIR=$(out)/${perl.libPrefix}";
preConfigure = ''