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 => '/build/smeserver/repo/7/', |
repo => '/build/smeserver/repo/7/', |
32 |
os => 'RPMS/', |
builds => ['/build/builds/smeserver-7-core/'], |
|
builds => '/build/builds/smeserver-7-core/', |
|
33 |
community => '/build/builds/smeserver-7-contribs/', |
community => '/build/builds/smeserver-7-contribs/', |
34 |
stage => '/build/smeserver/stage/7/', |
stage => '/build/smeserver/stage/7/', |
35 |
sign => 1, |
sign => 1, |
38 |
'8' => { active => 1, |
'8' => { active => 1, |
39 |
centos => 5, |
centos => 5, |
40 |
repo => '/build/smeserver/repo/8/', |
repo => '/build/smeserver/repo/8/', |
41 |
os => '', |
builds => ['/build/builds/smeserver-8-core/'], |
|
builds => '/build/builds/smeserver-8-core/', |
|
42 |
community => '/build/builds/smeserver-8-contribs/', |
community => '/build/builds/smeserver-8-contribs/', |
43 |
stage => '/build/smeserver/stage/8/', |
stage => '/build/smeserver/stage/8/', |
44 |
sign => 1, |
sign => 1, |
45 |
checksum => 'sha', |
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 => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 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 |
"/build/smeserver/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/RPMS/' => 'centos', |
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
89 |
'/mirrors/centos-vault/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
90 |
'/mirrors/centos-vault/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
91 |
'/mirrors/centos-vault/~C/extras/~A/RPMS/' => 'centos', |
'/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' ) }, |
117 |
'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' ) }, |
'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 } ( 'dovecot', '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 |
|
|
126 |
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; |
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 ) { |
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' ) { |
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 |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
515 |
|
|
516 |
my $exclude = ""; |
my $exclude = ""; |
517 |
|
$exclude .= " --exclude ${osdir}/*" if -d "$dir/Packages"; |
518 |
$exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
$exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
519 |
|
|
520 |
my $groupfile = ""; |
my $groupfile = ""; |
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 && $baserepo->{$ver}->{sign}; |
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)/}; |