14 |
$| = 1; |
$| = 1; |
15 |
|
|
16 |
my %opts; |
my %opts; |
17 |
getopts( 'osqtr:', \%opts ); |
getopts( 'ostr:', \%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 = { '8' => { active => 1, |
29 |
centos => 4, |
centos => 5, |
30 |
fedora => 3, |
repo => '/build/smeserver/repo/8/', |
31 |
repo => '/releases/7/', |
builds => ['/build/builds/smeserver-8-core/'], |
32 |
os => 'RPMS/', |
community => '/build/builds/smeserver-8-contribs/', |
33 |
builds => '/builds/smeserver-7-core/', |
stage => '/build/smeserver/stage/8/', |
34 |
contribs => '/builds/smeserver-7-contribs/', |
sign => 1, |
35 |
stage => '/stage/7/', |
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
36 |
|
checksum => 'sha', |
37 |
}, |
}, |
38 |
'8' => { active => 1, |
'9' => { active => 1, |
39 |
centos => 5, |
centos => 6, |
40 |
fedora => 6, |
repo => '/build/smeserver/repo/9/', |
41 |
repo => '/releases/testing/8/', |
builds => ['/build/builds/smeserver-9-core/'], |
42 |
os => '', |
community => '/build/builds/smeserver-9-contribs/', |
43 |
builds => '/builds/smeserver-8-core/', |
stage => '/build/smeserver/stage/9/', |
44 |
contribs => '/builds/smeserver-8-contribs/', |
sign => 1, |
45 |
stage => '/stage/8/', |
keyname => 'SME Server 7 signing key <bugteam@contribs.org>', |
46 |
|
checksum => 'sha256', |
47 |
}, |
}, |
48 |
}; |
}; |
49 |
|
|
50 |
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 }, |
51 |
'smeupdates' => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
52 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
53 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
54 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
55 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
56 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
57 |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
58 |
'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 }, |
59 |
'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 }, |
60 |
'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 }, |
61 |
'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 }, |
62 |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
63 |
'fedora' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
64 |
'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 }, |
|
65 |
}; |
}; |
66 |
|
|
67 |
my $baserepo = { '~Ssmeos/~A/SME/~O' => 'smeos', |
my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os", |
68 |
'~Ssmeupdates/~A/RPMS/' => 'smeupdates', |
"~S${repotag}updates/~A/" => "${repotag}updates", |
69 |
'~Ssmeupdates-testing/~A/RPMS/' => 'smeupdates-testing', |
"~S${repotag}updates-testing/~A/" => "${repotag}updates-testing", |
70 |
'~Ssmeextras/~A/RPMS/' => 'smeextras', |
"~S${repotag}extras/~A/" => "${repotag}extras", |
71 |
'~Ssmeaddons/~A/RPMS/' => 'smeaddons', |
"~S${repotag}addons/~A/" => "${repotag}addons", |
72 |
'~Ssmecontribs/~A/RPMS/' => 'smecontribs', |
"~S${repotag}contribs/~A/" => "${repotag}contribs", |
73 |
'~Ssmetest/~A/RPMS/' => 'smetest', |
"~S${repotag}test/~A/" => "${repotag}test", |
74 |
'~Ssmedev/~A/RPMS/' => 'smedev', |
"~S${repotag}dev/~A/" => "${repotag}dev", |
75 |
'/stage/~s/~A/SME/~O' => 'stage', |
"/build/smeserver/stage/~s/~A/" => 'stage', |
76 |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/' => 'centos', |
77 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/' => 'centos', |
78 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/' => 'centos', |
79 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/' => 'centos', |
80 |
|
'/mirrors/centos-vault/~C/fasttrack/~A/' => 'centos', |
81 |
|
'/mirrors/centos-vault/~C/updates/~A/' => 'centos', |
82 |
|
'/mirrors/centos-vault/~C/os/~A/' => 'centos', |
83 |
|
'/mirrors/centos-vault/~C/extras/~A/' => 'centos', |
84 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
85 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
86 |
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge', |
87 |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge', |
88 |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
'/mirrors/rpmforge/source/' => 'rpmforge', |
89 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
90 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
91 |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
92 |
'/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', |
|
93 |
}; |
}; |
94 |
|
|
95 |
if ( $opts{q} ) { |
my $skippkg = { '8' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'gnupg' ) }, |
96 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
97 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
'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' ) }, |
98 |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
|
|
} |
|
|
|
|
|
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
|
|
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
|
|
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
|
99 |
}, |
}, |
100 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'9' => { 'atrpms' => { map { $_ => 1 } ( 'clamav', 'perl-Pod-Escapes', 'perl-Pod-Simple' ) }, |
101 |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
'epel' => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) }, |
102 |
'epel' => { map { $_ => 1 } ( 'clamav', 'perl-Razor-Agent', 'smolt' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) }, |
|
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
|
|
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
|
103 |
}, |
}, |
104 |
}; |
}; |
105 |
|
|
108 |
$devel2 ||= $devel1; |
$devel2 ||= $devel1; |
109 |
|
|
110 |
my ($rpms, %base, %latest, %sources); |
my ($rpms, %base, %latest, %sources); |
111 |
foreach my $smever ( sort { $a <=> $b } keys %$distrepo ) { |
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
112 |
next unless $distrepo->{$smever}->{active}; |
next unless $distrepo->{$ver}->{active}; |
113 |
my %repochg = (); |
my %repochg = (); |
114 |
$rpms = (); |
$rpms = (); |
115 |
%latest = (); |
%latest = (); |
118 |
|
|
119 |
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 ) { |
120 |
my $bdir = $dir; |
my $bdir = $dir; |
121 |
$bdir =~ s/~O/$distrepo->{$smever}->{os}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
122 |
$bdir =~ s/~S/$distrepo->{$smever}->{repo}/; |
$bdir =~ s/~s/$ver/; |
123 |
$bdir =~ s/~s/$smever/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
|
$bdir =~ s/~C/$distrepo->{$smever}->{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/' ) { |
127 |
$adir =~ s/~A.*/$arch/ if $arch eq 'SRPMS/'; |
$adir =~ s/~A.*//; |
128 |
|
if ( -d "${adir}SRPMS" ) { |
129 |
|
$adir .= "SRPMS/"; |
130 |
|
} elsif ( -d "${adir}Source/SPackages" ) { |
131 |
|
$adir .= "Source/SPackages/"; |
132 |
|
} |
133 |
} else { |
} else { |
134 |
$adir =~ s/~A/$arch/; |
$adir =~ s/~A/$arch/; |
135 |
|
if ( -d "${adir}RPMS" ) { |
136 |
|
$adir .= "RPMS/"; |
137 |
|
} elsif ( -d "${adir}Packages" ) { |
138 |
|
$adir .= "Packages/"; |
139 |
|
} elsif ( -d "${adir}CentOS" ) { |
140 |
|
$adir .= "CentOS/"; |
141 |
|
} elsif ( -d "${adir}$osdir" ) { |
142 |
|
$adir .= "$osdir/"; |
143 |
|
} |
144 |
} |
} |
|
opendir DIR, $adir or next; |
|
145 |
next unless -d $adir; |
next unless -d $adir; |
146 |
process_rpm("$adir$_", $smever, $baserepo->{$dir}) foreach readdir DIR; |
opendir DIR, $adir or next; |
147 |
|
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
148 |
closedir DIR; |
closedir DIR; |
149 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
150 |
} |
} |
151 |
} |
} |
152 |
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'}}; |
153 |
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'}; |
154 |
|
|
155 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
156 |
next unless $rpms->{$base}->{rpms}; |
next unless $rpms->{$base}->{rpms}; |
165 |
next if $pkg->{done}; |
next if $pkg->{done}; |
166 |
|
|
167 |
my $tmp = $pkg->{svr}; |
my $tmp = $pkg->{svr}; |
168 |
|
# srpm transformations to match up binary and source rpms |
169 |
SRC: { |
SRC: { |
170 |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
# Try to find the name the binary wants (no changes) |
171 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
172 |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
|
173 |
($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) |
174 |
($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; |
175 |
($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) |
176 |
($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; |
177 |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
178 |
($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; |
179 |
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
180 |
($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; |
181 |
|
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
182 |
|
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
183 |
|
|
184 |
|
# atrpms (remove .at) |
185 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
186 |
|
# atrpms (remove .el4.at) |
187 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
188 |
|
# atrpms (remove .el4) |
189 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
190 |
|
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
191 |
|
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
192 |
|
|
193 |
|
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
194 |
|
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
195 |
|
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
196 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
197 |
|
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
198 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
199 |
|
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
200 |
|
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
201 |
|
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
202 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
203 |
} |
} |
204 |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
205 |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
234 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
235 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
236 |
$seen{$cmp->{nvra}}->{latest}++; |
$seen{$cmp->{nvra}}->{latest}++; |
237 |
|
delete $cmp->{delete} if $cmp->{delete}; |
238 |
} else { |
} else { |
239 |
$cmp->{delete}++; |
$cmp->{delete}++; |
240 |
} |
} |
241 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
242 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
243 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
244 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
245 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
246 |
|
} |
247 |
|
} elsif ( $cmp->{src} ) { |
248 |
|
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
249 |
|
$cmp->{repo} = $cmp->{oldrepo}; |
250 |
|
delete $cmp->{delete}; |
251 |
|
} |
252 |
|
if ( $reposrc{$cmp->{repo}} ) { |
253 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
254 |
|
$srpm = $cmp if ! $srpm; |
255 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
256 |
|
$cmp->{delete}++; |
257 |
|
} |
258 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
259 |
$cmp->{delete}++; |
$cmp->{delete}++; |
260 |
} |
} |
261 |
|
} elsif ( $cmp->{src} ) { |
262 |
|
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
263 |
|
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
264 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
265 |
|
]; |
266 |
|
|
267 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
268 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
269 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
270 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
271 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
272 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
273 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
274 |
|
} else { |
275 |
|
warn "How did I get here??"; |
276 |
|
} |
277 |
|
} else { |
278 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
279 |
|
} |
280 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
281 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
282 |
} |
} |
283 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
284 |
$cmp->{delete}++; |
$cmp->{delete}++; |
285 |
} else { |
} else { |
286 |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
291 |
push @{$cmp->{repos}}, $dest; |
push @{$cmp->{repos}}, $dest; |
292 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
293 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
294 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
295 |
|
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
296 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
297 |
|
} |
298 |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
299 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
300 |
} else { |
} else { |
302 |
} |
} |
303 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
304 |
$cmp->{repo} = $dest; |
$cmp->{repo} = $dest; |
305 |
if ( ! $cmp->{src} || $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
306 |
$track{repo} = $dest; |
$track{repo} = $dest; |
307 |
|
$track{svr} = $cmp->{svr}; |
308 |
} |
} |
309 |
} |
} |
310 |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
326 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
327 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
328 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
329 |
if ( $cmp->{src} && ! $reposrc{$dest} ) { |
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
330 |
$cmp->{delete}++; |
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
331 |
} elsif ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
unless ( $repos->{$cmp->{repo}}->{base} ) { |
332 |
push @{$cmp->{repos}}, $dest; |
my $tag = dirname(dirname($cmp->{rpm}->{filename})); |
333 |
$orig{$cmp->{nvra}}++; |
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
334 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
} |
335 |
$cmp->{repo} = $dest; |
push @{$cmp->{repos}}, $dest; |
336 |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
337 |
} else { |
$cmp->{repo} = $dest; |
338 |
$cmp->{delete}++; |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
339 |
|
$orig{$cmp->{nvra}}++; |
340 |
|
} |
341 |
} |
} |
342 |
} else { |
} else { |
343 |
$cmp->{delete}++; |
$cmp->{delete}++; |
348 |
$pkgs{$cmp->{nvra}}++; |
$pkgs{$cmp->{nvra}}++; |
349 |
$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}}; |
350 |
$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}; |
351 |
unless ( $seen{$cmp->{nvra}} ) { |
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
352 |
$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}; |
|
353 |
} |
} |
354 |
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp; |
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
355 |
|
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
356 |
} |
} |
357 |
$cmp->{done}++; |
$cmp->{done}++; |
358 |
} |
} |
366 |
} |
} |
367 |
} |
} |
368 |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
369 |
print "\n * missing source (sme$smever, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
370 |
} |
} |
371 |
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; |
372 |
} |
} |
373 |
|
|
374 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
389 |
|
|
390 |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
391 |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
392 |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
393 |
$pkg->{repo} = $stage; |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
394 |
push @{$pkg->{repos}}, $stage; |
$pkg->{repo} = $stage; |
395 |
} |
push @{$pkg->{repos}}, $stage; |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
|
|
print "\n$base (sme$smever)\n", "=" x length("$base (sme$smever)"), "\n"; |
|
|
$print++; |
|
|
} |
|
|
|
|
|
my $src = $pkg->{rpm}->filename; |
|
|
if ( $pkg->{nosig} ) { |
|
|
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
|
|
unless ( $opts{t} ) { |
|
|
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
|
|
if ($?) { |
|
|
print " * failed to sign package\n"; |
|
|
next; |
|
|
} |
|
396 |
} |
} |
397 |
} |
} |
398 |
|
|
399 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
400 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
401 |
|
$print++; |
402 |
|
} |
403 |
|
|
404 |
|
my $src = $pkg->{rpm}->filename; |
405 |
|
if ( ! $repos->{$pkg->{repo}}->{base} && $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
406 |
|
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
407 |
|
unless ( $opts{t} ) { |
408 |
|
qx(cat $HOME/.rpmpass | setsid rpm -D '_gpg_name $distrepo->{$ver}->{keyname}' --addsign $src >& /dev/null); |
409 |
|
if ($?) { |
410 |
|
print " * failed to sign package\n"; |
411 |
|
next; |
412 |
|
} |
413 |
|
} |
414 |
|
} |
415 |
|
|
416 |
if ( $pkg->{repos} ) { |
if ( $pkg->{repos} ) { |
417 |
foreach my $repo ( @{$pkg->{repos}} ) { |
foreach my $repo ( @{$pkg->{repos}} ) { |
418 |
if ( $pkg->{delete} ) { |
if ( $pkg->{delete} ) { |
428 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
429 |
|
|
430 |
my @d = (); |
my @d = (); |
431 |
my $head = $distrepo->{$smever}->{repo} . $repo . '/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
432 |
$head = $distrepo->{$smever}->{stage} if $repos->{$repo}->{stage}; |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
433 |
my $tail = $repos->{$repo}->{os} ? 'SME/' . $distrepo->{$smever}->{os} : 'RPMS/'; |
my $tail = $repos->{$repo}->{os} ? "$osdir/" : 'RPMS/'; |
434 |
if ( $pkg->{src} ) { |
if ( $pkg->{src} ) { |
435 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
436 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
450 |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
451 |
qx(rm -f $src) unless $opts{t}; |
qx(rm -f $src) unless $opts{t}; |
452 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
453 |
|
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
454 |
|
my $tag = dirname(dirname($pkg->{rpm}->{filename})); |
455 |
|
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
456 |
|
} |
457 |
|
} |
458 |
|
} |
459 |
|
|
460 |
|
if ( $rpms->{$base}->{srpms} ) { |
461 |
|
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
462 |
|
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
463 |
|
$pkg->{delete}++; |
464 |
|
my $src = $pkg->{rpm}->filename; |
465 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
466 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
467 |
|
$print++; |
468 |
|
} |
469 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
470 |
|
qx(rm -f $src) unless $opts{t}; |
471 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
472 |
} |
} |
473 |
} |
} |
474 |
} |
} |
475 |
|
|
476 |
if ( %repochg ) { |
if ( %repochg ) { |
477 |
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"; |
478 |
} |
} |
479 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
480 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
481 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
482 |
my $dir = $distrepo->{$smever}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
483 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
484 |
chomp $dir; |
if ( $dir ) { |
485 |
|
chomp $dir; |
486 |
|
} else { |
487 |
|
$dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
488 |
|
} |
489 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
490 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
491 |
if ( -f "$dir/repodata/comps.xml" ) { |
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
492 |
qx(createrepo -g repodata/comps.xml $dir); |
|
493 |
} else { |
my $exclude = ""; |
494 |
qx(createrepo $dir); |
$exclude .= " --exclude ${osdir}/*" if -d "$dir/Packages"; |
495 |
} |
$exclude .= " --exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
496 |
|
|
497 |
|
my $groupfile = ""; |
498 |
|
$groupfile = "--simple-md-filenames --groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
499 |
|
|
500 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
501 |
qx(repoview $dir); |
qx(repoview $dir); |
502 |
|
|
503 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
504 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
505 |
|
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
506 |
|
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
507 |
|
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
508 |
} |
} |
509 |
} |
} |
510 |
} |
} |
511 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
512 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs'); |
foreach (@{$distrepo->{$ver}->{builds}}) |
513 |
|
{ |
514 |
|
finddepth(sub{rmdir}, "$_") if -d "$_"; |
515 |
|
} |
516 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
517 |
} |
} |
518 |
} |
} |
519 |
|
|
550 |
|
|
551 |
sub process_rpm { |
sub process_rpm { |
552 |
my $rpm = shift; |
my $rpm = shift; |
553 |
my $smever = shift; |
my $ver = shift; |
554 |
my $repo = shift; |
my $repo = shift; |
555 |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
556 |
my $base = $1; |
my $base = $1; |
561 |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
562 |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
563 |
eval { my $sig = $pkg->siggpg }; |
eval { my $sig = $pkg->siggpg }; |
564 |
my $nosig = ! $@; |
|
565 |
|
my $nosig = 1; |
566 |
|
eval { my $sig = $pkg->dsaheader }; $nosig &= ! $@; |
567 |
|
eval { my $sig = $pkg->rsaheader }; $nosig &= ! $@; |
568 |
|
eval { my $sig = $pkg->siggpg }; $nosig &= ! $@; |
569 |
|
eval { my $sig = $pkg->sigpgp }; $nosig &= ! $@; |
570 |
|
|
571 |
my $cmp = $latest{$pkg->name}; |
my $cmp = $latest{$pkg->name}; |
572 |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
573 |
return unless $cmp; |
return unless $cmp; |
574 |
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}; |
575 |
} |
} |
576 |
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$}; |
577 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
578 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign}; |
579 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
580 |
my $arch = 'unknown'; |
my $arch = 'unknown'; |
581 |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |