]> git.donarmstrong.com Git - debhelper.git/blobdiff - Debian/Debhelper/Dh_Lib.pm
refactor
[debhelper.git] / Debian / Debhelper / Dh_Lib.pm
index 28a90f7bdad16b37900c7021d9b055f2d8f6388b..cd87ebe58f5ba1bbf8b58b06695c152ebe3d8c3e 100644 (file)
@@ -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;
        }
 }
@@ -681,12 +680,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="";
@@ -724,7 +717,8 @@ sub getpackages {
                        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 'same' && ($arch eq 'any' ||
+                                            samearch(buildarch(), $arch))) ||
                             ! $type)) {
                                push @list, $package;
                                $package="";