diff options
author | Joey Hess <joey@kitenet.net> | 2010-05-09 11:48:32 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-05-09 11:48:32 -0400 |
commit | ed5e4269ab341fc82029344b0f11cca704058b89 (patch) | |
tree | b2acdd45a51453abc82ee5c6bcaabbd96dbd2cfa | |
parent | e9c97a7a64695b2ccb40f0be8303c542ed3b239b (diff) | |
download | debhelper-ed5e4269ab341fc82029344b0f11cca704058b89.tar.gz |
cleanups
-rw-r--r-- | Debian/Debhelper/Dh_Lib.pm | 34 |
1 files changed, 10 insertions, 24 deletions
diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm index 7c12706a..97c3193b 100644 --- a/Debian/Debhelper/Dh_Lib.pm +++ b/Debian/Debhelper/Dh_Lib.pm @@ -610,13 +610,13 @@ sub excludefile { my %dpkg_arch_output; sub dpkg_architecture_value { my $var = shift; - local $_; - if (!exists($dpkg_arch_output{$var})) { + if (! exists($dpkg_arch_output{$var})) { + local $_; open(PIPE, '-|', 'dpkg-architecture') or error("dpkg-architecture failed"); while (<PIPE>) { - my ($k, $v) = split(/=/); - chomp $v; + chomp; + my ($k, $v) = split(/=/, 2); $dpkg_arch_output{$k} = $v; } close(PIPE); @@ -625,28 +625,14 @@ sub excludefile { } } -# Returns the build architecture. (Memoized) -{ - my $arch; - - sub buildarch { - if (!defined $arch) { - $arch=dpkg_architecture_value('DEB_HOST_ARCH'); - } - return $arch; - } +# Returns the build architecture. +sub buildarch { + dpkg_architecture_value('DEB_HOST_ARCH'); } -# Returns the build OS. (Memoized) -{ - my $os; - - sub buildos { - if (!defined $os) { - $os=dpkg_architecture_value("DEB_HOST_ARCH_OS"); - } - return $os; - } +# Returns the build OS. +sub buildos { + dpkg_architecture_value("DEB_HOST_ARCH_OS"); } # Passed an arch and a list of arches to match against, returns true if matched |