--- builds_bin/update_repos 2014/10/10 15:46:43 1.77 +++ builds_bin/update_repos 2014/10/11 16:43:16 1.78 @@ -129,12 +129,17 @@ foreach my $ver ( sort { $a <=> $b } key %sources = (); %base = (); + @{$distrepo->{$ver}->{all_archs}} = ('noarch', @{$distrepo->{$ver}->{archs}}); + if ( grep $_ eq 'i386', @{$distrepo->{$ver}->{archs}} ) { + push @{$distrepo->{$ver}->{all_archs}}, ('i586', 'i686'); + } + foreach my $dir ( sort { $repos->{$baserepo->{$b}}->{prio} <=> $repos->{$baserepo->{$a}}->{prio} || $a cmp $b } keys %$baserepo ) { my $bdir = $dir; $bdir =~ s/~S/$distrepo->{$ver}->{repo}/; $bdir =~ s/~s/$ver/; $bdir =~ s/~C/$distrepo->{$ver}->{centos}/; - for my $arch ( @{$distrepo->{$ver}->{'archs'}}, 'SRPMS/' ) { + for my $arch ( @{$distrepo->{$ver}->{archs}}, 'SRPMS/' ) { my $adir = $bdir; if ( $arch eq 'SRPMS/' ) { $adir =~ s/~A.*//; @@ -162,8 +167,8 @@ foreach my $ver ( sort { $a <=> $b } key last unless $dir =~ m{~A}; } } - find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; - find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; + find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{builds}}; + find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{community} ) if $distrepo->{$ver}->{community}; foreach my $base ( sort keys %$rpms ) { next unless $rpms->{$base}->{rpms}; @@ -295,8 +300,7 @@ foreach my $ver ( sort { $a <=> $b } key } } elsif ( $repos->{$cmp->{repo}}->{stage} ) { $cmp->{delete}++; - } elsif ( $cmp->{src} || ( $cmp->{rpm}->arch =~ m{^(i[356]86)$} && grep $_ eq 'i386', @{$distrepo->{$ver}->{'archs'}} ) || - grep $_ eq $cmp->{rpm}->arch, @{$distrepo->{$ver}->{'archs'}} ) { + } elsif ( $cmp->{src} || grep $_ eq $cmp->{rpm}->arch, @{$distrepo->{$ver}->{all_archs}} ) { $srpm = $cmp if ! $srpm && $cmp->{src}; my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; $dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); @@ -390,7 +394,7 @@ foreach my $ver ( sort { $a <=> $b } key foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { if ( $a eq 'noarch' ) { my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; - if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{'archs'}} ) { + if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{archs}} ) { $p2->{oldrepo} = $p2->{repo}; push @{$p2->{repos}}, $p2->{repo}; } @@ -448,7 +452,7 @@ foreach my $ver ( sort { $a <=> $b } key if ( $pkg->{src} ) { push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); } elsif ( $pkg->{rpm}->arch eq 'noarch' ) { - push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}}; + push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{archs}}; } elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); } else { @@ -492,7 +496,7 @@ foreach my $ver ( sort { $a <=> $b } key } foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; - foreach my $arch ( @{$distrepo->{$ver}->{'archs'}} ) { + foreach my $arch ( @{$distrepo->{$ver}->{archs}} ) { my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; $dir = qx(readlink -f $dir); if ( $dir ) {