aboutsummaryrefslogtreecommitdiffstats
path: root/rpmgenplatform.in
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2007-06-25 14:11:22 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2007-06-25 14:11:22 +0000
commit349fca594a40b1b45b95d60f7c7c95dfcae81b22 (patch)
treeb26a362c8cfda12a8b95b9787798ee072c72bce6 /rpmgenplatform.in
parent75b3b40bd369e0fedc72bcf22450675f22105b82 (diff)
downloadrpm-setup-349fca594a40b1b45b95d60f7c7c95dfcae81b22.tar
rpm-setup-349fca594a40b1b45b95d60f7c7c95dfcae81b22.tar.gz
rpm-setup-349fca594a40b1b45b95d60f7c7c95dfcae81b22.tar.bz2
rpm-setup-349fca594a40b1b45b95d60f7c7c95dfcae81b22.tar.xz
rpm-setup-349fca594a40b1b45b95d60f7c7c95dfcae81b22.zip
- rename genplatform to rpmgenplatform
Diffstat (limited to 'rpmgenplatform.in')
-rw-r--r--rpmgenplatform.in27
1 files changed, 27 insertions, 0 deletions
diff --git a/rpmgenplatform.in b/rpmgenplatform.in
new file mode 100644
index 0000000..fc6bf82
--- /dev/null
+++ b/rpmgenplatform.in
@@ -0,0 +1,27 @@
+#!/usr/sbin/perl
+
+# $Id$
+use strict;
+use warnings;
+
+my @ALLARCH=qw{
+ noarch
+ @RPMALLARCH@
+};
+
+my $anysuffix = '-.*-@RPMOS@-gnu';
+my $suffix = '-@RPMCANONVENDOR@-@RPMOS@-gnu';
+my $canonarch = $ARGV[0] || `uname -m`;
+chomp($canonarch);
+
+foreach my $suf ($suffix, $anysuffix) {
+ my $found = 0;
+ my %done = ();
+ foreach my $arch (reverse @ALLARCH) {
+ $arch eq $canonarch and $found = 1;
+ $found or next;
+ $done{$arch} and next;
+ $done{$arch} = 1;
+ print "$arch$suf\n";
+ }
+}