33 |
builds => '/builds/smeserver-7-core/', |
builds => '/builds/smeserver-7-core/', |
34 |
community => '/builds/smeserver-7-contribs/', |
community => '/builds/smeserver-7-contribs/', |
35 |
stage => '/stage/7/', |
stage => '/stage/7/', |
36 |
|
checksum => 'sha', |
37 |
}, |
}, |
38 |
'8' => { active => 1, |
'8' => { active => 1, |
39 |
centos => 5, |
centos => 5, |
42 |
builds => '/builds/smeserver-8-core/', |
builds => '/builds/smeserver-8-core/', |
43 |
community => '/builds/smeserver-8-contribs/', |
community => '/builds/smeserver-8-contribs/', |
44 |
stage => '/stage/8/', |
stage => '/stage/8/', |
45 |
|
checksum => 'sha', |
46 |
}, |
}, |
47 |
}; |
}; |
48 |
|
|
96 |
|
|
97 |
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' ) }, |
98 |
'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' ) }, |
99 |
'rpmforge' => { map { $_ => 1 } ( 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
100 |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
101 |
}, |
}, |
102 |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
103 |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
104 |
'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', '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' ) }, |
105 |
'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
106 |
}, |
}, |
107 |
}; |
}; |
162 |
|
|
163 |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
164 |
($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; |
165 |
# rpmforge (.el4.rfx to .rf, with rfb,rft,rfx switched to rf) TODO: broken, changing svr? |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
166 |
($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; |
167 |
|
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
168 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
169 |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
170 |
($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; |
171 |
# 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 |
172 |
($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; |
173 |
|
|
174 |
|
# atrpms (remove .at) |
175 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
176 |
# atrpms (remove .el4.at) |
# atrpms (remove .el4.at) |
177 |
($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; |
178 |
# atrpms (remove .el4) |
# atrpms (remove .el4) |
228 |
} else { |
} else { |
229 |
$cmp->{delete}++; |
$cmp->{delete}++; |
230 |
} |
} |
231 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
232 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
233 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
234 |
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}; |
235 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
236 |
} |
} |
237 |
} else { |
} elsif ( $cmp->{src} ) { |
238 |
if ( $cmp->{src} && $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
239 |
$cmp->{repo} = $cmp->{oldrepo}; |
$cmp->{repo} = $cmp->{oldrepo}; |
240 |
delete $cmp->{delete}; |
delete $cmp->{delete}; |
241 |
} |
} |
242 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $reposrc{$cmp->{repo}} ) { |
243 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
244 |
$srpm = $cmp if ! $srpm; |
$srpm = $cmp if ! $srpm; |
245 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
246 |
$cmp->{delete}++; |
$cmp->{delete}++; |
247 |
} |
} |
248 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
249 |
|
$cmp->{delete}++; |
250 |
|
} |
251 |
|
} elsif ( $cmp->{src} ) { |
252 |
|
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
253 |
|
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
254 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
255 |
|
]; |
256 |
|
|
257 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
258 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
259 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
260 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
261 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
262 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
263 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
264 |
|
} else { |
265 |
|
warn "How did I get here??"; |
266 |
|
} |
267 |
|
} else { |
268 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
269 |
} |
} |
270 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
271 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
272 |
} |
} |
273 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
274 |
$cmp->{delete}++; |
$cmp->{delete}++; |
275 |
} else { |
} else { |
276 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
342 |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
343 |
} |
} |
344 |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
345 |
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}; |
346 |
} |
} |
347 |
$cmp->{done}++; |
$cmp->{done}++; |
348 |
} |
} |
379 |
|
|
380 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
381 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
382 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
383 |
$pkg->{repo} = $stage; |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
384 |
push @{$pkg->{repos}}, $stage; |
$pkg->{repo} = $stage; |
385 |
|
push @{$pkg->{repos}}, $stage; |
386 |
|
} |
387 |
} |
} |
388 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
389 |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
473 |
chomp $dir; |
chomp $dir; |
474 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
475 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
476 |
if ( $dir =~ m{test/|-testing/} ) { |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
477 |
if ( -f "$dir/repodata/comps.xml" ) { |
|
478 |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
my $exclude = ""; |
479 |
} else { |
$exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
480 |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
|
481 |
} |
my $groupfile = ""; |
482 |
} else { |
$groupfile = "--groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
483 |
if ( -f "$dir/repodata/comps.xml" ) { |
|
484 |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
|
} else { |
|
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
|
|
} |
|
|
} |
|
485 |
qx(repoview $dir); |
qx(repoview $dir); |
486 |
|
|
487 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
488 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
489 |
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"; |