aboutsummaryrefslogtreecommitdiffstats
path: root/rpmtools.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-05-22 13:36:17 +0000
committerFrancois Pons <fpons@mandriva.com>2001-05-22 13:36:17 +0000
commit6de0ff3b3f1739639690884c5b03519b81dcfce7 (patch)
tree1ee96a60ab1285c00612f36600e77f770b5d8431 /rpmtools.pm
parent2dc9f9ce082bb03b63d9007e32b06f544245a217 (diff)
downloadrpmtools-6de0ff3b3f1739639690884c5b03519b81dcfce7.tar
rpmtools-6de0ff3b3f1739639690884c5b03519b81dcfce7.tar.gz
rpmtools-6de0ff3b3f1739639690884c5b03519b81dcfce7.tar.bz2
rpmtools-6de0ff3b3f1739639690884c5b03519b81dcfce7.tar.xz
rpmtools-6de0ff3b3f1739639690884c5b03519b81dcfce7.zip
added arch support.
Diffstat (limited to 'rpmtools.pm')
-rw-r--r--rpmtools.pm27
1 files changed, 26 insertions, 1 deletions
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 {