aboutsummaryrefslogtreecommitdiffstats
path: root/genplatform.in
blob: fc6bf82f781a846c45690f7b89bb5ec255ffb14c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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";
    }
}