26 |
|
|
27 |
my @archs = ( 'i386', 'x86_64' ); |
my @archs = ( 'i386', 'x86_64' ); |
28 |
|
|
29 |
my $distrepo = { '7' => { active => 1, |
my $distrepo = { '7' => { active => 0, |
30 |
centos => 4, |
centos => 4, |
31 |
repo => '/releases/7/', |
repo => '/build/smeserver/repo/7/', |
32 |
os => 'RPMS/', |
builds => ['/build/builds/smeserver-7-core/'], |
33 |
builds => '/builds/smeserver-7-core/', |
community => '/build/builds/smeserver-7-contribs/', |
34 |
community => '/builds/smeserver-7-contribs/', |
stage => '/build/smeserver/stage/7/', |
35 |
stage => '/stage/7/', |
sign => 1, |
36 |
|
checksum => 'sha', |
37 |
}, |
}, |
38 |
'8' => { active => 1, |
'8' => { active => 1, |
39 |
centos => 5, |
centos => 5, |
40 |
repo => '/releases/testing/8/', |
repo => '/build/smeserver/repo/8/', |
41 |
os => '', |
builds => ['/build/builds/smeserver-8-core/'], |
42 |
builds => '/builds/smeserver-8-core/', |
community => '/build/builds/smeserver-8-contribs/', |
43 |
community => '/builds/smeserver-8-contribs/', |
stage => '/build/smeserver/stage/8/', |
44 |
stage => '/stage/8/', |
sign => 1, |
45 |
|
checksum => 'sha', |
46 |
|
}, |
47 |
|
'9' => { active => 1, |
48 |
|
centos => 6, |
49 |
|
repo => '/build/smeserver/repo/testing/9/', |
50 |
|
builds => ['/build/builds/smeserver-9-core/'], |
51 |
|
community => '/build/builds/smeserver-9-contribs/', |
52 |
|
stage => '/build/smeserver/stage/9/', |
53 |
|
sign => 0, |
54 |
|
checksum => 'sha256', |
55 |
}, |
}, |
56 |
}; |
}; |
57 |
|
|
58 |
my $repos = { "${repotag}os" => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
59 |
"${repotag}updates" => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
60 |
"${repotag}updates-testing" => { prio => 16, inc => 1, ver => 1, rel => 3 }, |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
61 |
"${repotag}extras" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
62 |
"${repotag}addons" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
63 |
"${repotag}contribs" => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
64 |
"${repotag}test" => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
65 |
"${repotag}dev" => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
66 |
'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 }, |
67 |
'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 }, |
68 |
'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 |
'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 }, |
73 |
}; |
}; |
74 |
|
|
75 |
my $baserepo = { "~S${repotag}os/~A/$osdir/~O" => "${repotag}os", |
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
76 |
"~S${repotag}updates/~A/RPMS/" => "${repotag}updates", |
"~S${repotag}updates/~A/" => "${repotag}updates", |
77 |
"~S${repotag}updates-testing/~A/RPMS/" => "${repotag}updates-testing", |
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
78 |
"~S${repotag}extras/~A/RPMS/" => "${repotag}extras", |
"~S${repotag}extras/~A/" => "${repotag}extras", |
79 |
"~S${repotag}addons/~A/RPMS/" => "${repotag}addons", |
"~S${repotag}addons/~A/" => "${repotag}addons", |
80 |
"~S${repotag}contribs/~A/RPMS/" => "${repotag}contribs", |
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
81 |
"~S${repotag}test/~A/RPMS/" => "${repotag}test", |
"~S${repotag}test/~A/" => "${repotag}test", |
82 |
"~S${repotag}dev/~A/RPMS/" => "${repotag}dev", |
"~S${repotag}dev/~A/" => "${repotag}dev", |
83 |
"/stage/~s/~A/$osdir/~O" => 'stage', |
"/build/smeserver/stage/~s/~A/" => 'stage', |
84 |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
85 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/' => 'centos', |
86 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/' => 'centos', |
87 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/' => 'centos', |
88 |
|
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
89 |
|
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
90 |
|
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
91 |
|
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
92 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
93 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
94 |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
95 |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
96 |
'/mirrors/rpmforge/source/' => 'rpmforge', |
'/mirrors/rpmforge/source/' => 'rpmforge', |
97 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
98 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
101 |
}; |
}; |
102 |
|
|
103 |
if ( $opts{q} ) { |
if ( $opts{q} ) { |
104 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/'} = 'centos'; |
105 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/'} = 'centos'; |
106 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/'} = 'centos'; |
107 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/'} = 'centos'; |
108 |
} |
} |
109 |
|
|
110 |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
111 |
'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' ) }, |
'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' ) }, |
112 |
'rpmforge' => { map { $_ => 1 } ( 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'perl-libwww-perl', 'spamassassin' ) }, |
113 |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
114 |
}, |
}, |
115 |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
116 |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
117 |
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', 'libtalloc', 'libtdb', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'smolt' ) }, |
'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' ) }, |
118 |
'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
119 |
|
}, |
120 |
|
'9' => { 'atrpms' => { map { $_ => 1 } ( 'perl-Pod-Escapes', 'perl-Pod-Simple' ) }, |
121 |
|
'epel' => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) }, |
122 |
|
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) }, |
123 |
}, |
}, |
124 |
}; |
}; |
125 |
|
|
138 |
|
|
139 |
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 ) { |
140 |
my $bdir = $dir; |
my $bdir = $dir; |
|
$bdir =~ s/~O/$distrepo->{$ver}->{os}/; |
|
141 |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
142 |
$bdir =~ s/~s/$ver/; |
$bdir =~ s/~s/$ver/; |
143 |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
144 |
for my $arch ( @archs, 'SRPMS/' ) { |
for my $arch ( @archs, 'SRPMS/' ) { |
145 |
my $adir = $bdir; |
my $adir = $bdir; |
146 |
if ( $arch eq 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
147 |
$adir =~ s/~A.*/$arch/; |
$adir =~ s/~A.*//; |
148 |
|
if ( -d "${adir}SRPMS" ) { |
149 |
|
$adir .= "SRPMS/"; |
150 |
|
} elsif ( -d "${adir}Source/SPackages" ) { |
151 |
|
$adir .= "Source/SPackages/"; |
152 |
|
} |
153 |
} else { |
} else { |
154 |
$adir =~ s/~A/$arch/; |
$adir =~ s/~A/$arch/; |
155 |
|
if ( -d "${adir}CentOS/RPMS" ) { |
156 |
|
$adir .= "CentOS/RPMS/"; |
157 |
|
} elsif ( -d "${adir}$osdir/RPMS" ) { |
158 |
|
$adir .= "$osdir/RPMS/"; |
159 |
|
} elsif ( -d "${adir}RPMS" ) { |
160 |
|
$adir .= "RPMS/"; |
161 |
|
} elsif ( -d "${adir}Packages" ) { |
162 |
|
$adir .= "Packages/"; |
163 |
|
} elsif ( -d "${adir}CentOS" ) { |
164 |
|
$adir .= "CentOS/"; |
165 |
|
} elsif ( -d "${adir}$osdir" ) { |
166 |
|
$adir .= "$osdir/"; |
167 |
|
} |
168 |
} |
} |
|
opendir DIR, $adir or next; |
|
169 |
next unless -d $adir; |
next unless -d $adir; |
170 |
|
opendir DIR, $adir or next; |
171 |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
172 |
closedir DIR; |
closedir DIR; |
173 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
174 |
} |
} |
175 |
} |
} |
176 |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'builds'} ); |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; |
177 |
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'}; |
178 |
|
|
179 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
196 |
|
|
197 |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
198 |
($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; |
199 |
# rpmforge (.el4.rfx to .rf, with rfb,rft,rfx switched to rf) |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
200 |
($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; |
201 |
|
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
202 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
203 |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
204 |
($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; |
205 |
# 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 |
206 |
($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; |
207 |
|
|
208 |
|
# atrpms (remove .at) |
209 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
210 |
# atrpms (remove .el4.at) |
# atrpms (remove .el4.at) |
211 |
($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; |
212 |
# atrpms (remove .el4) |
# atrpms (remove .el4) |
262 |
} else { |
} else { |
263 |
$cmp->{delete}++; |
$cmp->{delete}++; |
264 |
} |
} |
265 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
266 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
267 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
268 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
269 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
270 |
} |
} |
271 |
} else { |
} elsif ( $cmp->{src} ) { |
272 |
if ( $cmp->{src} && $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
273 |
$cmp->{repo} = $cmp->{oldrepo}; |
$cmp->{repo} = $cmp->{oldrepo}; |
274 |
delete $cmp->{delete}; |
delete $cmp->{delete}; |
275 |
} |
} |
276 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $reposrc{$cmp->{repo}} ) { |
277 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
278 |
$srpm = $cmp if ! $srpm; |
$srpm = $cmp if ! $srpm; |
279 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
280 |
$cmp->{delete}++; |
$cmp->{delete}++; |
281 |
} |
} |
282 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
283 |
|
$cmp->{delete}++; |
284 |
} |
} |
285 |
|
} elsif ( $cmp->{src} ) { |
286 |
|
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
287 |
|
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
288 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
289 |
|
]; |
290 |
|
|
291 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
292 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
293 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
294 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
295 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
296 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
297 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
298 |
|
} else { |
299 |
|
warn "How did I get here??"; |
300 |
|
} |
301 |
|
} else { |
302 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
303 |
|
} |
304 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
305 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
306 |
} |
} |
307 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
308 |
$cmp->{delete}++; |
$cmp->{delete}++; |
309 |
} else { |
} else { |
310 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
376 |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
377 |
} |
} |
378 |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
379 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
380 |
} |
} |
381 |
$cmp->{done}++; |
$cmp->{done}++; |
382 |
} |
} |
413 |
|
|
414 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
415 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
416 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
417 |
$pkg->{repo} = $stage; |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
418 |
push @{$pkg->{repos}}, $stage; |
$pkg->{repo} = $stage; |
419 |
|
push @{$pkg->{repos}}, $stage; |
420 |
|
} |
421 |
} |
} |
422 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
423 |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
424 |
$print++; |
$print++; |
425 |
} |
} |
426 |
|
|
427 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
428 |
if ( $pkg->{nosig} ) { |
if ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
429 |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
430 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
431 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
453 |
my @d = (); |
my @d = (); |
454 |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
455 |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
456 |
my $tail = $repos->{$repo}->{os} ? "$osdir/" . $distrepo->{$ver}->{os} : 'RPMS/'; |
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
457 |
if ( $pkg->{src} ) { |
if ( $pkg->{src} ) { |
458 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
459 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
485 |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
486 |
$pkg->{delete}++; |
$pkg->{delete}++; |
487 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
488 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
489 |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
490 |
$print++; |
$print++; |
491 |
} |
} |
504 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
505 |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
506 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
507 |
chomp $dir; |
if ( $dir ) { |
508 |
|
chomp $dir; |
509 |
|
} else { |
510 |
|
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
511 |
|
} |
512 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
513 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
514 |
if ( $dir =~ m{test/|-testing/} ) { |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
515 |
if ( -f "$dir/repodata/comps.xml" ) { |
|
516 |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
my $exclude = ""; |
517 |
} else { |
$exclude .= " --exclude ${osdir}/*" if -d "$dir/Packages"; |
518 |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
$exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
519 |
} |
|
520 |
} else { |
my $groupfile = ""; |
521 |
if ( -f "$dir/repodata/comps.xml" ) { |
$groupfile = "--groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
522 |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
|
523 |
} else { |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
|
|
} |
|
|
} |
|
524 |
qx(repoview $dir); |
qx(repoview $dir); |
525 |
|
|
526 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
527 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
528 |
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"; |
532 |
} |
} |
533 |
} |
} |
534 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
535 |
finddepth(sub{rmdir}, $distrepo->{$ver}->{builds}) if -d "$distrepo->{$ver}->{builds}"; |
foreach (@{$distrepo->{$ver}->{builds}}) |
536 |
|
{ |
537 |
|
finddepth(sub{rmdir}, "$_") if -d "$_"; |
538 |
|
} |
539 |
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
540 |
} |
} |
541 |
} |
} |
593 |
} |
} |
594 |
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$}; |
595 |
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} ); |
596 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign}; |
597 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
598 |
my $arch = 'unknown'; |
my $arch = 'unknown'; |
599 |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |