--- builds_bin/update_repos 2010/11/30 23:55:48 1.65 +++ builds_bin/update_repos 2011/06/14 18:20:44 1.66 @@ -33,6 +33,7 @@ my $distrepo = { '7' => { active => 1 builds => '/builds/smeserver-7-core/', community => '/builds/smeserver-7-contribs/', stage => '/stage/7/', + checksum => 'sha', }, '8' => { active => 1, centos => 5, @@ -41,6 +42,7 @@ my $distrepo = { '7' => { active => 1 builds => '/builds/smeserver-8-core/', community => '/builds/smeserver-8-contribs/', stage => '/stage/8/', + checksum => 'sha', }, }; @@ -94,12 +96,12 @@ if ( $opts{q} ) { my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, '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' ) }, - 'rpmforge' => { map { $_ => 1 } ( 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, + 'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, 'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, }, '8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, - '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' ) }, 'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, }, }; @@ -160,13 +162,17 @@ foreach my $ver ( sort { $a <=> $b } key # rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) ($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; - # rpmforge (.el4.rfx to .rf, with rfb,rft,rfx switched to rf) + # rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) ($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; + # rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) + ($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; # rpmforge (.el4.rf to .el5) TODO: remove when no longer needed ($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; # rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed ($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; + # atrpms (remove .at) + ($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; # atrpms (remove .el4.at) ($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; # atrpms (remove .el4) @@ -264,7 +270,7 @@ foreach my $ver ( sort { $a <=> $b } key $srpm = $cmp if ! $srpm && $cmp->{src}; $reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; } - } elsif ($repos->{$cmp->{repo}}->{stage} ) { + } elsif ( $repos->{$cmp->{repo}}->{stage} ) { $cmp->{delete}++; } else { $srpm = $cmp if ! $srpm && $cmp->{src}; @@ -467,20 +473,17 @@ foreach my $ver ( sort { $a <=> $b } key chomp $dir; print "rebuild $repo/$arch\n"; unless ( $opts{t} ) { - if ( $dir =~ m{test/|-testing/} ) { - if ( -f "$dir/repodata/comps.xml" ) { - qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); - } else { - qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); - } - } else { - if ( -f "$dir/repodata/comps.xml" ) { - qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); - } else { - qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); - } - } + my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; + + my $exclude = ""; + $exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; + + my $groupfile = ""; + $groupfile = "--groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; + + qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); qx(repoview $dir); + qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html";