20 |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
21 |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
22 |
|
|
23 |
|
my $osdir = 'SME'; |
24 |
|
my $disttag = 'sme'; |
25 |
|
my $repotag = 'sme'; |
26 |
|
|
27 |
my @archs = ( 'i386', 'x86_64' ); |
my @archs = ( 'i386', 'x86_64' ); |
28 |
|
|
29 |
my $distrepo = { '7' => { active => 1, |
my $distrepo = { '7' => { active => 1, |
30 |
centos => 4, |
centos => 4, |
31 |
fedora => 3, |
repo => '/releases/7/', |
32 |
repo => '/releases/7/', |
os => 'RPMS/', |
33 |
os => 'RPMS/', |
builds => '/builds/smeserver-7-core/', |
34 |
builds => '/builds/smeserver-7-core/', |
community => '/builds/smeserver-7-contribs/', |
35 |
contribs => '/builds/smeserver-7-contribs/', |
stage => '/stage/7/', |
|
stage => '/stage/7/', |
|
36 |
}, |
}, |
37 |
'8' => { active => 1, |
'8' => { active => 1, |
38 |
centos => 5, |
centos => 5, |
39 |
fedora => 6, |
repo => '/releases/testing/8/', |
40 |
repo => '/releases/testing/8/', |
os => '', |
41 |
os => '', |
builds => '/builds/smeserver-8-core/', |
42 |
builds => '/builds/smeserver-8-core/', |
community => '/builds/smeserver-8-contribs/', |
43 |
contribs => '/builds/smeserver-8-contribs/', |
stage => '/stage/8/', |
|
stage => '/stage/8/', |
|
44 |
}, |
}, |
45 |
}; |
}; |
46 |
|
|
47 |
my $repos = { 'smeos' => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
48 |
'smeupdates' => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
49 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 3 }, |
"${repotag}updates-testing" => { prio => 16, inc => 1, ver => 1, rel => 3 }, |
50 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
51 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
52 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
"${repotag}contribs" => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
53 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
"${repotag}test" => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
54 |
'smedev' => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
"${repotag}dev" => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
55 |
'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 }, |
56 |
'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 }, |
57 |
'fedora-extras' => { prio => 8, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
58 |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
59 |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
60 |
'fedora' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
61 |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
'contribs' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
|
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
62 |
}; |
}; |
63 |
|
|
64 |
my $baserepo = { '~Ssmeos/~A/SME/~O' => 'smeos', |
my $baserepo = { "~S${repotag}os/~A/$osdir/~O" => "${repotag}os", |
65 |
'~Ssmeupdates/~A/RPMS/' => 'smeupdates', |
"~S${repotag}updates/~A/RPMS/" => "${repotag}updates", |
66 |
'~Ssmeupdates-testing/~A/RPMS/' => 'smeupdates-testing', |
"~S${repotag}updates-testing/~A/RPMS/" => "${repotag}updates-testing", |
67 |
'~Ssmeextras/~A/RPMS/' => 'smeextras', |
"~S${repotag}extras/~A/RPMS/" => "${repotag}extras", |
68 |
'~Ssmeaddons/~A/RPMS/' => 'smeaddons', |
"~S${repotag}addons/~A/RPMS/" => "${repotag}addons", |
69 |
'~Ssmecontribs/~A/RPMS/' => 'smecontribs', |
"~S${repotag}contribs/~A/RPMS/" => "${repotag}contribs", |
70 |
'~Ssmetest/~A/RPMS/' => 'smetest', |
"~S${repotag}test/~A/RPMS/" => "${repotag}test", |
71 |
'~Ssmedev/~A/RPMS/' => 'smedev', |
"~S${repotag}dev/~A/RPMS/" => "${repotag}dev", |
72 |
'/stage/~s/~A/SME/~O' => 'stage', |
"/stage/~s/~A/$osdir/~O" => 'stage', |
73 |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
74 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
75 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
76 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
77 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
78 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
|
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
|
79 |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
80 |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
81 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
82 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
83 |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
84 |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
|
'/mirrors/fedora/core/~F/~A/os/Fedora/RPMS/' => 'fedora', |
|
|
'/mirrors/fedora/core/updates/~F/~A/' => 'fedora', |
|
85 |
}; |
}; |
86 |
|
|
87 |
if ( $opts{q} ) { |
if ( $opts{q} ) { |
92 |
} |
} |
93 |
|
|
94 |
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' ) }, |
95 |
'epel' => { map { $_ => 1 } ( 'clamav', 'fping', 'ocsinventory', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'perl-Text-Iconv', 'proftpd' ) }, |
'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', 'proftpd' ) }, |
|
'fedora-extras' => { map { $_ => 1 } ( 'ddclient', 'hddtemp', 'pam_abl', 'perl-Error', 'perl-HTML-Format', 'perl-MIME-Types', 'perl-Net-IP', 'perl-Archive-Zip', 'perl-Class-Singleton', 'perl-Razor-Agent', 'perl-Test-Inline', 'perl-Text-Autoformat', 'perl-Text-Iconv', 'perl-Text-Reform', 'perl-XML-RSS' ) }, |
|
96 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
97 |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
98 |
}, |
}, |
99 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
100 |
'fedora' => { map { $_ => 1 } ( 'kernel', 'kernel-xen' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', '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', 'proftpd', 'smolt' ) }, |
|
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'proftpd', 'smolt' ) }, |
|
|
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
|
101 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
102 |
}, |
}, |
103 |
}; |
}; |
107 |
$devel2 ||= $devel1; |
$devel2 ||= $devel1; |
108 |
|
|
109 |
my ($rpms, %base, %latest, %sources); |
my ($rpms, %base, %latest, %sources); |
110 |
foreach my $smever ( sort { $a <=> $b } keys %$distrepo ) { |
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
111 |
next unless $distrepo->{$smever}->{active}; |
next unless $distrepo->{$ver}->{active}; |
112 |
my %repochg = (); |
my %repochg = (); |
113 |
$rpms = (); |
$rpms = (); |
114 |
%latest = (); |
%latest = (); |
117 |
|
|
118 |
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 ) { |
119 |
my $bdir = $dir; |
my $bdir = $dir; |
120 |
$bdir =~ s/~O/$distrepo->{$smever}->{os}/; |
$bdir =~ s/~O/$distrepo->{$ver}->{os}/; |
121 |
$bdir =~ s/~S/$distrepo->{$smever}->{repo}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
122 |
$bdir =~ s/~s/$smever/; |
$bdir =~ s/~s/$ver/; |
123 |
$bdir =~ s/~C/$distrepo->{$smever}->{centos}/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
|
$bdir =~ s/~F/$distrepo->{$smever}->{fedora}/; |
|
124 |
for my $arch ( @archs, 'SRPMS/' ) { |
for my $arch ( @archs, 'SRPMS/' ) { |
125 |
my $adir = $bdir; |
my $adir = $bdir; |
126 |
if ( $arch eq 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
130 |
} |
} |
131 |
opendir DIR, $adir or next; |
opendir DIR, $adir or next; |
132 |
next unless -d $adir; |
next unless -d $adir; |
133 |
process_rpm("$adir$_", $smever, $baserepo->{$dir}) foreach readdir DIR; |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
134 |
closedir DIR; |
closedir DIR; |
135 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
136 |
} |
} |
137 |
} |
} |
138 |
find( { wanted => sub { process_rpm($_, $smever, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'builds'} ); |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'builds'} ); |
139 |
find( { wanted => sub { process_rpm($_, $smever, 'contribs'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$smever}->{'contribs'} ); |
find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; |
140 |
|
|
141 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
142 |
next unless $rpms->{$base}->{rpms}; |
next unless $rpms->{$base}->{rpms}; |
156 |
($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; |
157 |
($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; |
158 |
($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; |
159 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
160 |
|
($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
161 |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
162 |
($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; |
163 |
($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; |
164 |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
165 |
($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; |
166 |
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
167 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
168 |
} |
} |
169 |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
170 |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
205 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
206 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
207 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
208 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$smever}->{$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}; |
209 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
210 |
} |
} |
211 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
226 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
227 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
228 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
229 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$smever}->{$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}; |
230 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
231 |
} |
} |
232 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
260 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
261 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
262 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
263 |
if ( $cmp->{src} && ! $reposrc{$dest} ) { |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
264 |
$cmp->{delete}++; |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
265 |
} elsif ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
266 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
267 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$smever}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
268 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
} |
269 |
|
push @{$cmp->{repos}}, $dest; |
270 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
271 |
|
$cmp->{repo} = $dest; |
272 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
273 |
|
$orig{$cmp->{nvra}}++; |
274 |
} |
} |
|
push @{$cmp->{repos}}, $dest; |
|
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
|
|
$cmp->{repo} = $dest; |
|
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
|
|
$orig{$cmp->{nvra}}++; |
|
|
} else { |
|
|
$cmp->{delete}++; |
|
275 |
} |
} |
276 |
} else { |
} else { |
277 |
$cmp->{delete}++; |
$cmp->{delete}++; |
300 |
} |
} |
301 |
} |
} |
302 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
303 |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
304 |
} |
} |
305 |
print "\n * missing originals (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
306 |
} |
} |
307 |
|
|
308 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
328 |
push @{$pkg->{repos}}, $stage; |
push @{$pkg->{repos}}, $stage; |
329 |
} |
} |
330 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
331 |
print "\n$base (sme$smever)\n", "=" x length("$base (sme$smever)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
332 |
$print++; |
$print++; |
333 |
} |
} |
334 |
|
|
359 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
360 |
|
|
361 |
my @d = (); |
my @d = (); |
362 |
my $head = $distrepo->{$smever}->{repo} . $repo . '/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
363 |
$head = $distrepo->{$smever}->{stage} if $repos->{$repo}->{stage}; |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
364 |
my $tail = $repos->{$repo}->{os} ? 'SME/' . $distrepo->{$smever}->{os} : 'RPMS/'; |
my $tail = $repos->{$repo}->{os} ? "$osdir/" . $distrepo->{$ver}->{os} : 'RPMS/'; |
365 |
if ( $pkg->{src} ) { |
if ( $pkg->{src} ) { |
366 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
367 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
382 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
383 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
384 |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
385 |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$smever}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
386 |
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
387 |
} |
} |
388 |
} |
} |
390 |
} |
} |
391 |
|
|
392 |
if ( %repochg ) { |
if ( %repochg ) { |
393 |
print "\nrebuild repo (sme$smever)\n", "=" x length("rebuild repo (sme$smever)"), "\n"; |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
394 |
} |
} |
395 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
396 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
397 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
398 |
my $dir = $distrepo->{$smever}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
399 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
400 |
chomp $dir; |
chomp $dir; |
401 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
412 |
} |
} |
413 |
} |
} |
414 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
415 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
finddepth(sub{rmdir}, $distrepo->{$ver}->{builds}) if -d "$distrepo->{$ver}->{builds}"; |
416 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
417 |
} |
} |
418 |
} |
} |
419 |
|
|
450 |
|
|
451 |
sub process_rpm { |
sub process_rpm { |
452 |
my $rpm = shift; |
my $rpm = shift; |
453 |
my $smever = shift; |
my $ver = shift; |
454 |
my $repo = shift; |
my $repo = shift; |
455 |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
456 |
my $base = $1; |
my $base = $1; |
469 |
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}; |
470 |
} |
} |
471 |
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$}; |
472 |
return if $skippkg->{$smever}->{$repo} && ( $skippkg->{$smever}->{$repo}->{$src} || $skippkg->{$smever}->{$repo}->{$pkg->name} ); |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
473 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
474 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
475 |
my $arch = 'unknown'; |
my $arch = 'unknown'; |