17 |
getopts( 'osqtr:', \%opts ); |
getopts( 'osqtr:', \%opts ); |
18 |
$opts{r} ||= ''; |
$opts{r} ||= ''; |
19 |
|
|
20 |
my $rpm_flags = RPM2->vsf_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
21 |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
|
22 |
|
my $osdir = 'SME'; |
23 |
|
my $disttag = 'sme'; |
24 |
|
my $repotag = 'sme'; |
25 |
|
|
26 |
my @archs = ( 'i386', 'x86_64' ); |
my @archs = ( 'i386', 'x86_64' ); |
27 |
|
|
28 |
my $distrepo = { '7' => { active => 1, |
my $distrepo = { '7' => { active => 0, |
29 |
centos => 4, |
centos => 4, |
30 |
fedora => 3, |
repo => '/build/smeserver/repo/7/', |
31 |
repo => '/releases/7/', |
builds => ['/build/builds/smeserver-7-core/'], |
32 |
os => 'RPMS/', |
community => '/build/builds/smeserver-7-contribs/', |
33 |
builds => '/builds/smeserver-7-core/', |
stage => '/build/smeserver/stage/7/', |
34 |
contribs => '/builds/smeserver-7-contribs/', |
sign => 1, |
35 |
stage => '/stage/7/', |
checksum => 'sha', |
36 |
|
}, |
37 |
|
'8' => { active => 1, |
38 |
|
centos => 5, |
39 |
|
repo => '/build/smeserver/repo/8/', |
40 |
|
builds => ['/build/builds/smeserver-8-core/'], |
41 |
|
community => '/build/builds/smeserver-8-contribs/', |
42 |
|
stage => '/build/smeserver/stage/8/', |
43 |
|
sign => 1, |
44 |
|
checksum => 'sha', |
45 |
}, |
}, |
46 |
'8' => { active => 1, |
'9' => { active => 1, |
47 |
centos => 5, |
centos => 6, |
48 |
fedora => 6, |
repo => '/build/smeserver/repo/testing/9/', |
49 |
repo => '/releases/testing/8/', |
builds => ['/build/builds/smeserver-9-core/'], |
50 |
os => '', |
community => '/build/builds/smeserver-9-contribs/', |
51 |
builds => '/builds/smeserver-8-core/', |
stage => '/build/smeserver/stage/9/', |
52 |
contribs => '/builds/smeserver-8-contribs/', |
sign => 1, |
53 |
stage => '/stage/8/', |
checksum => 'sha256', |
54 |
}, |
}, |
55 |
}; |
}; |
56 |
|
|
57 |
my $repos = { 'smeos' => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
58 |
'smeupdates' => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
59 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
60 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
61 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
62 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
63 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
64 |
'smedev' => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
65 |
'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 }, |
66 |
'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 }, |
67 |
'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 }, |
68 |
'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 }, |
69 |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
70 |
'fedora' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
71 |
'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 }, |
|
72 |
}; |
}; |
73 |
|
|
74 |
my $baserepo = { '~Ssmeos/~A/SME/~O' => 'smeos', |
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
75 |
'~Ssmeupdates/~A/RPMS/' => 'smeupdates', |
"~S${repotag}updates/~A/" => "${repotag}updates", |
76 |
'~Ssmeupdates-testing/~A/RPMS/' => 'smeupdates-testing', |
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
77 |
'~Ssmeextras/~A/RPMS/' => 'smeextras', |
"~S${repotag}extras/~A/" => "${repotag}extras", |
78 |
'~Ssmeaddons/~A/RPMS/' => 'smeaddons', |
"~S${repotag}addons/~A/" => "${repotag}addons", |
79 |
'~Ssmecontribs/~A/RPMS/' => 'smecontribs', |
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
80 |
'~Ssmetest/~A/RPMS/' => 'smetest', |
"~S${repotag}test/~A/" => "${repotag}test", |
81 |
'~Ssmedev/~A/RPMS/' => 'smedev', |
"~S${repotag}dev/~A/" => "${repotag}dev", |
82 |
'/stage/~s/~A/SME/~O' => 'stage', |
"/build/smeserver/stage/~s/~A/" => 'stage', |
83 |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
84 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/' => 'centos', |
85 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/' => 'centos', |
86 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/' => 'centos', |
87 |
|
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
88 |
|
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
89 |
|
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
90 |
|
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
91 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
92 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
93 |
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
94 |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
95 |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
'/mirrors/rpmforge/source/' => 'rpmforge', |
96 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
97 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
98 |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
99 |
'/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', |
|
100 |
}; |
}; |
101 |
|
|
102 |
if ( $opts{q} ) { |
if ( $opts{q} ) { |
103 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/'} = 'centos'; |
104 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/'} = 'centos'; |
105 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/'} = 'centos'; |
106 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/'} = 'centos'; |
107 |
} |
} |
108 |
|
|
109 |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
110 |
'epel' => { map { $_ => 1 } ( 'clamav', 'fping', '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' ) }, |
111 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'perl-libwww-perl', 'spamassassin' ) }, |
112 |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
113 |
}, |
}, |
114 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
115 |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
116 |
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'proftpd', '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' ) }, |
117 |
'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' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
118 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
}, |
119 |
|
'9' => { 'atrpms' => { map { $_ => 1 } ( 'perl-Pod-Escapes', 'perl-Pod-Simple' ) }, |
120 |
|
'epel' => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) }, |
121 |
|
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) }, |
122 |
}, |
}, |
123 |
}; |
}; |
124 |
|
|
127 |
$devel2 ||= $devel1; |
$devel2 ||= $devel1; |
128 |
|
|
129 |
my ($rpms, %base, %latest, %sources); |
my ($rpms, %base, %latest, %sources); |
130 |
foreach my $smever ( sort { $a <=> $b } keys %$distrepo ) { |
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
131 |
next unless $distrepo->{$smever}->{active}; |
next unless $distrepo->{$ver}->{active}; |
132 |
my %repochg = (); |
my %repochg = (); |
133 |
$rpms = (); |
$rpms = (); |
134 |
%latest = (); |
%latest = (); |
137 |
|
|
138 |
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 ) { |
139 |
my $bdir = $dir; |
my $bdir = $dir; |
140 |
$bdir =~ s/~O/$distrepo->{$smever}->{os}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
141 |
$bdir =~ s/~S/$distrepo->{$smever}->{repo}/; |
$bdir =~ s/~s/$ver/; |
142 |
$bdir =~ s/~s/$smever/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
|
$bdir =~ s/~C/$distrepo->{$smever}->{centos}/; |
|
|
$bdir =~ s/~F/$distrepo->{$smever}->{fedora}/; |
|
143 |
for my $arch ( @archs, 'SRPMS/' ) { |
for my $arch ( @archs, 'SRPMS/' ) { |
144 |
my $adir = $bdir; |
my $adir = $bdir; |
145 |
if ( $arch eq 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
146 |
$adir =~ s/~A.*/$arch/ if $arch eq 'SRPMS/'; |
$adir =~ s/~A.*//; |
147 |
|
if ( -d "${adir}SRPMS" ) { |
148 |
|
$adir .= "SRPMS/"; |
149 |
|
} elsif ( -d "${adir}Source/SPackages" ) { |
150 |
|
$adir .= "Source/SPackages/"; |
151 |
|
} |
152 |
} else { |
} else { |
153 |
$adir =~ s/~A/$arch/; |
$adir =~ s/~A/$arch/; |
154 |
|
if ( -d "${adir}CentOS/RPMS" ) { |
155 |
|
$adir .= "CentOS/RPMS/"; |
156 |
|
} elsif ( -d "${adir}$osdir/RPMS" ) { |
157 |
|
$adir .= "$osdir/RPMS/"; |
158 |
|
} elsif ( -d "${adir}RPMS" ) { |
159 |
|
$adir .= "RPMS/"; |
160 |
|
} elsif ( -d "${adir}Packages" ) { |
161 |
|
$adir .= "Packages/"; |
162 |
|
} elsif ( -d "${adir}CentOS" ) { |
163 |
|
$adir .= "CentOS/"; |
164 |
|
} elsif ( -d "${adir}$osdir" ) { |
165 |
|
$adir .= "$osdir/"; |
166 |
|
} |
167 |
} |
} |
|
opendir DIR, $adir or next; |
|
168 |
next unless -d $adir; |
next unless -d $adir; |
169 |
process_rpm("$adir$_", $smever, $baserepo->{$dir}) foreach readdir DIR; |
opendir DIR, $adir or next; |
170 |
|
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
171 |
closedir DIR; |
closedir DIR; |
172 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
173 |
} |
} |
174 |
} |
} |
175 |
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 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}}; |
176 |
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'}; |
177 |
|
|
178 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
179 |
next unless $rpms->{$base}->{rpms}; |
next unless $rpms->{$base}->{rpms}; |
188 |
next if $pkg->{done}; |
next if $pkg->{done}; |
189 |
|
|
190 |
my $tmp = $pkg->{svr}; |
my $tmp = $pkg->{svr}; |
191 |
|
# srpm transformations to match up binary and source rpms |
192 |
SRC: { |
SRC: { |
193 |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
# Try to find the name the binary wants (no changes) |
194 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
195 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
|
196 |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
197 |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
198 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
199 |
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
200 |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
201 |
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
202 |
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
203 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
204 |
|
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
205 |
|
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
206 |
|
|
207 |
|
# atrpms (remove .at) |
208 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
209 |
|
# atrpms (remove .el4.at) |
210 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
211 |
|
# atrpms (remove .el4) |
212 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
213 |
|
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
214 |
|
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
215 |
|
|
216 |
|
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
217 |
|
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
218 |
|
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
219 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
220 |
|
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
221 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
222 |
|
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
223 |
|
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
224 |
|
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
225 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
226 |
} |
} |
227 |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
228 |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
257 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
258 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
259 |
$seen{$cmp->{nvra}}->{latest}++; |
$seen{$cmp->{nvra}}->{latest}++; |
260 |
|
delete $cmp->{delete} if $cmp->{delete}; |
261 |
} else { |
} else { |
262 |
$cmp->{delete}++; |
$cmp->{delete}++; |
263 |
} |
} |
264 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
265 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
266 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
267 |
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}; |
268 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
269 |
} |
} |
270 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} elsif ( $cmp->{src} ) { |
271 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
272 |
|
$cmp->{repo} = $cmp->{oldrepo}; |
273 |
|
delete $cmp->{delete}; |
274 |
|
} |
275 |
|
if ( $reposrc{$cmp->{repo}} ) { |
276 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
277 |
|
$srpm = $cmp if ! $srpm; |
278 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
279 |
|
$cmp->{delete}++; |
280 |
|
} |
281 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
282 |
$cmp->{delete}++; |
$cmp->{delete}++; |
283 |
} |
} |
284 |
|
} elsif ( $cmp->{src} ) { |
285 |
|
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
286 |
|
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
287 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
288 |
|
]; |
289 |
|
|
290 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
291 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
292 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
293 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
294 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
295 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
296 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
297 |
|
} else { |
298 |
|
warn "How did I get here??"; |
299 |
|
} |
300 |
|
} else { |
301 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
302 |
|
} |
303 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
304 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
305 |
} |
} |
306 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
307 |
$cmp->{delete}++; |
$cmp->{delete}++; |
308 |
} else { |
} else { |
309 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
315 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
316 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
317 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
318 |
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}; |
319 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
320 |
} |
} |
321 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
349 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
350 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
351 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
352 |
if ( $cmp->{src} && ! $reposrc{$dest} ) { |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
353 |
$cmp->{delete}++; |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
354 |
} elsif ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
355 |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
356 |
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"; |
357 |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
} |
358 |
|
push @{$cmp->{repos}}, $dest; |
359 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
360 |
|
$cmp->{repo} = $dest; |
361 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
362 |
|
$orig{$cmp->{nvra}}++; |
363 |
} |
} |
|
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}++; |
|
364 |
} |
} |
365 |
} else { |
} else { |
366 |
$cmp->{delete}++; |
$cmp->{delete}++; |
371 |
$pkgs{$cmp->{nvra}}++; |
$pkgs{$cmp->{nvra}}++; |
372 |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
373 |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
374 |
unless ( $seen{$cmp->{nvra}} ) { |
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
375 |
$seen{$cmp->{nvra}} = $cmp; |
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
|
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
|
376 |
} |
} |
377 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
378 |
|
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
379 |
} |
} |
380 |
$cmp->{done}++; |
$cmp->{done}++; |
381 |
} |
} |
389 |
} |
} |
390 |
} |
} |
391 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
392 |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
393 |
} |
} |
394 |
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; |
395 |
} |
} |
396 |
|
|
397 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
412 |
|
|
413 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
414 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
415 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
416 |
$pkg->{repo} = $stage; |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
417 |
push @{$pkg->{repos}}, $stage; |
$pkg->{repo} = $stage; |
418 |
|
push @{$pkg->{repos}}, $stage; |
419 |
|
} |
420 |
} |
} |
421 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
422 |
print "\n$base (sme$smever)\n", "=" x length("$base (sme$smever)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
423 |
$print++; |
$print++; |
424 |
} |
} |
425 |
|
|
426 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
427 |
if ( $pkg->{nosig} ) { |
if ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
428 |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
429 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
430 |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
450 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
451 |
|
|
452 |
my @d = (); |
my @d = (); |
453 |
my $head = $distrepo->{$smever}->{repo} . $repo . '/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
454 |
$head = $distrepo->{$smever}->{stage} if $repos->{$repo}->{stage}; |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
455 |
my $tail = $repos->{$repo}->{os} ? 'SME/' . $distrepo->{$smever}->{os} : 'RPMS/'; |
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
456 |
if ( $pkg->{src} ) { |
if ( $pkg->{src} ) { |
457 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
458 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
473 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
474 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
475 |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
476 |
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}; |
477 |
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"; |
478 |
} |
} |
479 |
} |
} |
480 |
} |
} |
481 |
|
|
482 |
|
if ( $rpms->{$base}->{srpms} ) { |
483 |
|
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
484 |
|
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
485 |
|
$pkg->{delete}++; |
486 |
|
my $src = $pkg->{rpm}->filename; |
487 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
488 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
489 |
|
$print++; |
490 |
|
} |
491 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
492 |
|
qx(rm -f $src) unless $opts{t}; |
493 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
494 |
|
} |
495 |
|
} |
496 |
} |
} |
497 |
|
|
498 |
if ( %repochg ) { |
if ( %repochg ) { |
499 |
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"; |
500 |
} |
} |
501 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
502 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
503 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
504 |
my $dir = $distrepo->{$smever}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
505 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
506 |
chomp $dir; |
if ( $dir ) { |
507 |
|
chomp $dir; |
508 |
|
} else { |
509 |
|
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
510 |
|
} |
511 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
512 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
513 |
if ( -f "$dir/repodata/comps.xml" ) { |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
514 |
qx(createrepo -g repodata/comps.xml $dir); |
|
515 |
} else { |
my $exclude = ""; |
516 |
qx(createrepo $dir); |
$exclude .= " --exclude ${osdir}/*" if -d "$dir/Packages"; |
517 |
} |
$exclude .= " --exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
518 |
|
|
519 |
|
my $groupfile = ""; |
520 |
|
$groupfile = "--simple-md-filenames --groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
521 |
|
|
522 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
523 |
qx(repoview $dir); |
qx(repoview $dir); |
524 |
|
|
525 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
526 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
527 |
|
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
528 |
|
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
529 |
|
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
530 |
} |
} |
531 |
} |
} |
532 |
} |
} |
533 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
534 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
foreach (@{$distrepo->{$ver}->{builds}}) |
535 |
|
{ |
536 |
|
finddepth(sub{rmdir}, "$_") if -d "$_"; |
537 |
|
} |
538 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
539 |
} |
} |
540 |
} |
} |
541 |
|
|
572 |
|
|
573 |
sub process_rpm { |
sub process_rpm { |
574 |
my $rpm = shift; |
my $rpm = shift; |
575 |
my $smever = shift; |
my $ver = shift; |
576 |
my $repo = shift; |
my $repo = shift; |
577 |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
578 |
my $base = $1; |
my $base = $1; |
583 |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
584 |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
585 |
eval { my $sig = $pkg->siggpg }; |
eval { my $sig = $pkg->siggpg }; |
586 |
my $nosig = ! $@; |
|
587 |
|
my $nosig = 1; |
588 |
|
eval { my $sig = $pkg->dsaheader }; $nosig &= ! $@; |
589 |
|
eval { my $sig = $pkg->rsaheader }; $nosig &= ! $@; |
590 |
|
eval { my $sig = $pkg->siggpg }; $nosig &= ! $@; |
591 |
|
eval { my $sig = $pkg->sigpgp }; $nosig &= ! $@; |
592 |
|
|
593 |
my $cmp = $latest{$pkg->name}; |
my $cmp = $latest{$pkg->name}; |
594 |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
595 |
return unless $cmp; |
return unless $cmp; |
596 |
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}; |
597 |
} |
} |
598 |
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$}; |
599 |
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} ); |
600 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign}; |
601 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
602 |
my $arch = 'unknown'; |
my $arch = 'unknown'; |
603 |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |