14 |
$| = 1; |
$| = 1; |
15 |
|
|
16 |
my %opts; |
my %opts; |
17 |
getopts( 'osqtr:', \%opts ); |
getopts( 'ostr:', \%opts ); |
18 |
$opts{r} ||= ''; |
$opts{r} ||= ''; |
19 |
|
#available options |
20 |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
#-o = verify we have originals of the packages in repos (not really used anymore) |
21 |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
#-s = verify every package has a source package (so we can rebuild if necessary) |
22 |
|
#-t = test run (don't do anything just print out what would be done) |
23 |
my @archs = ( 'i386', 'x86_64' ); |
#-r {regex} = regex of packages to run the script against |
24 |
|
|
25 |
my $distrepo = { '7' => { active => 1, |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
26 |
centos => 4, |
|
27 |
fedora => 3, |
my $osdir = 'SME'; |
28 |
repo => '/releases/7/', |
my $disttag = 'sme'; |
29 |
os => 'RPMS/', |
my $repotag = 'sme'; |
30 |
builds => '/builds/smeserver-7-core/', |
|
31 |
contribs => '/builds/smeserver-7-contribs/', |
my $distrepo = { '8' => { active => 0, |
32 |
stage => '/stage/7/', |
centos => 5, |
33 |
|
archs => [ 'i386', 'x86_64' ], |
34 |
|
repo => '/build/smeserver/repo/8/', |
35 |
|
builds => ['/build/builds/smeserver-8-core/'], |
36 |
|
community => '/build/builds/smeserver-8-contribs/', |
37 |
|
stage => '/build/smeserver/stage/8/', |
38 |
|
sign => 1, |
39 |
|
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
40 |
|
checksum => 'sha', |
41 |
|
}, |
42 |
|
'9' => { active => 1, |
43 |
|
centos => 6, |
44 |
|
archs => [ 'i386', 'x86_64' ], |
45 |
|
repo => '/build/smeserver/repo/9/', |
46 |
|
builds => ['/build/builds/smeserver-9-core/'], |
47 |
|
community => '/build/builds/smeserver-9-contribs/', |
48 |
|
stage => '/build/smeserver/stage/9/', |
49 |
|
sign => 1, |
50 |
|
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
51 |
|
checksum => 'sha256', |
52 |
|
}, |
53 |
|
'10' => { active => 1, |
54 |
|
centos => 7, |
55 |
|
archs => [ 'x86_64' ], |
56 |
|
repo => '/build/smeserver/repo/testing/10/', |
57 |
|
builds => ['/build/builds/smeserver-10-core/'], |
58 |
|
community => '/build/builds/smeserver-10-contribs/', |
59 |
|
stage => '/build/smeserver/stage/10/', |
60 |
|
sign => 1, |
61 |
|
keyname => 'Koozali SME Server signing key (10) <bugteam@koozali.org>', |
62 |
|
checksum => 'sha256', |
63 |
|
}, |
64 |
|
}; |
65 |
|
|
66 |
|
# list here repo and priority |
67 |
|
# prio: highest priority will hide lowest priority |
68 |
|
# inc: include for iso ? |
69 |
|
# ver: |
70 |
|
# rel: |
71 |
|
# orig: |
72 |
|
# base, os, stage: |
73 |
|
my $repos = { "${repotag}os" => { prio => 29, inc => 1, ver => 1, rel => 1, os => 1 }, |
74 |
|
"${repotag}updates" => { prio => 28, inc => 1, ver => 1, rel => 1 }, |
75 |
|
"${repotag}updates-testing" => { prio => 27, inc => 1, ver => 1, rel => 3 }, |
76 |
|
"${repotag}extras" => { prio => 26, inc => 0, ver => 1, rel => 1 }, |
77 |
|
"${repotag}addons" => { prio => 25, inc => 0, ver => 1, rel => 1 }, |
78 |
|
"${repotag}contribs" => { prio => 24, inc => 0, ver => 1, rel => 1 }, |
79 |
|
"${repotag}test" => { prio => 23, inc => 0, ver => 2, rel => 3, devel => 2 }, |
80 |
|
"${repotag}dev" => { prio => 22, inc => 0, ver => 1, rel => 1, devel => 1 }, |
81 |
|
'centos' => { prio => 21, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
82 |
|
'remisafe' => { prio => 12, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
83 |
|
'remi' => { prio => 11, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
84 |
|
'epel' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
85 |
|
'epeltesting' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
86 |
|
'rpmfusion' => { prio => 8, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
87 |
|
'rpmforge' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
88 |
|
'atrpms' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
89 |
|
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
90 |
|
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
91 |
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
92 |
|
}; |
93 |
|
|
94 |
|
# list here the path on our local mirror to each upstream and our mirrors |
95 |
|
# ~A will be expanded to architecture |
96 |
|
# ~C will be expanded to Centos main version number, i.e. 7 for SME 10. |
97 |
|
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
98 |
|
"~S${repotag}updates/~A/" => "${repotag}updates", |
99 |
|
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
100 |
|
"~S${repotag}extras/~A/" => "${repotag}extras", |
101 |
|
"~S${repotag}addons/~A/" => "${repotag}addons", |
102 |
|
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
103 |
|
"~S${repotag}test/~A/" => "${repotag}test", |
104 |
|
"~S${repotag}dev/~A/" => "${repotag}dev", |
105 |
|
"/build/smeserver/stage/~s/~A/" => 'stage', |
106 |
|
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
107 |
|
'/mirrors/centos/~C/updates/~A/' => 'centos', |
108 |
|
'/mirrors/centos/~C/os/~A/' => 'centos', |
109 |
|
'/mirrors/centos/~C/extras/~A/' => 'centos', |
110 |
|
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
111 |
|
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
112 |
|
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
113 |
|
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
114 |
|
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
115 |
|
'/mirrors/fedora/epel/testing/~C/~A/' => 'epeltesting', |
116 |
|
'/mirrors/remi/enterprise/~C/remi/~A/' => 'remi', |
117 |
|
'/mirrors/remi/SRPMS/' => 'remi', |
118 |
|
'/mirrors/remi/enterprise/~C/safe/~A/' => 'remisafe', |
119 |
|
'/mirrors/rpmfusion/updates/~C/~A/' => 'rpmfusion', |
120 |
|
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
121 |
|
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
122 |
|
'/mirrors/rpmforge/source/' => 'rpmforge', |
123 |
|
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
124 |
|
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
125 |
|
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
126 |
|
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
127 |
|
}; |
128 |
|
|
129 |
|
# add here packages to exclude |
130 |
|
# for each version, if a repo is listed and rpm are listed they will be ignored fromt his repo |
131 |
|
my $skippkg = { '8' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'gnupg' ) }, |
132 |
|
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
133 |
|
'epel' => { map { $_ => 1 } ( 'clamav', 'cppunit', 'fping', 'html2ps', 'horde', 'libtalloc', 'libtdb', 'oidentd', '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', 'smolt' ) }, |
134 |
|
'epeltesting' => { map { $_ => 1 } ( 'clamav', 'cppunit', 'fping', 'html2ps', 'horde', 'libtalloc', 'libtdb', 'oidentd', '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', 'smolt' ) }, |
135 |
|
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin', 'lzo', 'perl-Convert-TNEF', 'perl-Mail-SPF', 'proftpd', 'erlang', 'perl-DateTime-Format-Mail', 'perl-DateTime-Format-W3CDTF', 'perl-Email-Abstract', 'perl-Email-MIME-Attachment-Stripper', 'perl-Email-Reply', 'perl-Font-AFM', 'perl-IPC-Run', 'rkhunter') }, |
136 |
|
}, |
137 |
|
'9' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'perl-Pod-Escapes', 'perl-Pod-Simple','libvorbis' , 'libogg','iksemel' ) }, |
138 |
|
'epel' => { map { $_ => 1 } ( 'clamav', 'oidentd', 'perl-Razor-Agent' ) }, |
139 |
|
'epeltesting' => { map { $_ => 1 } ( 'clamav', 'oidentd', 'perl-Razor-Agent' ) }, |
140 |
|
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin', 'portreserve', 'perl-libwww-perl' , 'lzo', 'perl-BSD-Resource', 'perl-Convert-ASN1', 'perl-DBD-SQLite', 'perl-Devel-StackTrace', 'perl-Digest-SHA1', 'perl-JSON', 'perl-MIME-tools', 'perl-MailTools', 'perl-PPI', 'perl-URI', 'perl-XML-NamespaceSupport', 'perl-XML-Parser', 'perl-XML-SAX-Writer', 'perl-YAML-Syck', 'proftpd', 'syslinux') }, |
141 |
|
}, |
142 |
|
'10' => { |
143 |
|
'centos' => { map { $_ => 1 } ( 'samba' ) }, |
144 |
|
'epel' => { map { $_ => 1 } ( 'clamav') }, |
145 |
|
'epeltesting' => { map { $_ => 1 } ( 'clamav', 'tidy') }, |
146 |
|
}, |
147 |
|
}; |
148 |
|
|
149 |
|
# add here include only conditions |
150 |
|
# for each version if a repo is listed here, only listed rpm will be considered |
151 |
|
my $onlypkg = { '8' => { |
152 |
|
'remi' => { }, |
153 |
|
'remisafe' => { }, |
154 |
}, |
}, |
155 |
'8' => { active => 1, |
'9' => { |
156 |
centos => 5, |
'remi' => { }, |
|
fedora => 6, |
|
|
repo => '/releases/testing/8/', |
|
|
os => '', |
|
|
builds => '/builds/smeserver-8-core/', |
|
|
contribs => '/builds/smeserver-8-contribs/', |
|
|
stage => '/stage/8/', |
|
157 |
}, |
}, |
158 |
}; |
'10' => { |
159 |
|
'remi' => { map { $_ => 1 } ( 'php-pear' )}, |
160 |
my $repos = { 'smeos' => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
}, |
161 |
'smeupdates' => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
}; |
|
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
|
|
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
|
|
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
|
|
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
|
|
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
|
|
'smedev' => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
|
|
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'fedora-extras' => { prio => 8, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'fedora' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
|
|
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
|
|
'contribs' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
|
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
|
}; |
|
|
|
|
|
my $baserepo = { '~Ssmeos/~A/SME/~O' => 'smeos', |
|
|
'~Ssmeupdates/~A/RPMS/' => 'smeupdates', |
|
|
'~Ssmeupdates-testing/~A/RPMS/' => 'smeupdates-testing', |
|
|
'~Ssmeextras/~A/RPMS/' => 'smeextras', |
|
|
'~Ssmeaddons/~A/RPMS/' => 'smeaddons', |
|
|
'~Ssmecontribs/~A/RPMS/' => 'smecontribs', |
|
|
'~Ssmetest/~A/RPMS/' => 'smetest', |
|
|
'~Ssmedev/~A/RPMS/' => 'smedev', |
|
|
'/stage/~s/~A/SME/~O' => 'stage', |
|
|
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
|
|
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
|
|
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
|
|
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
|
|
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
|
|
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
|
|
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
|
|
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
|
|
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
|
|
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
|
|
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
|
|
'/mirrors/fedora/core/~F/~A/os/Fedora/RPMS/' => 'fedora', |
|
|
'/mirrors/fedora/core/updates/~F/~A/' => 'fedora', |
|
|
}; |
|
|
|
|
|
if ( $opts{q} ) { |
|
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
|
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
|
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
|
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
|
|
} |
|
|
|
|
|
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
|
|
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
|
|
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
|
|
}, |
|
|
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
|
|
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
|
|
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent', 'smolt' ) }, |
|
|
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
|
|
}, |
|
|
}; |
|
162 |
|
|
163 |
my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos; |
my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos; |
164 |
my ($devel1, $devel2) = sort { $repos->{$a}->{devel} <=> $repos->{$b}->{devel} } grep { $repos->{$_}->{devel} } keys %$repos; |
my ($devel1, $devel2) = sort { $repos->{$a}->{devel} <=> $repos->{$b}->{devel} } grep { $repos->{$_}->{devel} } keys %$repos; |
165 |
$devel2 ||= $devel1; |
$devel2 ||= $devel1; |
166 |
|
|
167 |
my ($rpms, %base, %latest, %sources); |
my ($rpms, %base, %latest, %sources); |
168 |
foreach my $smever ( sort { $a <=> $b } keys %$distrepo ) { |
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
169 |
next unless $distrepo->{$smever}->{active}; |
next unless $distrepo->{$ver}->{active}; |
170 |
my %repochg = (); |
my %repochg = (); |
171 |
$rpms = (); |
$rpms = (); |
172 |
%latest = (); |
%latest = (); |
173 |
%sources = (); |
%sources = (); |
174 |
%base = (); |
%base = (); |
175 |
|
|
176 |
|
@{$distrepo->{$ver}->{all_archs}} = ('noarch', @{$distrepo->{$ver}->{'archs'}}); |
177 |
|
if ( grep $_ eq 'i386', @{$distrepo->{$ver}->{'archs'}} ) { |
178 |
|
push @{$distrepo->{$ver}->{all_archs}}, ('i586', 'i686'); |
179 |
|
} |
180 |
|
|
181 |
foreach my $dir ( sort { $repos->{$baserepo->{$b}}->{prio} <=> $repos->{$baserepo->{$a}}->{prio} || $a cmp $b } keys %$baserepo ) { |
foreach my $dir ( sort { $repos->{$baserepo->{$b}}->{prio} <=> $repos->{$baserepo->{$a}}->{prio} || $a cmp $b } keys %$baserepo ) { |
182 |
my $bdir = $dir; |
my $bdir = $dir; |
183 |
$bdir =~ s/~O/$distrepo->{$smever}->{os}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
184 |
$bdir =~ s/~S/$distrepo->{$smever}->{repo}/; |
$bdir =~ s/~s/$ver/; |
185 |
$bdir =~ s/~s/$smever/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
186 |
$bdir =~ s/~C/$distrepo->{$smever}->{centos}/; |
for my $arch ( @{$distrepo->{$ver}->{'archs'}}, 'SRPMS/' ) { |
187 |
$bdir =~ s/~F/$distrepo->{$smever}->{fedora}/; |
my $adir = $bdir; |
188 |
for my $arch ( @archs, 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
189 |
my $adir = $bdir; |
$adir =~ s/~A.*//; |
190 |
if ( $arch eq 'SRPMS/' ) { |
if ( -d "${adir}SRPMS" ) { |
191 |
$adir =~ s/~A.*/$arch/ if $arch eq 'SRPMS/'; |
$adir .= "SRPMS/"; |
192 |
} else { |
} elsif ( -d "${adir}Source/SPackages" ) { |
193 |
$adir =~ s/~A/$arch/; |
$adir .= "Source/SPackages/"; |
194 |
} |
} |
195 |
opendir DIR, $adir or next; |
} else { |
196 |
next unless -d $adir; |
$adir =~ s/~A/$arch/; |
197 |
process_rpm("$adir$_", $smever, $baserepo->{$dir}) foreach readdir DIR; |
if ( -d "${adir}RPMS" ) { |
198 |
closedir DIR; |
$adir .= "RPMS/"; |
199 |
last unless $dir =~ m{~A}; |
} elsif ( -d "${adir}Packages" ) { |
200 |
} |
$adir .= "Packages/"; |
201 |
|
} elsif ( -d "${adir}CentOS" ) { |
202 |
|
$adir .= "CentOS/"; |
203 |
|
} elsif ( -d "${adir}$osdir" ) { |
204 |
|
$adir .= "$osdir/"; |
205 |
|
} |
206 |
|
} |
207 |
|
next unless -d $adir; |
208 |
|
opendir DIR, $adir or next; |
209 |
|
my @txt = grep { /\.rpm$/ && -f "$adir/$_" } readdir DIR; |
210 |
|
closedir DIR; |
211 |
|
if (scalar(@txt)) { |
212 |
|
opendir DIR, $adir or next; |
213 |
|
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
214 |
|
closedir DIR; |
215 |
|
} elsif ($baserepo->{$dir} eq 'epel') { |
216 |
|
# EPEL 7 uses a structure with subfolders of first letter of package |
217 |
|
find( { wanted => sub { process_rpm($_, $ver, $baserepo->{$dir}) if ($_ =~ m/\.rpm$/);}, no_chdir => 1, follow_fast => 1 }, $adir ); |
218 |
|
} |
219 |
|
last unless $dir =~ m{~A}; |
220 |
|
} |
221 |
} |
} |
222 |
find( { wanted => sub { process_rpm($_, $smever, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'builds'} ); |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; |
223 |
find( { wanted => sub { process_rpm($_, $smever, 'contribs'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'contribs'} ); |
find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; |
224 |
|
|
225 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
226 |
next unless $rpms->{$base}->{rpms}; |
next unless $rpms->{$base}->{rpms}; |
227 |
my %track = (); |
my %track = (); |
228 |
my %seen = (); |
my %seen = (); |
229 |
my %counts = (); |
my %counts = (); |
230 |
my $acnt = (); |
my $acnt = (); |
231 |
my $print = 0; |
my $print = 0; |
232 |
%latest = (); |
%latest = (); |
233 |
|
|
234 |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
235 |
next if $pkg->{done}; |
next if $pkg->{done}; |
236 |
|
|
237 |
my $tmp = $pkg->{svr}; |
my $tmp = $pkg->{svr}; |
238 |
SRC: { |
# srpm transformations to match up binary and source rpms |
239 |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
SRC: { |
240 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# Try to find the name the binary wants (no changes) |
241 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
242 |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
|
243 |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
244 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
245 |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
246 |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
247 |
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
248 |
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
249 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
250 |
} |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
251 |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
252 |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
253 |
$tmp->{svr} = $pkg->{svr}; |
|
254 |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
# atrpms (remove .at) |
255 |
$tmp->{added}++; |
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
256 |
} |
# atrpms (remove .el4.at) |
257 |
} |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
258 |
|
# atrpms (remove .el4) |
259 |
my %orig = (); |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
260 |
my %pkgs = (); |
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
261 |
my %reposrc = (); |
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
262 |
my $srpm = undef; |
|
263 |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
264 |
next unless $cmp->{svr} eq $pkg->{svr}; |
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
265 |
|
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
266 |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
267 |
if ( $cmp->{src} ) { |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
268 |
if ( ! $track{repo} ) { |
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
269 |
$cmp->{delete}++; |
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
270 |
$cmp->{done}++; |
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
271 |
next; |
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
272 |
} |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
273 |
} else { |
} |
274 |
$track{repo} = $cmp->{repo}; |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
275 |
$track{svr} = $cmp->{svr}; |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
276 |
} |
$tmp->{svr} = $pkg->{svr}; |
277 |
} |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
278 |
if ( $cmp->{svr} eq $track{svr} ) { |
$tmp->{added}++; |
279 |
if ( $seen{$cmp->{nvra}} ) { |
} |
280 |
if ( $track{repo} ne $cmp->{repo} ) { |
} |
281 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
|
282 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
my %orig = (); |
283 |
$seen{$cmp->{nvra}}->{latest}++; |
my %pkgs = (); |
284 |
} else { |
my %reposrc = (); |
285 |
$cmp->{delete}++; |
my $srpm = undef; |
286 |
} |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
287 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
next unless $cmp->{svr} eq $pkg->{svr}; |
288 |
$orig{$cmp->{nvra}}++; |
|
289 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
290 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
if ( $cmp->{src} ) { |
291 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
if ( ! $track{repo} ) { |
292 |
$cmp->{delete}++; |
$cmp->{delete}++; |
293 |
} |
$cmp->{done}++; |
294 |
} |
next; |
295 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} |
296 |
$cmp->{delete}++; |
} else { |
297 |
} else { |
$track{repo} = $cmp->{repo}; |
298 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$track{svr} = $cmp->{svr}; |
299 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
} |
300 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
} |
301 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
if ( $cmp->{svr} eq $track{svr} ) { |
302 |
if ( $cmp->{repo} ne $dest ) { |
if ( $seen{$cmp->{nvra}} ) { |
303 |
push @{$cmp->{repos}}, $dest; |
if ( $track{repo} ne $cmp->{repo} ) { |
304 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
305 |
$orig{$cmp->{nvra}}++; |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
306 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
$seen{$cmp->{nvra}}->{latest}++; |
307 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
delete $cmp->{delete} if $cmp->{delete}; |
308 |
} else { |
} else { |
309 |
$cmp->{delete}++; |
$cmp->{delete}++; |
310 |
} |
} |
311 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
312 |
$cmp->{repo} = $dest; |
$orig{$cmp->{nvra}}++; |
313 |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
314 |
$track{repo} = $dest; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
315 |
$track{svr} = $cmp->{svr}; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
316 |
} |
} |
317 |
} |
} elsif ( $cmp->{src} ) { |
318 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
319 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$cmp->{repo} = $cmp->{oldrepo}; |
320 |
} |
delete $cmp->{delete}; |
321 |
} |
} |
322 |
} else { |
if ( $reposrc{$cmp->{repo}} ) { |
323 |
if ( $track{repo} eq $cmp->{repo} ) { |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
324 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
$srpm = $cmp if ! $srpm; |
325 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
326 |
} elsif ( $cmp->{src} ) { |
$cmp->{delete}++; |
327 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
} |
328 |
} else { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
329 |
$track{svr} = $cmp->{svr}; |
$cmp->{delete}++; |
330 |
} |
} |
331 |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
} elsif ( $cmp->{src} ) { |
332 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
333 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
334 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
335 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
]; |
336 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
|
337 |
if ( $cmp->{src} && ! $reposrc{$dest} ) { |
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
338 |
$cmp->{delete}++; |
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
339 |
} elsif ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
340 |
push @{$cmp->{repos}}, $dest; |
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
341 |
$orig{$cmp->{nvra}}++; |
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
342 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
343 |
$cmp->{repo} = $dest; |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
344 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
} else { |
345 |
} else { |
warn "How did I get here??"; |
346 |
$cmp->{delete}++; |
} |
347 |
} |
} else { |
348 |
} else { |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
349 |
$cmp->{delete}++; |
} |
350 |
} |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
351 |
} |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
352 |
} |
} |
353 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
354 |
$pkgs{$cmp->{nvra}}++; |
$cmp->{delete}++; |
355 |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
} elsif ( $cmp->{src} || grep $_ eq $cmp->{rpm}->arch, @{$distrepo->{$ver}->{all_archs}} ) { |
356 |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
357 |
unless ( $seen{$cmp->{nvra}} ) { |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
358 |
$seen{$cmp->{nvra}} = $cmp; |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
359 |
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
360 |
} |
if ( $cmp->{repo} ne $dest ) { |
361 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
push @{$cmp->{repos}}, $dest; |
362 |
} |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
363 |
$cmp->{done}++; |
$orig{$cmp->{nvra}}++; |
364 |
} |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
365 |
if ( $srpm ) { |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
366 |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
367 |
unless ( $reposrc{$r}->{srpm} ) { |
} |
368 |
unshift @{$srpm->{repos}}, $r; |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
369 |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
370 |
$srpm->{repo} = $r; |
} else { |
371 |
$reposrc{$r}->{srpm} = $srpm; |
$cmp->{delete}++; |
372 |
} |
} |
373 |
} |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
374 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
$cmp->{repo} = $dest; |
375 |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
376 |
} |
$track{repo} = $dest; |
377 |
print "\n * missing originals (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
$track{svr} = $cmp->{svr}; |
378 |
} |
} |
379 |
|
} |
380 |
foreach my $r ( keys %$acnt ) { |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
381 |
foreach my $p ( keys %{$acnt->{$r}} ) { |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
382 |
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
} |
383 |
if ( $a eq 'noarch' ) { |
} |
384 |
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
} else { |
385 |
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @archs ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
386 |
$p2->{oldrepo} = $p2->{repo}; |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
387 |
push @{$p2->{repos}}, $p2->{repo}; |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
388 |
} |
} elsif ( $cmp->{src} ) { |
389 |
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
390 |
print "\n * many packages ($r, $a, $p)\n"; |
} else { |
391 |
} |
$track{svr} = $cmp->{svr}; |
392 |
} |
} |
393 |
} |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
394 |
} |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
395 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
396 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
397 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
398 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
399 |
$pkg->{repo} = $stage; |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
400 |
push @{$pkg->{repos}}, $stage; |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
401 |
} |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
402 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
403 |
print "\n$base (sme$smever)\n", "=" x length("$base (sme$smever)"), "\n"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
404 |
$print++; |
} |
405 |
} |
push @{$cmp->{repos}}, $dest; |
406 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
407 |
my $src = $pkg->{rpm}->filename; |
$cmp->{repo} = $dest; |
408 |
if ( $pkg->{nosig} ) { |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
409 |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
$orig{$cmp->{nvra}}++; |
410 |
unless ( $opts{t} ) { |
} |
411 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
} |
412 |
if ($?) { |
} else { |
413 |
print " * failed to sign package\n"; |
$cmp->{delete}++; |
414 |
next; |
} |
415 |
} |
} |
416 |
} |
} |
417 |
} |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
418 |
|
$pkgs{$cmp->{nvra}}++; |
419 |
if ( $pkg->{repos} ) { |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
420 |
foreach my $repo ( @{$pkg->{repos}} ) { |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
421 |
if ( $pkg->{delete} ) { |
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
422 |
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
423 |
$pkg->{delete} = 0; |
} |
424 |
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
425 |
} elsif ( $pkg->{oldrepo} eq $repo ) { |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
426 |
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
} |
427 |
} else { |
$cmp->{done}++; |
428 |
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
} |
429 |
} |
if ( $srpm ) { |
430 |
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
431 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
unless ( $reposrc{$r}->{srpm} ) { |
432 |
|
unshift @{$srpm->{repos}}, $r; |
433 |
my @d = (); |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
434 |
my $head = $distrepo->{$smever}->{repo} . $repo . '/'; |
$srpm->{repo} = $r; |
435 |
$head = $distrepo->{$smever}->{stage} if $repos->{$repo}->{stage}; |
$reposrc{$r}->{srpm} = $srpm; |
436 |
my $tail = $repos->{$repo}->{os} ? 'SME/' . $distrepo->{$smever}->{os} : 'RPMS/'; |
} |
437 |
if ( $pkg->{src} ) { |
} |
438 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
439 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
440 |
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @archs; |
} |
441 |
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
442 |
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
} |
443 |
} else { |
|
444 |
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
foreach my $r ( keys %$acnt ) { |
445 |
} |
foreach my $p ( keys %{$acnt->{$r}} ) { |
446 |
foreach my $dest ( @d ) { |
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
447 |
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
if ( $a eq 'noarch' ) { |
448 |
} |
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
449 |
|
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{'archs'}} ) { |
450 |
} |
$p2->{oldrepo} = $p2->{repo}; |
451 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
push @{$p2->{repos}}, $p2->{repo}; |
452 |
} elsif ( $pkg->{delete} ) { |
} |
453 |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
454 |
qx(rm -f $src) unless $opts{t}; |
print "\n * many packages ($r, $a, $p)\n" unless ( ($p =~ m{^syslinux-nonlinux-[0-9]}) || ($p =~ m{^lib(mcrypt|webp)-[0-9]}) ) ; |
455 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
} |
456 |
} |
} |
457 |
} |
} |
458 |
|
} |
459 |
|
|
460 |
|
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
461 |
|
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
462 |
|
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
463 |
|
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
464 |
|
$pkg->{repo} = $stage; |
465 |
|
push @{$pkg->{repos}}, $stage; |
466 |
|
} |
467 |
|
} |
468 |
|
|
469 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
470 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
471 |
|
$print++; |
472 |
|
} |
473 |
|
|
474 |
|
my $src = $pkg->{rpm}->filename; |
475 |
|
if ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
476 |
|
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
477 |
|
unless ( $opts{t} ) { |
478 |
|
qx(cat $HOME/.rpmpass | setsid rpm -D '_gpg_name $distrepo->{$ver}->{keyname}' --addsign $src >& /dev/null); |
479 |
|
if ($?) { |
480 |
|
print " * failed to sign package\n"; |
481 |
|
next; |
482 |
|
} |
483 |
|
} |
484 |
|
} |
485 |
|
|
486 |
|
if ( $pkg->{repos} ) { |
487 |
|
foreach my $repo ( @{$pkg->{repos}} ) { |
488 |
|
if ( $pkg->{delete} ) { |
489 |
|
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
490 |
|
$pkg->{delete} = 0; |
491 |
|
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
492 |
|
} elsif ( $pkg->{oldrepo} eq $repo ) { |
493 |
|
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
494 |
|
} else { |
495 |
|
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
496 |
|
} |
497 |
|
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
498 |
|
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
499 |
|
|
500 |
|
my @d = (); |
501 |
|
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
502 |
|
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
503 |
|
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
504 |
|
if ( $pkg->{src} ) { |
505 |
|
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
506 |
|
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
507 |
|
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}}; |
508 |
|
} elsif ($ver>=10 && $pkg->{rpm}->arch =~ m{^(i[356]86)$} && $pkg->{arch} =~ m{^(x86_64)$} ) { |
509 |
|
#add copy of i686 packages in x86_64 folder for SME>=10 |
510 |
|
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}}; |
511 |
|
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
512 |
|
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
513 |
|
} else { |
514 |
|
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
515 |
|
} |
516 |
|
foreach my $dest ( @d ) { |
517 |
|
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
518 |
|
} |
519 |
|
|
520 |
|
} |
521 |
|
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
522 |
|
} elsif ( $pkg->{delete} ) { |
523 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
524 |
|
qx(rm -f $src) unless $opts{t}; |
525 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
526 |
|
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
527 |
|
my $tag = dirname(dirname($pkg->{rpm}->{filename})); |
528 |
|
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
529 |
|
} |
530 |
|
} |
531 |
|
} |
532 |
|
|
533 |
|
if ( $rpms->{$base}->{srpms} ) { |
534 |
|
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
535 |
|
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
536 |
|
$pkg->{delete}++; |
537 |
|
my $src = $pkg->{rpm}->filename; |
538 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
539 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
540 |
|
$print++; |
541 |
|
} |
542 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
543 |
|
qx(rm -f $src) unless $opts{t}; |
544 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
545 |
|
} |
546 |
|
} |
547 |
} |
} |
548 |
|
|
549 |
if ( %repochg ) { |
if ( %repochg ) { |
550 |
print "\nrebuild repo (sme$smever)\n", "=" x length("rebuild repo (sme$smever)"), "\n"; |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
551 |
} |
} |
552 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
553 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
554 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @{$distrepo->{$ver}->{'archs'}} ) { |
555 |
my $dir = $distrepo->{$smever}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
556 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
557 |
chomp $dir; |
if ( $dir ) { |
558 |
print "rebuild $repo/$arch\n"; |
chomp $dir; |
559 |
unless ( $opts{t} ) { |
} else { |
560 |
if ( -f "$dir/repodata/comps.xml" ) { |
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
561 |
qx(createrepo -g repodata/comps.xml $dir); |
} |
562 |
} else { |
print "rebuild $repo/$arch\n"; |
563 |
qx(createrepo $dir); |
unless ( $opts{t} ) { |
564 |
} |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
565 |
qx(repoview $dir); |
|
566 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
my $exclude = ""; |
567 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
$exclude .= " --exclude ${osdir}/*" if -d "$dir/Packages"; |
568 |
} |
$exclude .= " --exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
569 |
} |
|
570 |
|
my $groupfile = ""; |
571 |
|
$groupfile = "--simple-md-filenames --groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
572 |
|
|
573 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
574 |
|
qx(repoview $dir); |
575 |
|
|
576 |
|
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
577 |
|
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
578 |
|
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
579 |
|
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
580 |
|
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
581 |
|
} |
582 |
|
} |
583 |
} |
} |
584 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
585 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
foreach (@{$distrepo->{$ver}->{'builds'}}) |
586 |
|
{ |
587 |
|
finddepth(sub{rmdir}, "$_") if -d "$_"; |
588 |
|
} |
589 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{'community'}) if -d "$distrepo->{$ver}->{'community'}"; |
590 |
} |
} |
591 |
} |
} |
592 |
|
|
609 |
my $pkgs = shift; |
my $pkgs = shift; |
610 |
|
|
611 |
foreach my $cmp ( @$pkgs ) { |
foreach my $cmp ( @$pkgs ) { |
612 |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
613 |
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
614 |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
615 |
$dest = $hirepo; |
$dest = $hirepo; |
616 |
last; |
last; |
617 |
} else { |
} else { |
618 |
$dest = $cmp->{repo}; |
$dest = $cmp->{repo}; |
619 |
} |
} |
620 |
} |
} |
621 |
return $dest; |
return $dest; |
622 |
} |
} |
623 |
|
|
624 |
sub process_rpm { |
sub process_rpm { |
625 |
my $rpm = shift; |
my $rpm = shift; |
626 |
my $smever = shift; |
my $ver = shift; |
627 |
my $repo = shift; |
my $repo = shift; |
628 |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
629 |
my $base = $1; |
my $base = $1; |
634 |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
635 |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
636 |
eval { my $sig = $pkg->siggpg }; |
eval { my $sig = $pkg->siggpg }; |
637 |
my $nosig = ! $@; |
|
638 |
|
my $nosig = 1; |
639 |
|
eval { my $sig = $pkg->dsaheader }; $nosig &= ! $@; |
640 |
|
eval { my $sig = $pkg->rsaheader }; $nosig &= ! $@; |
641 |
|
eval { my $sig = $pkg->siggpg }; $nosig &= ! $@; |
642 |
|
eval { my $sig = $pkg->sigpgp }; $nosig &= ! $@; |
643 |
|
|
644 |
my $cmp = $latest{$pkg->name}; |
my $cmp = $latest{$pkg->name}; |
645 |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
646 |
return unless $cmp; |
return unless $cmp; |
647 |
return if $repos->{$cmp->{repo}}->{base} && $repos->{$cmp->{repo}}->{prio} > $repos->{$repo}->{prio} && $pkg ge $cmp->{rpm}; |
return if $repos->{$cmp->{repo}}->{base} && $repos->{$cmp->{repo}}->{prio} > $repos->{$repo}->{prio} && $pkg ge $cmp->{rpm}; |
648 |
} |
} |
649 |
my ($src, $version, $release) = ($pkg->is_source_package ? $pkg->filename : $pkg->sourcerpm) =~ m{(?:^|/)([^/]*)-([^-]+)-([^-]+)\.\w+\.rpm$}; |
my ($src, $version, $release) = ($pkg->is_source_package ? $pkg->filename : $pkg->sourcerpm) =~ m{(?:^|/)([^/]*)-([^-]+)-([^-]+)\.\w+\.rpm$}; |
650 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
651 |
return if $repos->{$repo}->{base} && $nosig; |
return if $onlypkg->{$ver}->{$repo} && !( $onlypkg->{$ver}->{$repo}->{$src} || $onlypkg->{$ver}->{$repo}->{$pkg->name} ); |
652 |
|
return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign}; |
653 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
654 |
my $arch = 'unknown'; |
my $arch = 'unknown'; |
655 |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
658 |
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
659 |
|
|
660 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
661 |
name => $pkg->name, |
name => $pkg->name, |
662 |
repo => $repo, |
repo => $repo, |
663 |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
664 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
665 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
666 |
arch => $arch, |
arch => $arch, |
667 |
ver => $version, |
ver => $version, |
668 |
rel => $release, |
rel => $release, |
669 |
rpm => $pkg, |
rpm => $pkg, |
670 |
nosig => $nosig, |
nosig => $nosig, |
671 |
}; |
}; |
672 |
if ( $pkg->is_source_package ) { |
if ( $pkg->is_source_package ) { |
673 |
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
674 |
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
675 |
} else { |
} else { |
676 |
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
677 |
} |
} |
678 |
$sources{$src}++; |
$sources{$src}++; |
679 |
|
|
680 |
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
681 |
if ( ! $repos->{$repo}->{base} ) { |
if ( ! $repos->{$repo}->{base} ) { |
682 |
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
683 |
$latest{$pkg->name} = $rpmhash; |
$latest{$pkg->name} = $rpmhash; |
684 |
} |
} |
685 |
} elsif ( ( $repos->{$repo}->{prio} >= $repos->{$cmp->{repo}}->{prio} || ! $repos->{$cmp->{repo}}->{base} ) && $pkg ge $cmp->{rpm} ) { |
} elsif ( ( $repos->{$repo}->{prio} >= $repos->{$cmp->{repo}}->{prio} || ! $repos->{$cmp->{repo}}->{base} ) && $pkg ge $cmp->{rpm} ) { |
686 |
$latest{$pkg->name} = $rpmhash; |
$latest{$pkg->name} = $rpmhash; |
687 |
} |
} |
688 |
} |
} |