--- builds_bin/update_repos 2014/10/10 15:46:43 1.77 +++ builds_bin/update_repos 2016/03/05 16:35:21 1.81 @@ -129,6 +129,11 @@ 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}/; @@ -157,8 +162,16 @@ foreach my $ver ( sort { $a <=> $b } key } next unless -d $adir; opendir DIR, $adir or next; - process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; + my @txt = grep { /\.rpm$/ && -f "$adir/$_" } readdir DIR; closedir DIR; + if (scalar(@txt)) { + opendir DIR, $adir or next; + process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; + closedir DIR; + } elsif ($baserepo->{$dir} eq 'epel') { + # EPEL 7 uses a structure with subfolders of first letter of package + find( { wanted => sub { process_rpm($_, $ver, $baserepo->{$dir}) if ($_ =~ m/\.rpm$/);}, no_chdir => 1, follow_fast => 1 }, $adir ); + } last unless $dir =~ m{~A}; } } @@ -295,8 +308,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}); @@ -449,6 +461,9 @@ foreach my $ver ( sort { $a <=> $b } key 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'}}; + } elsif ($ver>=10 && $pkg->{rpm}->arch =~ m{^(i[356]86)$} && $pkg->{arch} =~ m{^(x86_64)$} ) { + #add copy of i686 packages in x86_64 folder for SME>=10 + 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 { @@ -523,11 +538,11 @@ foreach my $ver ( sort { $a <=> $b } key } } unless ( $opts{t} ) { - foreach (@{$distrepo->{$ver}->{builds}}) + foreach (@{$distrepo->{$ver}->{'builds'}}) { finddepth(sub{rmdir}, "$_") if -d "$_"; } - finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; + finddepth(sub{rmdir}, $distrepo->{$ver}->{'community'}) if -d "$distrepo->{$ver}->{'community'}"; } }