X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debian%2FDebhelper%2FDh_Lib.pm;h=325c7fc3823e895e2cd483cc8085d9cea00281a6;hb=4eb727d47ff6e04eb1634ca66df191bbf69e2009;hp=28a90f7bdad16b37900c7021d9b055f2d8f6388b;hpb=9b758456f806e9813e2b7b91d7596c63b63f55ae;p=debhelper.git diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 28a90f7..325c7fc 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -608,7 +608,7 @@ sub excludefile { sub dpkg_architecture_value { my $var = shift; - my $value=`dpkg-architecture -q$var 2>/dev/null` || error("dpkg-architecture failed"); + my $value=`dpkg-architecture -q$var` || error("dpkg-architecture failed"); chomp $value; return $value; } @@ -630,10 +630,9 @@ sub dpkg_architecture_value { my $os; sub buildos { - return $os if defined $os; - - $os=`dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null` || error("dpkg-architecture failed"); - chomp $os; + if (!defined $os) { + $os=dpkg_architecture_value("DEB_HOST_ARCH_OS"); + } return $os; } } @@ -668,9 +667,8 @@ sub sourcepackage { } # Returns a list of packages in the control file. -# Must pass "arch" or "indep" or "same" to specify arch-dependant or -# -independant or same arch packages. If nothing is specified, returns all -# packages. +# Pass "arch" or "indep" to specify arch-dependant or +# independant. If nothing is specified, returns all packages. # As a side effect, populates %package_arches and %package_types with the # types of all packages (not only those returned). my (%package_types, %package_arches); @@ -681,12 +679,6 @@ sub getpackages { %package_arches=(); $type="" if ! defined $type; - - # Look up the build arch if we need to. - my $buildarch=''; - if ($type eq 'same') { - $buildarch=buildarch(); - } my $package=""; my $arch=""; @@ -721,10 +713,12 @@ sub getpackages { $package_types{$package}=$package_type; $package_arches{$package}=$arch; } + if ($package && (($type eq 'indep' && $arch eq 'all') || - ($type eq 'arch' && $arch ne 'all') || - ($type eq 'same' && ($arch eq 'any' || samearch($buildarch, $arch))) || + ($type eq 'arch' && ($arch eq 'any' || + ($arch ne 'all' && + samearch(buildarch(), $arch)))) || ! $type)) { push @list, $package; $package="";