summaryrefslogtreecommitdiff
path: root/expanddeps
diff options
context:
space:
mode:
authorLudwig Nussel <ludwig.nussel@suse.de>2010-08-03 16:28:54 +0200
committerLudwig Nussel <ludwig.nussel@suse.de>2010-09-20 14:15:06 +0200
commitd5a0effe3be01ef40125d98b12b4eade530db745 (patch)
treeab55fb73f54b9ac33a801cce0c41011524311f16 /expanddeps
parent98cfe31349929dac32a7b94330476da91531502d (diff)
downloadobs-build-d5a0effe3be01ef40125d98b12b4eade530db745.tar.gz
obs-build-d5a0effe3be01ef40125d98b12b4eade530db745.tar.bz2
obs-build-d5a0effe3be01ef40125d98b12b4eade530db745.zip
introduce dist_canon() in Build.pm
Diffstat (limited to 'expanddeps')
-rwxr-xr-xexpanddeps29
1 files changed, 2 insertions, 27 deletions
diff --git a/expanddeps b/expanddeps
index 5225039..f2929c1 100755
--- a/expanddeps
+++ b/expanddeps
@@ -101,6 +101,7 @@ for my $arch (@archs) {
$packs{$_} ||= "$_.$arch" for @{$packs_arch{$arch} || []};
}
+# XXX: move to separate tool
if (!defined($dist) || $dist eq '') {
my $rpmarch = (grep {$fn{"rpm.$_"}} @archs)[0];
if (!$rpmarch) {
@@ -117,33 +118,7 @@ if (!defined($dist) || $dist eq '') {
my %res = Build::Rpm::rpmq($rpmfn, 1010);
$rpmdist = $res{1010}->[0] || '';
}
- $rpmdist = lc($rpmdist);
- $rpmdist =~ s/-/_/g;
- $rpmdist =~ s/opensuse/suse linux/;
- my $rpmdista;
- if ($rpmdist =~ /\(/) {
- $rpmdista = $rpmdist;
- $rpmdista =~ s/.*\(//;
- $rpmdista =~ s/\).*//;
- } else {
- $rpmdista = $archs[0];
- }
- $rpmdista =~ s/i[456]86/i386/;
- $rpmdist = '' unless $rpmdista =~ /^(i386|x86_64|ia64|ppc|ppc64|s390|s390x)$/;
- if ($rpmdist =~ /unitedlinux 1\.0.*/) {
- $dist = "ul1-$rpmdista";
- } elsif ($rpmdist =~ /suse sles_(\d+)/) {
- $dist = "sles$1-$rpmdista";
- } elsif ($rpmdist =~ /suse linux enterprise (\d+)/) {
- $dist = "sles$1-$rpmdista";
- } elsif ($rpmdist =~ /suse linux (\d+)\.(\d+)\.[4-9]\d/) {
- # alpha version
- $dist = "$1.".($2 + 1)."-$rpmdista";
- } elsif ($rpmdist =~ /suse linux (\d+\.\d+)/) {
- $dist = "$1-$rpmdista";
- } else {
- $dist = 'default';
- }
+ $dist = Build::dist_canon($rpmdist, $archs[0]);
}
print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n";
}