14 |
$| = 1; |
$| = 1; |
15 |
|
|
16 |
my %opts; |
my %opts; |
17 |
getopts( 'osqtr:', \%opts ); |
getopts( 'ostr:', \%opts ); |
18 |
$opts{r} ||= ''; |
$opts{r} ||= ''; |
19 |
|
|
20 |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
23 |
my $disttag = 'sme'; |
my $disttag = 'sme'; |
24 |
my $repotag = 'sme'; |
my $repotag = 'sme'; |
25 |
|
|
26 |
my @archs = ( 'i386', 'x86_64' ); |
my $distrepo = { '8' => { active => 1, |
27 |
|
centos => 5, |
28 |
my $distrepo = { '7' => { active => 0, |
archs => [ 'i386', 'x86_64' ], |
29 |
centos => 4, |
repo => '/build/smeserver/repo/8/', |
30 |
repo => '/build/smeserver/repo/7/', |
builds => ['/build/builds/smeserver-8-core/'], |
31 |
builds => ['/build/builds/smeserver-7-core/'], |
community => '/build/builds/smeserver-8-contribs/', |
32 |
community => '/build/builds/smeserver-7-contribs/', |
stage => '/build/smeserver/stage/8/', |
33 |
stage => '/build/smeserver/stage/7/', |
sign => 1, |
34 |
sign => 1, |
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
35 |
checksum => 'sha', |
checksum => 'sha', |
36 |
}, |
}, |
37 |
'8' => { active => 1, |
'9' => { active => 1, |
38 |
centos => 5, |
centos => 6, |
39 |
repo => '/build/smeserver/repo/8/', |
archs => [ 'i386', 'x86_64' ], |
40 |
builds => ['/build/builds/smeserver-8-core/'], |
repo => '/build/smeserver/repo/9/', |
41 |
community => '/build/builds/smeserver-8-contribs/', |
builds => ['/build/builds/smeserver-9-core/'], |
42 |
stage => '/build/smeserver/stage/8/', |
community => '/build/builds/smeserver-9-contribs/', |
43 |
sign => 1, |
stage => '/build/smeserver/stage/9/', |
44 |
checksum => 'sha', |
sign => 1, |
45 |
}, |
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
46 |
'9' => { active => 1, |
checksum => 'sha256', |
47 |
centos => 6, |
}, |
48 |
repo => '/build/smeserver/repo/testing/9/', |
'10' => { active => 0, |
49 |
builds => ['/build/builds/smeserver-9-core/'], |
centos => 7, |
50 |
community => '/build/builds/smeserver-9-contribs/', |
archs => [ 'x86_64' ], |
51 |
stage => '/build/smeserver/stage/9/', |
repo => '/build/smeserver/repo/testing/10/', |
52 |
sign => 1, |
builds => ['/build/builds/smeserver-10-core/'], |
53 |
checksum => 'sha256', |
community => '/build/builds/smeserver-10-contribs/', |
54 |
}, |
stage => '/build/smeserver/stage/10/', |
55 |
}; |
sign => 1, |
56 |
|
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
57 |
|
checksum => 'sha256', |
58 |
|
}, |
59 |
|
}; |
60 |
|
|
61 |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
62 |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
63 |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
64 |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
65 |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
66 |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
67 |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
68 |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
69 |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
70 |
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
71 |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
72 |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
73 |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
74 |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
75 |
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
76 |
}; |
}; |
77 |
|
|
78 |
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
79 |
"~S${repotag}updates/~A/" => "${repotag}updates", |
"~S${repotag}updates/~A/" => "${repotag}updates", |
80 |
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
81 |
"~S${repotag}extras/~A/" => "${repotag}extras", |
"~S${repotag}extras/~A/" => "${repotag}extras", |
82 |
"~S${repotag}addons/~A/" => "${repotag}addons", |
"~S${repotag}addons/~A/" => "${repotag}addons", |
83 |
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
84 |
"~S${repotag}test/~A/" => "${repotag}test", |
"~S${repotag}test/~A/" => "${repotag}test", |
85 |
"~S${repotag}dev/~A/" => "${repotag}dev", |
"~S${repotag}dev/~A/" => "${repotag}dev", |
86 |
"/build/smeserver/stage/~s/~A/" => 'stage', |
"/build/smeserver/stage/~s/~A/" => 'stage', |
87 |
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
88 |
'/mirrors/centos/~C/updates/~A/' => 'centos', |
'/mirrors/centos/~C/updates/~A/' => 'centos', |
89 |
'/mirrors/centos/~C/os/~A/' => 'centos', |
'/mirrors/centos/~C/os/~A/' => 'centos', |
90 |
'/mirrors/centos/~C/extras/~A/' => 'centos', |
'/mirrors/centos/~C/extras/~A/' => 'centos', |
91 |
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
92 |
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
93 |
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
94 |
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
95 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
96 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
97 |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
98 |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
99 |
'/mirrors/rpmforge/source/' => 'rpmforge', |
'/mirrors/rpmforge/source/' => 'rpmforge', |
100 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
101 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
102 |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
103 |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
104 |
}; |
}; |
105 |
|
|
106 |
if ( $opts{q} ) { |
my $skippkg = { '8' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'gnupg' ) }, |
107 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/'} = 'centos'; |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
108 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/'} = 'centos'; |
'epel' => { map { $_ => 1 } ( 'clamav', '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' ) }, |
109 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/'} = 'centos'; |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
110 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/'} = 'centos'; |
}, |
111 |
} |
'9' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'perl-Pod-Escapes', 'perl-Pod-Simple' ) }, |
112 |
|
'epel' => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) }, |
113 |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) }, |
114 |
'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' ) }, |
}, |
115 |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'perl-libwww-perl', 'spamassassin' ) }, |
'10' => { |
116 |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
}, |
117 |
}, |
}; |
|
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
|
|
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
|
|
'epel' => { map { $_ => 1 } ( 'clamav', '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' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
|
|
}, |
|
|
'9' => { 'atrpms' => { map { $_ => 1 } ( 'perl-Pod-Escapes', 'perl-Pod-Simple' ) }, |
|
|
'epel' => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) }, |
|
|
}, |
|
|
}; |
|
118 |
|
|
119 |
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; |
120 |
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; |
130 |
%base = (); |
%base = (); |
131 |
|
|
132 |
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 ) { |
133 |
my $bdir = $dir; |
my $bdir = $dir; |
134 |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
135 |
$bdir =~ s/~s/$ver/; |
$bdir =~ s/~s/$ver/; |
136 |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
137 |
for my $arch ( @archs, 'SRPMS/' ) { |
for my $arch ( @{$distrepo->{$ver}->{'archs'}}, 'SRPMS/' ) { |
138 |
my $adir = $bdir; |
my $adir = $bdir; |
139 |
if ( $arch eq 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
140 |
$adir =~ s/~A.*//; |
$adir =~ s/~A.*//; |
141 |
if ( -d "${adir}SRPMS" ) { |
if ( -d "${adir}SRPMS" ) { |
142 |
$adir .= "SRPMS/"; |
$adir .= "SRPMS/"; |
143 |
} elsif ( -d "${adir}Source/SPackages" ) { |
} elsif ( -d "${adir}Source/SPackages" ) { |
144 |
$adir .= "Source/SPackages/"; |
$adir .= "Source/SPackages/"; |
145 |
} |
} |
146 |
} else { |
} else { |
147 |
$adir =~ s/~A/$arch/; |
$adir =~ s/~A/$arch/; |
148 |
if ( -d "${adir}CentOS/RPMS" ) { |
if ( -d "${adir}RPMS" ) { |
149 |
$adir .= "CentOS/RPMS/"; |
$adir .= "RPMS/"; |
150 |
} elsif ( -d "${adir}$osdir/RPMS" ) { |
} elsif ( -d "${adir}Packages" ) { |
151 |
$adir .= "$osdir/RPMS/"; |
$adir .= "Packages/"; |
152 |
} elsif ( -d "${adir}RPMS" ) { |
} elsif ( -d "${adir}CentOS" ) { |
153 |
$adir .= "RPMS/"; |
$adir .= "CentOS/"; |
154 |
} elsif ( -d "${adir}Packages" ) { |
} elsif ( -d "${adir}$osdir" ) { |
155 |
$adir .= "Packages/"; |
$adir .= "$osdir/"; |
156 |
} elsif ( -d "${adir}CentOS" ) { |
} |
157 |
$adir .= "CentOS/"; |
} |
158 |
} elsif ( -d "${adir}$osdir" ) { |
next unless -d $adir; |
159 |
$adir .= "$osdir/"; |
opendir DIR, $adir or next; |
160 |
} |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
161 |
} |
closedir DIR; |
162 |
next unless -d $adir; |
last unless $dir =~ m{~A}; |
163 |
opendir DIR, $adir or next; |
} |
|
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
|
|
closedir DIR; |
|
|
last unless $dir =~ m{~A}; |
|
|
} |
|
164 |
} |
} |
165 |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; |
166 |
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, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; |
167 |
|
|
168 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
169 |
next unless $rpms->{$base}->{rpms}; |
next unless $rpms->{$base}->{rpms}; |
170 |
my %track = (); |
my %track = (); |
171 |
my %seen = (); |
my %seen = (); |
172 |
my %counts = (); |
my %counts = (); |
173 |
my $acnt = (); |
my $acnt = (); |
174 |
my $print = 0; |
my $print = 0; |
175 |
%latest = (); |
%latest = (); |
176 |
|
|
177 |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
178 |
next if $pkg->{done}; |
next if $pkg->{done}; |
179 |
|
|
180 |
my $tmp = $pkg->{svr}; |
my $tmp = $pkg->{svr}; |
181 |
# srpm transformations to match up binary and source rpms |
# srpm transformations to match up binary and source rpms |
182 |
SRC: { |
SRC: { |
183 |
# Try to find the name the binary wants (no changes) |
# Try to find the name the binary wants (no changes) |
184 |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
185 |
|
|
186 |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
187 |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
188 |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
189 |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
190 |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
191 |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
192 |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
193 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
194 |
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
195 |
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
196 |
|
|
197 |
# atrpms (remove .at) |
# atrpms (remove .at) |
198 |
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
199 |
# atrpms (remove .el4.at) |
# atrpms (remove .el4.at) |
200 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
201 |
# atrpms (remove .el4) |
# atrpms (remove .el4) |
202 |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
203 |
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
204 |
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
205 |
|
|
206 |
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
207 |
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
208 |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
209 |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
210 |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
211 |
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
212 |
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
213 |
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
214 |
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
215 |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
216 |
} |
} |
217 |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
218 |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
219 |
$tmp->{svr} = $pkg->{svr}; |
$tmp->{svr} = $pkg->{svr}; |
220 |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
221 |
$tmp->{added}++; |
$tmp->{added}++; |
222 |
} |
} |
223 |
} |
} |
224 |
|
|
225 |
my %orig = (); |
my %orig = (); |
226 |
my %pkgs = (); |
my %pkgs = (); |
227 |
my %reposrc = (); |
my %reposrc = (); |
228 |
my $srpm = undef; |
my $srpm = undef; |
229 |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
230 |
next unless $cmp->{svr} eq $pkg->{svr}; |
next unless $cmp->{svr} eq $pkg->{svr}; |
231 |
|
|
232 |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
233 |
if ( $cmp->{src} ) { |
if ( $cmp->{src} ) { |
234 |
if ( ! $track{repo} ) { |
if ( ! $track{repo} ) { |
235 |
$cmp->{delete}++; |
$cmp->{delete}++; |
236 |
$cmp->{done}++; |
$cmp->{done}++; |
237 |
next; |
next; |
238 |
} |
} |
239 |
} else { |
} else { |
240 |
$track{repo} = $cmp->{repo}; |
$track{repo} = $cmp->{repo}; |
241 |
$track{svr} = $cmp->{svr}; |
$track{svr} = $cmp->{svr}; |
242 |
} |
} |
243 |
} |
} |
244 |
if ( $cmp->{svr} eq $track{svr} ) { |
if ( $cmp->{svr} eq $track{svr} ) { |
245 |
if ( $seen{$cmp->{nvra}} ) { |
if ( $seen{$cmp->{nvra}} ) { |
246 |
if ( $track{repo} ne $cmp->{repo} ) { |
if ( $track{repo} ne $cmp->{repo} ) { |
247 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
248 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
249 |
$seen{$cmp->{nvra}}->{latest}++; |
$seen{$cmp->{nvra}}->{latest}++; |
250 |
delete $cmp->{delete} if $cmp->{delete}; |
delete $cmp->{delete} if $cmp->{delete}; |
251 |
} else { |
} else { |
252 |
$cmp->{delete}++; |
$cmp->{delete}++; |
253 |
} |
} |
254 |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
255 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
256 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
257 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
258 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
259 |
} |
} |
260 |
} elsif ( $cmp->{src} ) { |
} elsif ( $cmp->{src} ) { |
261 |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
262 |
$cmp->{repo} = $cmp->{oldrepo}; |
$cmp->{repo} = $cmp->{oldrepo}; |
263 |
delete $cmp->{delete}; |
delete $cmp->{delete}; |
264 |
} |
} |
265 |
if ( $reposrc{$cmp->{repo}} ) { |
if ( $reposrc{$cmp->{repo}} ) { |
266 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
267 |
$srpm = $cmp if ! $srpm; |
$srpm = $cmp if ! $srpm; |
268 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
269 |
$cmp->{delete}++; |
$cmp->{delete}++; |
270 |
} |
} |
271 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
272 |
$cmp->{delete}++; |
$cmp->{delete}++; |
273 |
} |
} |
274 |
} elsif ( $cmp->{src} ) { |
} elsif ( $cmp->{src} ) { |
275 |
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
276 |
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
277 |
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
278 |
]; |
]; |
279 |
|
|
280 |
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
281 |
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
282 |
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
283 |
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
284 |
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
285 |
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
286 |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
287 |
} else { |
} else { |
288 |
warn "How did I get here??"; |
warn "How did I get here??"; |
289 |
} |
} |
290 |
} else { |
} else { |
291 |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
292 |
} |
} |
293 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
294 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
295 |
} |
} |
296 |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
297 |
$cmp->{delete}++; |
$cmp->{delete}++; |
298 |
} else { |
} elsif ( $cmp->{src} || ( $cmp->{rpm}->arch =~ m{^(i[356]86)$} && grep $_ eq 'i386', @{$distrepo->{$ver}->{'archs'}} ) || |
299 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
grep $_ eq $cmp->{rpm}->arch, @{$distrepo->{$ver}->{'archs'}} ) { |
300 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
301 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
302 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
303 |
if ( $cmp->{repo} ne $dest ) { |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
304 |
push @{$cmp->{repos}}, $dest; |
if ( $cmp->{repo} ne $dest ) { |
305 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
push @{$cmp->{repos}}, $dest; |
306 |
$orig{$cmp->{nvra}}++; |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
307 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
$orig{$cmp->{nvra}}++; |
308 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
309 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
310 |
} |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
311 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} |
312 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
313 |
} else { |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
314 |
$cmp->{delete}++; |
} else { |
315 |
} |
$cmp->{delete}++; |
316 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
} |
317 |
$cmp->{repo} = $dest; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
318 |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
$cmp->{repo} = $dest; |
319 |
$track{repo} = $dest; |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
320 |
$track{svr} = $cmp->{svr}; |
$track{repo} = $dest; |
321 |
} |
$track{svr} = $cmp->{svr}; |
322 |
} |
} |
323 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} |
324 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
325 |
} |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
326 |
} |
} |
327 |
} else { |
} |
328 |
if ( $track{repo} eq $cmp->{repo} ) { |
} else { |
329 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
330 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
331 |
} elsif ( $cmp->{src} ) { |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
332 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
} elsif ( $cmp->{src} ) { |
333 |
} else { |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
334 |
$track{svr} = $cmp->{svr}; |
} else { |
335 |
} |
$track{svr} = $cmp->{svr}; |
336 |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
} |
337 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
338 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
339 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
340 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
341 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
342 |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
343 |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
344 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
345 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
346 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
347 |
} |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
348 |
push @{$cmp->{repos}}, $dest; |
} |
349 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
push @{$cmp->{repos}}, $dest; |
350 |
$cmp->{repo} = $dest; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
351 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
$cmp->{repo} = $dest; |
352 |
$orig{$cmp->{nvra}}++; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
353 |
} |
$orig{$cmp->{nvra}}++; |
354 |
} |
} |
355 |
} else { |
} |
356 |
$cmp->{delete}++; |
} else { |
357 |
} |
$cmp->{delete}++; |
358 |
} |
} |
359 |
} |
} |
360 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
} |
361 |
$pkgs{$cmp->{nvra}}++; |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
362 |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
$pkgs{$cmp->{nvra}}++; |
363 |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
364 |
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
365 |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
366 |
} |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
367 |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
} |
368 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
369 |
} |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
370 |
$cmp->{done}++; |
} |
371 |
} |
$cmp->{done}++; |
372 |
if ( $srpm ) { |
} |
373 |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
if ( $srpm ) { |
374 |
unless ( $reposrc{$r}->{srpm} ) { |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
375 |
unshift @{$srpm->{repos}}, $r; |
unless ( $reposrc{$r}->{srpm} ) { |
376 |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
unshift @{$srpm->{repos}}, $r; |
377 |
$srpm->{repo} = $r; |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
378 |
$reposrc{$r}->{srpm} = $srpm; |
$srpm->{repo} = $r; |
379 |
} |
$reposrc{$r}->{srpm} = $srpm; |
380 |
} |
} |
381 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} |
382 |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
383 |
} |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
384 |
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
} |
385 |
} |
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
386 |
|
} |
387 |
foreach my $r ( keys %$acnt ) { |
|
388 |
foreach my $p ( keys %{$acnt->{$r}} ) { |
foreach my $r ( keys %$acnt ) { |
389 |
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
foreach my $p ( keys %{$acnt->{$r}} ) { |
390 |
if ( $a eq 'noarch' ) { |
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
391 |
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
if ( $a eq 'noarch' ) { |
392 |
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @archs ) { |
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
393 |
$p2->{oldrepo} = $p2->{repo}; |
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{'archs'}} ) { |
394 |
push @{$p2->{repos}}, $p2->{repo}; |
$p2->{oldrepo} = $p2->{repo}; |
395 |
} |
push @{$p2->{repos}}, $p2->{repo}; |
396 |
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
} |
397 |
print "\n * many packages ($r, $a, $p)\n"; |
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
398 |
} |
print "\n * many packages ($r, $a, $p)\n" unless $p =~ m{^syslinux-nonlinux-[0-9]}; |
399 |
} |
} |
400 |
} |
} |
401 |
} |
} |
402 |
|
} |
403 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
|
404 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
405 |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
406 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
407 |
$pkg->{repo} = $stage; |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
408 |
push @{$pkg->{repos}}, $stage; |
$pkg->{repo} = $stage; |
409 |
} |
push @{$pkg->{repos}}, $stage; |
410 |
} |
} |
411 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
} |
412 |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
|
413 |
$print++; |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
414 |
} |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
415 |
|
$print++; |
416 |
my $src = $pkg->{rpm}->filename; |
} |
417 |
if ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
|
418 |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
my $src = $pkg->{rpm}->filename; |
419 |
unless ( $opts{t} ) { |
if ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
420 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
421 |
if ($?) { |
unless ( $opts{t} ) { |
422 |
print " * failed to sign package\n"; |
qx(cat $HOME/.rpmpass | setsid rpm -D '_gpg_name $distrepo->{$ver}->{keyname}' --addsign $src >& /dev/null); |
423 |
next; |
if ($?) { |
424 |
} |
print " * failed to sign package\n"; |
425 |
} |
next; |
426 |
} |
} |
427 |
|
} |
428 |
if ( $pkg->{repos} ) { |
} |
429 |
foreach my $repo ( @{$pkg->{repos}} ) { |
|
430 |
if ( $pkg->{delete} ) { |
if ( $pkg->{repos} ) { |
431 |
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
foreach my $repo ( @{$pkg->{repos}} ) { |
432 |
$pkg->{delete} = 0; |
if ( $pkg->{delete} ) { |
433 |
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
434 |
} elsif ( $pkg->{oldrepo} eq $repo ) { |
$pkg->{delete} = 0; |
435 |
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
436 |
} else { |
} elsif ( $pkg->{oldrepo} eq $repo ) { |
437 |
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
438 |
} |
} else { |
439 |
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
440 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
} |
441 |
|
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
442 |
my @d = (); |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
443 |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
|
444 |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
my @d = (); |
445 |
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
446 |
if ( $pkg->{src} ) { |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
447 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
448 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
if ( $pkg->{src} ) { |
449 |
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @archs; |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
450 |
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
451 |
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}}; |
452 |
} else { |
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
453 |
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
454 |
} |
} else { |
455 |
foreach my $dest ( @d ) { |
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
456 |
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
} |
457 |
} |
foreach my $dest ( @d ) { |
458 |
|
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
459 |
} |
} |
460 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
|
461 |
} elsif ( $pkg->{delete} ) { |
} |
462 |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
463 |
qx(rm -f $src) unless $opts{t}; |
} elsif ( $pkg->{delete} ) { |
464 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
465 |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
qx(rm -f $src) unless $opts{t}; |
466 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
467 |
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
468 |
} |
my $tag = dirname(dirname($pkg->{rpm}->{filename})); |
469 |
} |
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
470 |
} |
} |
471 |
|
} |
472 |
if ( $rpms->{$base}->{srpms} ) { |
} |
473 |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
|
474 |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
if ( $rpms->{$base}->{srpms} ) { |
475 |
$pkg->{delete}++; |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
476 |
my $src = $pkg->{rpm}->filename; |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
477 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
$pkg->{delete}++; |
478 |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
my $src = $pkg->{rpm}->filename; |
479 |
$print++; |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
480 |
} |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
481 |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
$print++; |
482 |
qx(rm -f $src) unless $opts{t}; |
} |
483 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
484 |
} |
qx(rm -f $src) unless $opts{t}; |
485 |
} |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
486 |
|
} |
487 |
|
} |
488 |
} |
} |
489 |
|
|
490 |
if ( %repochg ) { |
if ( %repochg ) { |
491 |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
492 |
} |
} |
493 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
494 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
495 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @{$distrepo->{$ver}->{'archs'}} ) { |
496 |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
497 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
498 |
if ( $dir ) { |
if ( $dir ) { |
499 |
chomp $dir; |
chomp $dir; |
500 |
} else { |
} else { |
501 |
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
502 |
} |
} |
503 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
504 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
505 |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
506 |
|
|
507 |
my $exclude = ""; |
my $exclude = ""; |
512 |
$groupfile = "--simple-md-filenames --groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
$groupfile = "--simple-md-filenames --groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
513 |
|
|
514 |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
515 |
qx(repoview $dir); |
qx(repoview $dir); |
516 |
|
|
517 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
518 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
519 |
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
520 |
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
521 |
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
522 |
} |
} |
523 |
} |
} |
524 |
} |
} |
525 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
526 |
foreach (@{$distrepo->{$ver}->{builds}}) |
foreach (@{$distrepo->{$ver}->{builds}}) |
527 |
{ |
{ |
528 |
finddepth(sub{rmdir}, "$_") if -d "$_"; |
finddepth(sub{rmdir}, "$_") if -d "$_"; |
529 |
} |
} |
530 |
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
531 |
} |
} |
532 |
} |
} |
533 |
|
|
550 |
my $pkgs = shift; |
my $pkgs = shift; |
551 |
|
|
552 |
foreach my $cmp ( @$pkgs ) { |
foreach my $cmp ( @$pkgs ) { |
553 |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
554 |
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
555 |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
556 |
$dest = $hirepo; |
$dest = $hirepo; |
557 |
last; |
last; |
558 |
} else { |
} else { |
559 |
$dest = $cmp->{repo}; |
$dest = $cmp->{repo}; |
560 |
} |
} |
561 |
} |
} |
562 |
return $dest; |
return $dest; |
563 |
} |
} |
584 |
|
|
585 |
my $cmp = $latest{$pkg->name}; |
my $cmp = $latest{$pkg->name}; |
586 |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
587 |
return unless $cmp; |
return unless $cmp; |
588 |
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}; |
589 |
} |
} |
590 |
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$}; |
591 |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
598 |
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
599 |
|
|
600 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
601 |
name => $pkg->name, |
name => $pkg->name, |
602 |
repo => $repo, |
repo => $repo, |
603 |
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') ), |
604 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
605 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
606 |
arch => $arch, |
arch => $arch, |
607 |
ver => $version, |
ver => $version, |
608 |
rel => $release, |
rel => $release, |
609 |
rpm => $pkg, |
rpm => $pkg, |
610 |
nosig => $nosig, |
nosig => $nosig, |
611 |
}; |
}; |
612 |
if ( $pkg->is_source_package ) { |
if ( $pkg->is_source_package ) { |
613 |
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
614 |
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
615 |
} else { |
} else { |
616 |
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
617 |
} |
} |
618 |
$sources{$src}++; |
$sources{$src}++; |
619 |
|
|
620 |
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
621 |
if ( ! $repos->{$repo}->{base} ) { |
if ( ! $repos->{$repo}->{base} ) { |
622 |
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
623 |
$latest{$pkg->name} = $rpmhash; |
$latest{$pkg->name} = $rpmhash; |
624 |
} |
} |
625 |
} 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} ) { |
626 |
$latest{$pkg->name} = $rpmhash; |
$latest{$pkg->name} = $rpmhash; |
627 |
} |
} |
628 |
} |
} |