From 6de0ff3b3f1739639690884c5b03519b81dcfce7 Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Tue, 22 May 2001 13:36:17 +0000 Subject: added arch support. --- rpmtools.pm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'rpmtools.pm') diff --git a/rpmtools.pm b/rpmtools.pm index 2e70cc4..b708616 100644 --- a/rpmtools.pm +++ b/rpmtools.pm @@ -1,7 +1,7 @@ package rpmtools; use strict; -use vars qw($VERSION @ISA); +use vars qw($VERSION @ISA %compat_arch); require DynaLoader; @@ -76,6 +76,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. =cut +%compat_arch = ( #- compatibilty arch mapping. + 'noarch' => undef, + 'i386' => 'noarch', + 'i486' => 'i386', + 'i586' => 'i486', + 'i686' => 'i586', + 'i786' => 'i686', + 'k6' => 'i586', + 'k7' => 'k6', + 'k8' => 'k7', + 'ppc' => 'noarch', + 'alpha' => 'noarch', + 'sparc' => 'noarch', + 'sparc32' => 'sparc', + 'sparc64' => 'sparc32', + ); + #- build an empty params struct that can be used to compute dependancies. sub new { my ($class, @tags) = @_; @@ -531,6 +548,14 @@ sub write_compss { 1; } +#- compare architecture. +sub better_arch { + my ($new, $old) = @_; + while ($new && $new ne $old) { $new = $compat_arch{$new} } + $new; +} +sub compat_arch { better_arch(arch(), $_[0]) } + #- compare a version string, make sure no deadlock can occur. #- try to return always a numerical value. sub version_compare { -- cgit v1.2.1