3 |
use strict; |
use strict; |
4 |
use warnings; |
use warnings; |
5 |
use RPM2; |
use RPM2; |
6 |
|
use File::Find; |
7 |
|
use File::Basename; |
8 |
|
use Getopt::Std; |
9 |
use Data::Dumper; |
use Data::Dumper; |
10 |
|
|
11 |
sub compare($$); |
delete $ENV{PATH}; |
12 |
|
my $HOME=$ENV{HOME}; |
13 |
my $releases = 2; |
umask 002; |
14 |
|
$| = 1; |
15 |
my $releasedir = '/releases'; |
|
16 |
my $smerel = '7'; |
my %opts; |
17 |
my $centosrel = '4'; |
getopts( 'osqtr:', \%opts ); |
18 |
my $fedorarel = '3'; |
$opts{r} ||= ''; |
19 |
my $builds = '/builds/rpms'; |
|
20 |
my $stagedir = '/builds'; |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
21 |
my $arch = `uname -i`; |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
22 |
chomp $arch; |
|
23 |
|
my $osdir = 'SME'; |
24 |
my @repos = ( |
my $disttag = 'sme'; |
25 |
"$releasedir/$smerel/smeos/$arch/CentOS/RPMS", |
my $repotag = 'sme'; |
26 |
"$releasedir/$smerel/smeos/$arch/SME/RPMS", |
|
27 |
"$releasedir/$smerel/smeos/$arch/RPMS", |
my @archs = ( 'i386', 'x86_64' ); |
28 |
"$releasedir/$smerel/smeos/$arch/SME", |
|
29 |
"$releasedir/$smerel/smeupdates/$arch/RPMS", |
my $distrepo = { '7' => { active => 1, |
30 |
"$releasedir/$smerel/smeupdates-testing/$arch/RPMS", |
centos => 4, |
31 |
"$releasedir/$smerel/smeextras/$arch/RPMS", |
repo => '/releases/7/', |
32 |
"$releasedir/$smerel/smeaddons/$arch/RPMS", |
os => 'RPMS/', |
33 |
"$releasedir/$smerel/smecontribs/$arch/RPMS", |
builds => '/builds/smeserver-7-core/', |
34 |
"$releasedir/$smerel/smetest/$arch/RPMS", |
community => '/builds/smeserver-7-contribs/', |
35 |
"$releasedir/$smerel/smedev/$arch/RPMS", |
stage => '/stage/7/', |
36 |
"$builds/RPMS/$arch", |
}, |
37 |
"$builds/RPMS/i586", |
'8' => { active => 1, |
38 |
"$builds/RPMS/i686", |
centos => 5, |
39 |
"$builds/RPMS/noarch", |
repo => '/releases/testing/8/', |
40 |
"$stagedir/RPMS", |
os => '', |
41 |
); |
builds => '/builds/smeserver-8-core/', |
42 |
|
community => '/builds/smeserver-8-contribs/', |
43 |
my @srcrepos = ( |
stage => '/stage/8/', |
44 |
"/mirrors/centos/$centosrel/fasttrack/SRPMS", |
}, |
45 |
"/mirrors/centos/$centosrel/updates/SRPMS", |
}; |
46 |
"/mirrors/centos/$centosrel/os/SRPMS", |
|
47 |
"/mirrors/centos/$centosrel/extras/SRPMS", |
my $repos = { "${repotag}os" => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
48 |
"/mirrors/rpmforge/dag/source", |
"${repotag}updates" => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
49 |
"/mirrors/atrpms/src/el$centosrel-$arch/atrpms/stable", |
"${repotag}updates-testing" => { prio => 16, inc => 1, ver => 1, rel => 3 }, |
50 |
"/mirrors/atrpms/src/el$centosrel-$arch/atrpms/testing", |
"${repotag}extras" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
51 |
"/mirrors/fedora/epel/$centosrel/SRPMS", |
"${repotag}addons" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
52 |
"/mirrors/fedora/core/updates/$fedorarel/SRPMS", |
"${repotag}contribs" => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
53 |
"/mirrors/fedora/core/$fedorarel/source/SRPMS", |
"${repotag}test" => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
54 |
"/mirrors/fedora/extras/$fedorarel/SRPMS", |
"${repotag}dev" => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
55 |
"$builds/SRPMS", |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
56 |
); |
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
57 |
|
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
58 |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_nodsa; |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
59 |
|
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
60 |
my @rpms; |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
61 |
my %srpms; |
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
62 |
my %sources; |
}; |
63 |
my %changed; |
|
64 |
my %copy; |
my $baserepo = { "~S${repotag}os/~A/$osdir/~O" => "${repotag}os", |
65 |
|
"~S${repotag}updates/~A/RPMS/" => "${repotag}updates", |
66 |
foreach my $repo ( @repos ) { |
"~S${repotag}updates-testing/~A/RPMS/" => "${repotag}updates-testing", |
67 |
my $r = $repo; |
"~S${repotag}extras/~A/RPMS/" => "${repotag}extras", |
68 |
if ( $repo =~ m{$stagedir/RPMS} ) { |
"~S${repotag}addons/~A/RPMS/" => "${repotag}addons", |
69 |
$r = $stagedir; |
"~S${repotag}contribs/~A/RPMS/" => "${repotag}contribs", |
70 |
} elsif ( $repo =~ m{$builds/RPMS} ) { |
"~S${repotag}test/~A/RPMS/" => "${repotag}test", |
71 |
$r = 'builds'; |
"~S${repotag}dev/~A/RPMS/" => "${repotag}dev", |
72 |
} elsif ( $repo =~ m{^($releasedir/$smerel/sme[^/]*)/} ) { |
"/stage/~s/~A/$osdir/~O" => 'stage', |
73 |
$r = $1; |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
74 |
} |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
75 |
|
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
76 |
if ( $r ne 'builds' ) { |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
77 |
opendir SRPMS, "$r/SRPMS" or next; |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
78 |
foreach my $srpm ( grep { /\.rpm$/ } readdir SRPMS ) { |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
79 |
$srpms{$r}{$srpm} = 0; |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
80 |
$sources{$srpm} = "$r/SRPMS"; |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
81 |
} |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
82 |
closedir SRPMS; |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
83 |
} |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
84 |
|
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
85 |
opendir RPMS, $repo or next; |
}; |
86 |
foreach my $pkg ( reverse sort map { RPM2->open_package("$repo/$_", $rpm_flags); } grep { /\.rpm$/ } readdir RPMS ) { |
|
87 |
my $rpm = { name => $pkg->tag("NAME"), |
if ( $opts{q} ) { |
88 |
filename => join("-", map { $pkg->tag($_) } qw/name version release/) . "." . $pkg->tag("ARCH"), |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
89 |
version => $pkg->tag("VERSION"), |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
90 |
release => $pkg->tag("RELEASE"), |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
91 |
repo => $r, |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
92 |
rpm => $pkg, |
} |
93 |
}; |
|
94 |
my $source = $pkg->tag("SOURCERPM"); |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
95 |
$source =~ s#-$rpm->{version}-$rpm->{release}.*##; |
'epel' => { map { $_ => 1 } ( 'clamav', 'fping', 'ocsinventory', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-DateTime', 'perl-Razor-Agent', 'perl-Text-Iconv', 'proftpd' ) }, |
96 |
$rpm->{source} = $source; |
'rpmforge' => { map { $_ => 1 } ( 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
97 |
|
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
98 |
if ( $rpm->{repo} =~ m{^$releasedir/$smerel/} && $rpm->{repo} !~ m{/smedev$} ) { |
}, |
99 |
$rpm->{repo} = 'deleted' if grep { $_->{repo} ne $rpm->{repo} && $_->{name} eq $rpm->{name} && $_->{rpm} ge $rpm->{rpm} } @rpms; |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
100 |
$rpm->{repo} = 'deleted' if grep { $_->{repo} eq $rpm->{repo} && $_->{name} eq $rpm->{name} && $_->{rpm} gt $rpm->{rpm} } @rpms; |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
101 |
$changed{$r}++ if $rpm->{repo} eq 'deleted'; |
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', 'libtalloc', 'libtdb', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'proftpd', 'smolt' ) }, |
102 |
} |
'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
103 |
|
}, |
104 |
push @rpms, $rpm; |
}; |
105 |
|
|
106 |
|
my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos; |
107 |
|
my ($devel1, $devel2) = sort { $repos->{$a}->{devel} <=> $repos->{$b}->{devel} } grep { $repos->{$_}->{devel} } keys %$repos; |
108 |
|
$devel2 ||= $devel1; |
109 |
|
|
110 |
|
my ($rpms, %base, %latest, %sources); |
111 |
|
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
112 |
|
next unless $distrepo->{$ver}->{active}; |
113 |
|
my %repochg = (); |
114 |
|
$rpms = (); |
115 |
|
%latest = (); |
116 |
|
%sources = (); |
117 |
|
%base = (); |
118 |
|
|
119 |
|
foreach my $dir ( sort { $repos->{$baserepo->{$b}}->{prio} <=> $repos->{$baserepo->{$a}}->{prio} || $a cmp $b } keys %$baserepo ) { |
120 |
|
my $bdir = $dir; |
121 |
|
$bdir =~ s/~O/$distrepo->{$ver}->{os}/; |
122 |
|
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
123 |
|
$bdir =~ s/~s/$ver/; |
124 |
|
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
125 |
|
for my $arch ( @archs, 'SRPMS/' ) { |
126 |
|
my $adir = $bdir; |
127 |
|
if ( $arch eq 'SRPMS/' ) { |
128 |
|
$adir =~ s/~A.*/$arch/; |
129 |
|
} else { |
130 |
|
$adir =~ s/~A/$arch/; |
131 |
|
} |
132 |
|
opendir DIR, $adir or next; |
133 |
|
next unless -d $adir; |
134 |
|
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
135 |
|
closedir DIR; |
136 |
|
last unless $dir =~ m{~A}; |
137 |
} |
} |
138 |
closedir RPMS; |
} |
139 |
} |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'builds'} ); |
140 |
|
find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; |
141 |
foreach my $repo ( reverse @srcrepos ) { |
|
142 |
my %temp_repo = map { $_ => $repo } grep { /\.rpm$/ } readdir SRPMS if ( opendir SRPMS, $repo ); |
foreach my $base ( sort keys %$rpms ) { |
143 |
closedir SRPMS; |
next unless $rpms->{$base}->{rpms}; |
144 |
|
my %track = (); |
145 |
%sources = (%sources, %temp_repo); |
my %seen = (); |
146 |
} |
my %counts = (); |
147 |
|
my $acnt = (); |
148 |
|
my $print = 0; |
149 |
|
%latest = (); |
150 |
|
|
151 |
|
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
152 |
|
next if $pkg->{done}; |
153 |
|
|
154 |
|
my $tmp = $pkg->{svr}; |
155 |
|
SRC: { |
156 |
|
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
157 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
158 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
159 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
160 |
|
($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
161 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
162 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
163 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
164 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
165 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
166 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
167 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
168 |
|
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
169 |
|
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
170 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
171 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
172 |
|
} |
173 |
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
174 |
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
175 |
|
$tmp->{svr} = $pkg->{svr}; |
176 |
|
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
177 |
|
$tmp->{added}++; |
178 |
|
} |
179 |
|
} |
180 |
|
|
181 |
my @latest; |
my %orig = (); |
182 |
foreach my $rpm ( reverse grep { $_->{repo} =~ m{^$releasedir/$smerel/} && $_->{repo} !~ m{/sme(addons|contribs|dev|extras)$} } @rpms ) { |
my %pkgs = (); |
183 |
unless ( grep { $_->{name} eq $rpm->{name} && $_->{rpm} gt $rpm->{rpm} } @latest ) { |
my %reposrc = (); |
184 |
push @latest, $rpm; |
my $srpm = undef; |
185 |
unless ( grep { $_->{repo} eq $stagedir && $_->{filename} eq $rpm->{filename} } @rpms ) { |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
186 |
push @{$copy{"$stagedir/RPMS"}}, $rpm->{rpm}->filename; |
next unless $cmp->{svr} eq $pkg->{svr}; |
187 |
push @rpms, { name => $rpm->{name}, |
|
188 |
filename => $rpm->{filename}, |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
189 |
version => $rpm->{version}, |
if ( $cmp->{src} ) { |
190 |
release => $rpm->{release}, |
if ( ! $track{repo} ) { |
191 |
repo => $stagedir, |
$cmp->{delete}++; |
192 |
rpm => $rpm->{rpm}, |
$cmp->{done}++; |
193 |
source => $rpm->{source} |
next; |
194 |
}; |
} |
195 |
|
} else { |
196 |
|
$track{repo} = $cmp->{repo}; |
197 |
|
$track{svr} = $cmp->{svr}; |
198 |
|
} |
199 |
|
} |
200 |
|
if ( $cmp->{svr} eq $track{svr} ) { |
201 |
|
if ( $seen{$cmp->{nvra}} ) { |
202 |
|
if ( $track{repo} ne $cmp->{repo} ) { |
203 |
|
if ($repos->{$cmp->{repo}}->{stage} ) { |
204 |
|
if ( $seen{$cmp->{nvra}}->{latest} ) { |
205 |
|
$seen{$cmp->{nvra}}->{latest}++; |
206 |
|
} else { |
207 |
|
$cmp->{delete}++; |
208 |
|
} |
209 |
|
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
210 |
|
$orig{$cmp->{nvra}}++; |
211 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
212 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
213 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
214 |
|
} |
215 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
216 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
217 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
218 |
|
$cmp->{delete}++; |
219 |
|
} |
220 |
|
} |
221 |
|
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
222 |
|
$cmp->{delete}++; |
223 |
|
} else { |
224 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
225 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
226 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
227 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
228 |
|
if ( $cmp->{repo} ne $dest ) { |
229 |
|
push @{$cmp->{repos}}, $dest; |
230 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
231 |
|
$orig{$cmp->{nvra}}++; |
232 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
233 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
234 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
235 |
|
} |
236 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
237 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
238 |
|
} else { |
239 |
|
$cmp->{delete}++; |
240 |
|
} |
241 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
242 |
|
$cmp->{repo} = $dest; |
243 |
|
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
244 |
|
$track{repo} = $dest; |
245 |
|
$track{svr} = $cmp->{svr}; |
246 |
|
} |
247 |
|
} |
248 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
249 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
250 |
|
} |
251 |
|
} |
252 |
|
} else { |
253 |
|
if ( $track{repo} eq $cmp->{repo} ) { |
254 |
|
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
255 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
256 |
|
} elsif ( $cmp->{src} ) { |
257 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
258 |
|
} else { |
259 |
|
$track{svr} = $cmp->{svr}; |
260 |
|
} |
261 |
|
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
262 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
263 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
264 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
265 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
266 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
267 |
|
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
268 |
|
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
269 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
270 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
271 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
272 |
|
} |
273 |
|
push @{$cmp->{repos}}, $dest; |
274 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
275 |
|
$cmp->{repo} = $dest; |
276 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
277 |
|
$orig{$cmp->{nvra}}++; |
278 |
|
} |
279 |
|
} |
280 |
|
} else { |
281 |
|
$cmp->{delete}++; |
282 |
|
} |
283 |
|
} |
284 |
|
} |
285 |
|
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
286 |
|
$pkgs{$cmp->{nvra}}++; |
287 |
|
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
288 |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
289 |
|
unless ( $seen{$cmp->{nvra}} ) { |
290 |
|
$seen{$cmp->{nvra}} = $cmp; |
291 |
|
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
292 |
|
} |
293 |
|
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
294 |
|
} |
295 |
|
$cmp->{done}++; |
296 |
|
} |
297 |
|
if ( $srpm ) { |
298 |
|
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
299 |
|
unless ( $reposrc{$r}->{srpm} ) { |
300 |
|
unshift @{$srpm->{repos}}, $r; |
301 |
|
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
302 |
|
$srpm->{repo} = $r; |
303 |
|
$reposrc{$r}->{srpm} = $srpm; |
304 |
|
} |
305 |
} |
} |
306 |
|
} elsif ( scalar keys %pkgs && $opts{s} ) { |
307 |
|
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
308 |
|
} |
309 |
|
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
310 |
} |
} |
|
} |
|
|
|
|
|
foreach my $rpm ( grep { $_->{repo} eq $stagedir } @rpms ) { |
|
|
$rpm->{repo} = 'deleted' unless grep { $_->{filename} eq $rpm->{filename} } @latest; |
|
|
} |
|
311 |
|
|
312 |
foreach my $rpm ( reverse grep { $_->{repo} =~ m{^$releasedir/$smerel/} && $_->{repo} =~ m{/sme(addons|contribs|extras)$} } @rpms ) { |
foreach my $r ( keys %$acnt ) { |
313 |
unless ( grep { $_->{name} eq $rpm->{name} && $_->{rpm} gt $rpm->{rpm} } @latest ) { |
foreach my $p ( keys %{$acnt->{$r}} ) { |
314 |
push @latest, $rpm; |
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
315 |
|
if ( $a eq 'noarch' ) { |
316 |
|
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
317 |
|
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @archs ) { |
318 |
|
$p2->{oldrepo} = $p2->{repo}; |
319 |
|
push @{$p2->{repos}}, $p2->{repo}; |
320 |
|
} |
321 |
|
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
322 |
|
print "\n * many packages ($r, $a, $p)\n"; |
323 |
|
} |
324 |
|
} |
325 |
|
} |
326 |
} |
} |
|
} |
|
327 |
|
|
328 |
my @devel; |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
329 |
my %versions; |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
330 |
foreach my $rpm ( grep { $_->{repo} eq 'builds' } @rpms ) { |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
331 |
next if grep { $_->{name} eq $rpm->{name} && $_->{rpm} ge $rpm->{rpm} } @latest; |
$pkg->{repo} = $stage; |
332 |
|
push @{$pkg->{repos}}, $stage; |
333 |
$versions{$rpm->{name}}{$rpm->{version}}++ unless grep { $_->{name} eq $rpm->{name} && $_->{rpm} eq $rpm->{rpm} } @devel; |
} |
334 |
next if $versions{$rpm->{name}}{$rpm->{version}} > $releases || scalar keys %{$versions{$rpm->{name}}} > $releases; |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
335 |
print "Possible update " . $rpm->{rpm}->filename . "\n" if grep { $_->{name} eq $rpm->{name} } @latest; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
336 |
|
$print++; |
337 |
push @devel, $rpm; |
} |
338 |
unless ( grep { $_->{repo} =~ m{/smedev$} && $_->{filename} eq $rpm->{filename} } @rpms ) { |
|
339 |
push @{$copy{"$releasedir/$smerel/smedev/$arch/RPMS"}}, $rpm->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
340 |
$changed{"$releasedir/$smerel/smedev"}++; |
if ( $pkg->{nosig} ) { |
341 |
push @rpms, { name => $rpm->{name}, |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
342 |
filename => $rpm->{filename}, |
unless ( $opts{t} ) { |
343 |
version => $rpm->{version}, |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
344 |
release => $rpm->{release}, |
if ($?) { |
345 |
repo => "$releasedir/$smerel/smedev", |
print " * failed to sign package\n"; |
346 |
rpm => $rpm->{rpm}, |
next; |
347 |
source => $rpm->{source} |
} |
348 |
}; |
} |
349 |
} |
} |
|
} |
|
350 |
|
|
351 |
foreach my $rpm ( grep { $_->{repo} =~ m{/smedev$} } @rpms ) { |
if ( $pkg->{repos} ) { |
352 |
$rpm->{repo} = 'deleted' unless grep { $_->{filename} eq $rpm->{filename} } @devel; |
foreach my $repo ( @{$pkg->{repos}} ) { |
353 |
} |
if ( $pkg->{delete} ) { |
354 |
|
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
355 |
|
$pkg->{delete} = 0; |
356 |
|
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
357 |
|
} elsif ( $pkg->{oldrepo} eq $repo ) { |
358 |
|
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
359 |
|
} else { |
360 |
|
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
361 |
|
} |
362 |
|
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
363 |
|
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
364 |
|
|
365 |
|
my @d = (); |
366 |
|
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
367 |
|
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
368 |
|
my $tail = $repos->{$repo}->{os} ? "$osdir/" . $distrepo->{$ver}->{os} : 'RPMS/'; |
369 |
|
if ( $pkg->{src} ) { |
370 |
|
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
371 |
|
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
372 |
|
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @archs; |
373 |
|
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
374 |
|
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
375 |
|
} else { |
376 |
|
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
377 |
|
} |
378 |
|
foreach my $dest ( @d ) { |
379 |
|
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
380 |
|
} |
381 |
|
|
|
print "\n"; |
|
|
foreach my $rpm ( grep { $_->{repo} !~ m{^(builds|deleted)$} } @rpms ) { |
|
|
my $src; |
|
|
my $srpm = $rpm->{rpm}->tag("SOURCERPM"); |
|
|
|
|
|
my @sources = (); |
|
|
push @sources, ($src = $srpm); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.el\d\.rf\./\.rf\./); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.[0-3]\.el\d+\.rf\./\.rf\./); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.(el|fc)\d\.at//); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.at//); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.(el|fc)\d//); |
|
|
push @sources, $src if (($src = $srpm) =~ s/\.\d+\.(el|fc)\d//); |
|
|
|
|
|
my $found = 0; |
|
|
my $repo = $rpm->{repo}; |
|
|
foreach my $source ( @sources ) { |
|
|
if ( $sources{$source} ) { |
|
|
unless ( -f "$repo/SRPMS/$source" ) { |
|
|
push @{$copy{"$repo/SRPMS"}}, "$sources{$source}/$source"; |
|
|
$changed{$repo}++ unless $repo eq $stagedir; |
|
|
} |
|
|
$srpms{$repo}{$source}++; |
|
|
$found++; |
|
|
last; |
|
382 |
} |
} |
383 |
|
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
384 |
|
} elsif ( $pkg->{delete} ) { |
385 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
386 |
|
qx(rm -f $src) unless $opts{t}; |
387 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
388 |
|
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
389 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
390 |
|
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
391 |
|
} |
392 |
|
} |
393 |
} |
} |
|
print "Can't find source for ".$rpm->{rpm}->filename."\n" unless $found; |
|
|
} |
|
394 |
|
|
395 |
my @remove; |
if ( $rpms->{$base}->{srpms} ) { |
396 |
foreach my $repo ( keys %srpms ) { |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
397 |
foreach my $rpm ( keys %{$srpms{$repo}} ) { |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
398 |
unless ( $srpms{$repo}{$rpm} ) { |
$pkg->{delete}++; |
399 |
push @remove, "$repo/SRPMS/$rpm"; |
my $src = $pkg->{rpm}->filename; |
400 |
$changed{$repo}++ unless $repo eq $stagedir; |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
401 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
402 |
|
$print++; |
403 |
} |
} |
404 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
405 |
|
qx(rm -f $src) unless $opts{t}; |
406 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
407 |
|
} |
408 |
} |
} |
409 |
} |
} |
410 |
|
|
411 |
print "\n"; |
if ( %repochg ) { |
412 |
foreach my $repo ( sort keys %copy ) { |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
413 |
foreach my $rpm ( keys %{{ map { $_ => 1 } @{$copy{$repo}} }} ) { |
} |
414 |
print "copying $rpm to $repo/\n"; |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
415 |
system(qw(cp --preserve=timestamps), $rpm, "$repo/"); |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
416 |
} |
foreach my $arch ( @archs ) { |
417 |
} |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
418 |
|
$dir = qx(readlink -f $dir); |
419 |
print "\n"; |
chomp $dir; |
420 |
foreach my $rpm ( keys %{{ map { $_ => 1 } (@remove, map { $_->{rpm}->filename } grep { $_->{repo} eq 'deleted' } @rpms) }} ) { |
print "rebuild $repo/$arch\n"; |
421 |
print "removing $rpm\n"; |
unless ( $opts{t} ) { |
422 |
unlink $rpm; |
if ( $dir =~ m{test/|-testing/} ) { |
423 |
|
if ( -f "$dir/repodata/comps.xml" ) { |
424 |
|
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
425 |
|
} else { |
426 |
|
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
427 |
|
} |
428 |
|
} else { |
429 |
|
if ( -f "$dir/repodata/comps.xml" ) { |
430 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
431 |
|
} else { |
432 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
433 |
|
} |
434 |
|
} |
435 |
|
qx(repoview $dir); |
436 |
|
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
437 |
|
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
438 |
|
} |
439 |
|
} |
440 |
|
} |
441 |
|
unless ( $opts{t} ) { |
442 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{builds}) if -d "$distrepo->{$ver}->{builds}"; |
443 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
444 |
|
} |
445 |
|
} |
446 |
|
|
447 |
|
sub verrel { |
448 |
|
my $pkg = shift; |
449 |
|
my $repo = shift; |
450 |
|
my $counts = shift; |
451 |
|
|
452 |
|
return 0 if $pkg->{src}; |
453 |
|
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
454 |
|
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
455 |
|
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
456 |
|
return 0; |
457 |
|
} |
458 |
|
|
459 |
|
sub pkgdest { |
460 |
|
my $pkg = shift; |
461 |
|
my $dest = shift; |
462 |
|
my $hirepo = shift; |
463 |
|
my $pkgs = shift; |
464 |
|
|
465 |
|
foreach my $cmp ( @$pkgs ) { |
466 |
|
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
467 |
|
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
468 |
|
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
469 |
|
$dest = $hirepo; |
470 |
|
last; |
471 |
|
} else { |
472 |
|
$dest = $cmp->{repo}; |
473 |
|
} |
474 |
|
} |
475 |
|
return $dest; |
476 |
} |
} |
477 |
|
|
478 |
print "\n"; |
sub process_rpm { |
479 |
foreach my $repo ( sort keys %changed ) { |
my $rpm = shift; |
480 |
my $dir=`readlink -f $repo/$arch`; |
my $ver = shift; |
481 |
chomp $dir; |
my $repo = shift; |
482 |
print "rebuilding $dir...\n"; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
483 |
system(qw(createrepo), "$dir"); |
my $base = $1; |
484 |
system(qw(repoview), "$dir"); |
return unless ! $opts{r} || $base =~ m[$opts{r}]; |
485 |
|
return unless $latest{$base} || $sources{$base} || ! $repos->{$repo}->{base}; |
486 |
|
|
487 |
|
my $pkg; |
488 |
|
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
489 |
|
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
490 |
|
eval { my $sig = $pkg->siggpg }; |
491 |
|
my $nosig = ! $@; |
492 |
|
|
493 |
|
my $cmp = $latest{$pkg->name}; |
494 |
|
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
495 |
|
return unless $cmp; |
496 |
|
return if $repos->{$cmp->{repo}}->{base} && $repos->{$cmp->{repo}}->{prio} > $repos->{$repo}->{prio} && $pkg ge $cmp->{rpm}; |
497 |
|
} |
498 |
|
my ($src, $version, $release) = ($pkg->is_source_package ? $pkg->filename : $pkg->sourcerpm) =~ m{(?:^|/)([^/]*)-([^-]+)-([^-]+)\.\w+\.rpm$}; |
499 |
|
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
500 |
|
return if $repos->{$repo}->{base} && $nosig; |
501 |
|
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
502 |
|
my $arch = 'unknown'; |
503 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
504 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
505 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
506 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
507 |
|
|
508 |
|
my $rpmhash = { base => $src, |
509 |
|
name => $pkg->name, |
510 |
|
repo => $repo, |
511 |
|
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
512 |
|
svr => $src.'-'.$version.'-'.$release, |
513 |
|
src => $pkg->is_source_package, |
514 |
|
arch => $arch, |
515 |
|
ver => $version, |
516 |
|
rel => $release, |
517 |
|
rpm => $pkg, |
518 |
|
nosig => $nosig, |
519 |
|
}; |
520 |
|
if ( $pkg->is_source_package ) { |
521 |
|
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
522 |
|
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
523 |
|
} else { |
524 |
|
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
525 |
|
} |
526 |
|
$sources{$src}++; |
527 |
|
|
528 |
|
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
529 |
|
if ( ! $repos->{$repo}->{base} ) { |
530 |
|
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
531 |
|
$latest{$pkg->name} = $rpmhash; |
532 |
|
} |
533 |
|
} elsif ( ( $repos->{$repo}->{prio} >= $repos->{$cmp->{repo}}->{prio} || ! $repos->{$cmp->{repo}}->{base} ) && $pkg ge $cmp->{rpm} ) { |
534 |
|
$latest{$pkg->name} = $rpmhash; |
535 |
|
} |
536 |
} |
} |