6 |
use File::Find; |
use File::Find; |
7 |
use File::Basename; |
use File::Basename; |
8 |
use Getopt::Std; |
use Getopt::Std; |
|
use Term::ANSIColor; |
|
9 |
use Data::Dumper; |
use Data::Dumper; |
10 |
|
|
11 |
delete $ENV{PATH}; |
delete $ENV{PATH}; |
12 |
my $HOME=$ENV{HOME}; |
my $HOME=$ENV{HOME}; |
13 |
umask 002; |
umask 002; |
14 |
|
$| = 1; |
15 |
|
|
16 |
|
my %opts; |
17 |
|
getopts( 'osqtr:', \%opts ); |
18 |
|
$opts{r} ||= ''; |
19 |
|
|
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 |
$Term::ANSIColor::AUTORESET = 1; |
my $osdir = 'SME'; |
24 |
$| = 1; |
my $disttag = 'sme'; |
25 |
|
my $repotag = 'sme'; |
26 |
|
|
27 |
my @archs = ( 'i386', 'x86_64' ); |
my @archs = ( 'i386', 'x86_64' ); |
28 |
|
|
29 |
my $repos = { 'smeos' => { prio => 17, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $distrepo = { '7' => { active => 1, |
30 |
'smeupdates' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
centos => 4, |
31 |
'smeupdates-testing' => { prio => 15, inc => 1, ver => 1, rel => 1 }, |
repo => '/releases/7/', |
32 |
'smeextras' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
os => 'RPMS/', |
33 |
'smeaddons' => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
builds => '/builds/smeserver-7-core/', |
34 |
'smecontribs' => { prio => 12, inc => 0, ver => 1, rel => 1 }, |
community => '/builds/smeserver-7-contribs/', |
35 |
'smetest' => { prio => 11, inc => 1, ver => 2, rel => 2, devel => 2 }, |
stage => '/stage/7/', |
36 |
'smedev' => { prio => 10, inc => 0, ver => 2, rel => 2, devel => 1 }, |
sign => 1, |
37 |
'centos' => { prio => 9, inc => 0, ver => 0, rel => 0, base => 1 }, |
checksum => 'sha', |
|
'fedora/epel' => { prio => 8, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'fedora/extras' => { prio => 7, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'rpmforge' => { prio => 6, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'atrpms' => { prio => 5, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'fedora/core' => { prio => 4, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'base' => { prio => 3, inc => 0, ver => 0, rel => 0, base => 1 }, |
|
|
'builds' => { prio => 2, inc => 0, ver => 0, rel => 0, builds => 1 }, |
|
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
|
}; |
|
|
|
|
|
my $distrepo = { '7' => { active => 1, |
|
|
centos => 4, |
|
|
fedora => 3, |
|
|
repo => '/releases/7/', |
|
|
os => 'SME/RPMS/', |
|
|
builds => '/builds/smeserver-7-core/', |
|
|
stage => '/stage/7/', |
|
38 |
}, |
}, |
39 |
'8' => { active => 1, |
'8' => { active => 1, |
40 |
centos => 5, |
centos => 5, |
41 |
fedora => 6, |
repo => '/releases/8/', |
42 |
repo => '/releases/testing/8/', |
os => '', |
43 |
os => 'SME/', |
builds => '/builds/smeserver-8-core/', |
44 |
builds => '/builds/smeserver-8-core/', |
community => '/builds/smeserver-8-contribs/', |
45 |
stage => '/stage/8/', |
stage => '/stage/8/', |
46 |
|
sign => 1, |
47 |
|
checksum => 'sha', |
48 |
}, |
}, |
49 |
}; |
}; |
50 |
|
|
51 |
my @baserepo = ( ( map { "/mirrors/centos/~C/$_/" } ('os','updates','fasttrack','extras') ), |
my $repos = { "${repotag}os" => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 }, |
52 |
( map { "/mirrors/fedora/epel$_/~C/" } ('','/testing') ), |
"${repotag}updates" => { prio => 18, inc => 1, ver => 1, rel => 1 }, |
53 |
'/mirrors/fedora/extras/~F/', |
"${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 }, |
54 |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/RPMS.dag/', |
"${repotag}extras" => { prio => 16, inc => 0, ver => 1, rel => 1 }, |
55 |
'/mirrors/rpmforge/dag/source/', |
"${repotag}addons" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
56 |
( map { "/mirrors/atrpms$_/el~C-~A/atrpms/stable/" } ('','/src') ), |
"${repotag}contribs" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
57 |
( map { "/mirrors/atrpms$_/el~C-~A/atrpms/testing/" } ('','/src') ), |
"${repotag}test" => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 }, |
58 |
( map {"/mirrors/fedora/core$_/~F/" } ('','/updates') ), |
"${repotag}dev" => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 }, |
59 |
); |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
60 |
|
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
61 |
my $skippkg = { '7' => { 'centos' => ['horde','imp-h3','ingo-h3','turba-h3','vim'], |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
62 |
'fedora/epel' => ['perl-Razor-Agent'], |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
63 |
'rpmforge' => ['perl-Test-Inline'], |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
64 |
'atrpms' => ['dovecot','yum'], |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
65 |
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
66 |
|
}; |
67 |
|
|
68 |
|
my $baserepo = { "~S${repotag}os/~A/$osdir/~O" => "${repotag}os", |
69 |
|
"~S${repotag}updates/~A/RPMS/" => "${repotag}updates", |
70 |
|
"~S${repotag}updates-testing/~A/RPMS/" => "${repotag}updates-testing", |
71 |
|
"~S${repotag}extras/~A/RPMS/" => "${repotag}extras", |
72 |
|
"~S${repotag}addons/~A/RPMS/" => "${repotag}addons", |
73 |
|
"~S${repotag}contribs/~A/RPMS/" => "${repotag}contribs", |
74 |
|
"~S${repotag}test/~A/RPMS/" => "${repotag}test", |
75 |
|
"~S${repotag}dev/~A/RPMS/" => "${repotag}dev", |
76 |
|
"/stage/~s/~A/$osdir/~O" => 'stage', |
77 |
|
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
78 |
|
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
79 |
|
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
80 |
|
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
81 |
|
'/mirrors/centos-vault/~C/fasttrack/~A/RPMS/' => 'centos', |
82 |
|
'/mirrors/centos-vault/~C/updates/~A/RPMS/' => 'centos', |
83 |
|
'/mirrors/centos-vault/~C/os/~A/CentOS/~O' => 'centos', |
84 |
|
'/mirrors/centos-vault/~C/extras/~A/RPMS/' => 'centos', |
85 |
|
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
86 |
|
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
87 |
|
'/mirrors/rpmforge/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
88 |
|
'/mirrors/rpmforge/redhat/el~C/en/~A/extras/RPMS/' => 'rpmforge', |
89 |
|
'/mirrors/rpmforge/source/' => 'rpmforge', |
90 |
|
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
91 |
|
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
92 |
|
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
93 |
|
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
94 |
|
}; |
95 |
|
|
96 |
|
if ( $opts{q} ) { |
97 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
98 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
99 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
100 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
101 |
|
} |
102 |
|
|
103 |
|
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
104 |
|
'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' ) }, |
105 |
|
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'mod_auth_tkt', 'perl-Test-Inline', 'perl-libwww-perl', 'spamassassin' ) }, |
106 |
|
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
107 |
}, |
}, |
108 |
'8' => { 'centos' => ['horde','imp-h3','ingo-h3','turba-h3'], |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
109 |
'fedora/epel' => ['perl-Razor-Agent','smolt'], |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
110 |
'fedora/extras' => ['dstat','gocr','horde','oidentd','perl-Test-Inline','perl-Razor-Agent','smolt'], |
'epel' => { map { $_ => 1 } ( 'clamav', 'fping', 'html2ps', 'horde', 'libtalloc', 'libtdb', 'oidentd', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'smolt' ) }, |
111 |
'rpmforge' => ['perl-Test-Inline'], |
'rpmforge' => { map { $_ => 1 } ( 'dovecot', 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
|
'atrpms' => [], |
|
|
'fedora/core' => [], |
|
112 |
}, |
}, |
113 |
}; |
}; |
114 |
|
|
115 |
my %opts; |
my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos; |
|
getopts( 'dtvr:', \%opts ); |
|
|
$opts{r} ||= ''; |
|
|
|
|
116 |
my ($devel1, $devel2) = sort { $repos->{$a}->{devel} <=> $repos->{$b}->{devel} } grep { $repos->{$_}->{devel} } keys %$repos; |
my ($devel1, $devel2) = sort { $repos->{$a}->{devel} <=> $repos->{$b}->{devel} } grep { $repos->{$_}->{devel} } keys %$repos; |
117 |
$devel2 ||= $devel1; |
$devel2 ||= $devel1; |
|
my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos; |
|
118 |
|
|
119 |
my ($rel, @rpms, %latest, %sources, $archs, $rebuild, $newline); |
my ($rpms, %base, %latest, %sources); |
120 |
foreach my $smever ( sort { $a <=> $b } grep { $distrepo->{$_}->{active} } keys %$distrepo ) { |
foreach my $ver ( sort { $a <=> $b } keys %$distrepo ) { |
121 |
$rel = $smever; |
next unless $distrepo->{$ver}->{active}; |
122 |
|
my %repochg = (); |
123 |
|
$rpms = (); |
124 |
%latest = (); |
%latest = (); |
125 |
%sources = (); |
%sources = (); |
126 |
@rpms = (); |
%base = (); |
|
$rebuild = (); |
|
127 |
|
|
128 |
# Load distro packages |
foreach my $dir ( sort { $repos->{$baserepo->{$b}}->{prio} <=> $repos->{$baserepo->{$a}}->{prio} || $a cmp $b } keys %$baserepo ) { |
129 |
find( { wanted => \&loadpkg, no_chdir => 1, follow_fast => 1 }, map { $distrepo->{$smever}->{$_} } ('repo','builds','stage') ); |
my $bdir = $dir; |
130 |
printline('white', 0, "Distro (SME Server $rel) packages loaded.\n"); |
$bdir =~ s/~O/$distrepo->{$ver}->{os}/; |
131 |
|
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
132 |
# Load base packages |
$bdir =~ s/~s/$ver/; |
133 |
foreach my $base ( @baserepo ) { |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
134 |
my $bdir = $base; |
for my $arch ( @archs, 'SRPMS/' ) { |
135 |
$bdir =~ s/~C/$distrepo->{$smever}->{centos}/; |
my $adir = $bdir; |
136 |
$bdir =~ s/~F/$distrepo->{$smever}->{fedora}/; |
if ( $arch eq 'SRPMS/' ) { |
137 |
if ( $bdir =~ m{~A} ) { |
$adir =~ s/~A.*/$arch/; |
138 |
for my $arch ( @archs ) { |
} else { |
139 |
my $basearch = $bdir; |
$adir =~ s/~A/$arch/; |
140 |
$basearch =~ s/~A/$arch/; |
} |
141 |
find( { wanted => \&loadbase, no_chdir => 1, follow_fast => 1 }, $basearch ) if -r $basearch; |
opendir DIR, $adir or next; |
142 |
} |
next unless -d $adir; |
143 |
} else { |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
144 |
find( { wanted => \&loadbase, no_chdir => 1, follow_fast => 1 }, $bdir ) if -r $bdir; |
closedir DIR; |
145 |
|
last unless $dir =~ m{~A}; |
146 |
} |
} |
147 |
} |
} |
148 |
printline('white', 0, 'Base (Centos: ', $distrepo->{$smever}->{centos}, ', Fedora: ', $distrepo->{$smever}->{fedora}, ") packages loaded.\n"); |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'builds'} ); |
149 |
|
find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'}; |
150 |
|
|
151 |
%latest = (); |
foreach my $base ( sort keys %$rpms ) { |
152 |
foreach my $name ( sort keys %{{ map { $_->{base} => 1 } @rpms }} ) { |
next unless $rpms->{$base}->{rpms}; |
153 |
printline('white', 0, "Processing: $name"); |
my %track = (); |
|
my @pkgs = sort pkgsrt grep { $_->{base} eq $name } @rpms; |
|
154 |
my %seen = (); |
my %seen = (); |
155 |
my $count = (); |
my %counts = (); |
156 |
$archs = (); |
my $acnt = (); |
157 |
|
my $print = 0; |
158 |
foreach my $pkg ( @pkgs ) { |
%latest = (); |
159 |
next if $pkg->{done} || $pkg->{obsolete} || $pkg->{rpm}->is_source_package || ! $repos->{$pkg->{repo}} || rprop($pkg, 'stage'); |
|
160 |
printline('bold black', 1, ' - ', $pkg->{rpm}->filename) if $opts{d}; |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
161 |
my $orig = 0; |
next if $pkg->{done}; |
162 |
|
|
163 |
# Find names of packages in same or higher repos |
my $tmp = $pkg->{svr}; |
164 |
my %names = names($pkg, @pkgs); |
# srpm transformations to match up binary and source rpms |
165 |
|
SRC: { |
166 |
# Move packages from base/builds to correct area |
# Try to find the name the binary wants (no changes) |
167 |
if ( rprop($pkg, 'base') || rprop($pkg, 'builds') ) { |
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
168 |
printline('dark blue', 1, ' - checking base/builds') if $opts{d}; |
|
169 |
my $repo = $names{$pkg->{name}} && $names{$pkg->{name}} > 1 ? $devel2 : $devel1; |
# rpmforge (.el4.rf to .rf, with rf,rfb,rft,rfx endings) |
170 |
if ( $pkg->{nonbase} ) { |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf[btx]?)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
171 |
foreach my $up ( @pkgs ) { |
# rpmforge (.el4.rfx to .rf, rfb,rft,rfx switched to rf) |
172 |
next if rprop($up, 'builds') || rprop($up, 'base'); |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
173 |
next if $up->{name} ne $pkg->{name} || ! $up->{obsolete} || $up->{rpm} ge $pkg->{rpm}; |
# rpmforge (.el4.rf to .rfx, rf,rfb,rft,rfx switched to rfx) |
174 |
$repo = $up->{repo}; |
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)[btx]?$}{$1x} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
175 |
last; |
# rpmforge (.el4.rf to .el5) TODO: remove when no longer needed |
176 |
} |
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
177 |
} |
# rpmforge (.2.el4.rf to .rf, minor modification not pushed to source?) TODO: remove when no longer needed |
178 |
next if rprop($pkg, 'base') && $repo eq $devel1 && $devel1 ne $devel2; |
($tmp = $pkg->{svr}) =~ s{\.2\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
179 |
movepkg($pkg, $repo); |
|
180 |
%names = names($pkg, @pkgs); |
# atrpms (remove .at) |
181 |
$seen{$pkg->{nvra}}++; |
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
182 |
$orig++; |
# atrpms (remove .el4.at) |
183 |
} |
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
184 |
|
# atrpms (remove .el4) |
185 |
# Check version/release counts |
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
186 |
unless ( $pkg->{nonbase} ) { |
# atrpms (remove .0.el5, minor modification not pushed to source?) TODO: remove when no longer needed |
187 |
printline('dark blue', 1, ' - checking version/release counts') if $opts{d}; |
($tmp = $pkg->{svr}) =~ s{\.0\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
188 |
$count->{$pkg->{repo}}->{$pkg->{version}}->{$pkg->{release}}++; |
|
189 |
if ( rprop($pkg, 'ver') && scalar keys %{$count->{$pkg->{repo}}} > rprop($pkg, 'ver') ) { |
# Transformations that we hopefully won't have to use anymore TODO: remove if no issues |
190 |
movepkg($_, 'delete') foreach grep { $_->{rpm} eq $pkg->{rpm} } @pkgs; |
#($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
191 |
next; |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
192 |
} |
#($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
193 |
if ( rprop($pkg, 'rel') && scalar keys %{$count->{$pkg->{repo}}->{$pkg->{version}}} > rprop($pkg, 'rel') ) { |
#($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
194 |
movepkg($_, 'delete') foreach grep { $_->{rpm} eq $pkg->{rpm} } @pkgs; |
#($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
195 |
next; |
#($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
196 |
|
#($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
197 |
|
#($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
198 |
|
#($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{ && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
199 |
|
} |
200 |
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
201 |
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
202 |
|
$tmp->{svr} = $pkg->{svr}; |
203 |
|
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
204 |
|
$tmp->{added}++; |
205 |
} |
} |
206 |
} |
} |
207 |
|
|
208 |
foreach my $cmp ( grep { $_->{rpm}->is_source_package || ( ! $_->{done} && $_->{rpm} le $pkg->{rpm} && rprop($_, 'prio') <= rprop($pkg, 'prio') ) } @pkgs ) { |
my %orig = (); |
209 |
printline('dark blue', 1, ' - ', $cmp->{rpm}->filename) if $opts{d}; |
my %pkgs = (); |
210 |
if ( $cmp->{rpm}->is_source_package ) { |
my %reposrc = (); |
211 |
if ( $cmp->{name} eq $pkg->{base} ) { |
my $srpm = undef; |
212 |
if ( $cmp->{rpm} eq $pkg->{rpm} ) { |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
213 |
if ( $pkg->{repo} eq $cmp->{repo} || ! $pkg->{srpm} || $pkg->{srpm}->{rpm} ne $pkg->{rpm} ) { |
next unless $cmp->{svr} eq $pkg->{svr}; |
214 |
delete $pkg->{srpm}->{latest} if $pkg->{latest} && $pkg->{srpm} && $pkg->{srpm}->{latest}; |
|
215 |
$pkg->{srpm} = $cmp; |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
216 |
$pkg->{srpm}->{latest}++ if $pkg->{latest}; |
if ( $cmp->{src} ) { |
217 |
|
if ( ! $track{repo} ) { |
218 |
|
$cmp->{delete}++; |
219 |
|
$cmp->{done}++; |
220 |
|
next; |
221 |
|
} |
222 |
|
} else { |
223 |
|
$track{repo} = $cmp->{repo}; |
224 |
|
$track{svr} = $cmp->{svr}; |
225 |
|
} |
226 |
|
} |
227 |
|
if ( $cmp->{svr} eq $track{svr} ) { |
228 |
|
if ( $seen{$cmp->{nvra}} ) { |
229 |
|
if ( $track{repo} ne $cmp->{repo} ) { |
230 |
|
if ($repos->{$cmp->{repo}}->{stage} ) { |
231 |
|
if ( $seen{$cmp->{nvra}}->{latest} ) { |
232 |
|
$seen{$cmp->{nvra}}->{latest}++; |
233 |
|
delete $cmp->{delete} if $cmp->{delete}; |
234 |
|
} else { |
235 |
|
$cmp->{delete}++; |
236 |
|
} |
237 |
|
} elsif ( $repos->{$cmp->{repo}}->{orig} ) { |
238 |
|
$orig{$cmp->{nvra}}++; |
239 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
240 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
241 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
242 |
|
} |
243 |
|
} elsif ( $cmp->{src} ) { |
244 |
|
if ( $cmp->{delete} && $cmp->{oldrepo} && $reposrc{$cmp->{oldrepo}}) { |
245 |
|
$cmp->{repo} = $cmp->{oldrepo}; |
246 |
|
delete $cmp->{delete}; |
247 |
|
} |
248 |
|
if ( $reposrc{$cmp->{repo}} ) { |
249 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
250 |
|
$srpm = $cmp if ! $srpm; |
251 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} && ! $cmp->{done} ) { |
252 |
|
$cmp->{delete}++; |
253 |
|
} |
254 |
|
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
255 |
|
$cmp->{delete}++; |
256 |
} |
} |
257 |
if ( $pkg->{latest} && rprop($cmp, 'stage') ) { |
} elsif ( $cmp->{src} ) { |
258 |
tagpkg($cmp, 'inuse'); |
if ( $reposrc{$cmp->{repo}} && $reposrc{$cmp->{repo}}->{srpm} && $reposrc{$cmp->{repo}}->{srpm}->{oldrepo} ne $cmp->{repo} ) { |
259 |
$pkg->{srpm}->{latest}++; |
$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src} = [ |
260 |
|
grep { $_ ne $reposrc{$cmp->{repo}}->{srpm} } @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{src}} |
261 |
|
]; |
262 |
|
|
263 |
|
if ( @{$reposrc{$cmp->{repo}}->{srpm}->{repos}} == 1 ) { |
264 |
|
$reposrc{$cmp->{repo}}->{srpm}->{repo} = $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
265 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{oldrepo}; |
266 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{delete}; |
267 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{repos}; |
268 |
|
delete $reposrc{$cmp->{repo}}->{srpm}->{done}; |
269 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}} eq $reposrc{$cmp->{repo}}->{srpm}; |
270 |
|
} else { |
271 |
|
warn "How did I get here??"; |
272 |
|
} |
273 |
|
} else { |
274 |
|
$seen{$cmp->{nvra}} = $cmp if $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo}; |
275 |
} |
} |
276 |
tagpkg($cmp, 'inuse') if $pkg->{repo} eq $cmp->{repo} || rprop($cmp, 'base') || rprop($cmp, 'builds'); |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
277 |
} |
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $reposrc{$cmp->{repo}}; |
|
next if $pkg->{srpm} && $pkg->{srpm}->{rpm} eq $pkg->{rpm}; |
|
|
|
|
|
my $src = $pkg->{rpm}->sourcerpm; |
|
|
my $source = basename $cmp->{rpm}->filename; |
|
|
SRC: { |
|
|
$src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.el\d\.at(\.src)}{$1} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.el\d(\.rf\.src)}{$1} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{(\d+)\.\d+\.el\d(\.rf\.src)}{$1$2} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.el\d\.rf(\.src)}{.dag$1} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{(\d+)\.\d+\.el\d\.rf(\.src)}{$1.dag$2} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.el\d(\.src)}{$1} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{(-\d+)\.\d+\.el\d(\.src)}{$1$2} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.centos\d(\.src)}{$1} && $src eq $source && last SRC; |
|
|
($src = $pkg->{rpm}->sourcerpm) =~ s{\.el\d\.sme(\.src)}{$1} && $src eq $source && last SRC; |
|
|
$src = ''; |
|
278 |
} |
} |
279 |
if ( $src eq $source && ( ! $pkg->{srpm} || $pkg->{srpm}->{rpm} eq $cmp->{rpm} ) ) { |
} elsif ( $repos->{$cmp->{repo}}->{stage} ) { |
280 |
if ( ! $pkg->{srpm} || $pkg->{repo} eq $cmp->{repo} ) { |
$cmp->{delete}++; |
281 |
delete $pkg->{srpm}->{latest} if $pkg->{latest} && $pkg->{srpm} && $pkg->{srpm}->{latest}; |
} else { |
282 |
$pkg->{srpm} = $cmp; |
$srpm = $cmp if ! $srpm && $cmp->{src}; |
283 |
$pkg->{srpm}->{latest}++ if $pkg->{latest}; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
284 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
285 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
286 |
|
if ( $cmp->{repo} ne $dest ) { |
287 |
|
push @{$cmp->{repos}}, $dest; |
288 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
289 |
|
$orig{$cmp->{nvra}}++; |
290 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
291 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
292 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
293 |
|
} |
294 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
295 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
296 |
|
} else { |
297 |
|
$cmp->{delete}++; |
298 |
} |
} |
299 |
if ( $pkg->{latest} && rprop($cmp, 'stage') ) { |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
300 |
tagpkg($cmp, 'inuse'); |
$cmp->{repo} = $dest; |
301 |
$pkg->{srpm}->{latest}++; |
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
302 |
|
$track{repo} = $dest; |
303 |
|
$track{svr} = $cmp->{svr}; |
304 |
} |
} |
305 |
tagpkg($cmp, 'inuse') if $pkg->{repo} eq $cmp->{repo} || rprop($cmp, 'base') || rprop($cmp, 'builds'); |
} |
306 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
307 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
308 |
} |
} |
309 |
} |
} |
310 |
} elsif ( $cmp->{rpm} eq $pkg->{rpm} ) { |
} else { |
311 |
if ( $names{$cmp->{name}} ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
312 |
if ( $pkg->{repo} eq $cmp->{repo} ) { |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
313 |
tagpkg($cmp, 'correct', 1); |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
314 |
$seen{$cmp->{nvra}}++; |
} elsif ( $cmp->{src} ) { |
315 |
} elsif ( $seen{$cmp->{nvra}} && rprop($cmp, 'stage') && $pkg->{latest} ) { |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
|
$_->{latest}++ foreach grep { $_->{nvra} eq $cmp->{nvra} && $_->{latest} && $_->{done} } @pkgs; |
|
|
tagpkg($cmp, 'correct', 1); |
|
|
} elsif ( $seen{$cmp->{nvra}} ) { |
|
|
$orig++ if rprop($cmp, 'base') || rprop($cmp, 'builds'); |
|
|
movepkg($cmp, 'delete', 1); |
|
316 |
} else { |
} else { |
317 |
movepkg($cmp, $pkg->{repo}, 1, 1); |
$track{svr} = $cmp->{svr}; |
318 |
$seen{$cmp->{nvra}}++; |
} |
319 |
|
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
320 |
|
if ( $repos->{$cmp->{repo}}->{orig} ) { |
321 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
322 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
323 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
324 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
325 |
|
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
326 |
|
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
327 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
328 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
329 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
330 |
|
} |
331 |
|
push @{$cmp->{repos}}, $dest; |
332 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
333 |
|
$cmp->{repo} = $dest; |
334 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
335 |
|
$orig{$cmp->{nvra}}++; |
336 |
|
} |
337 |
|
} |
338 |
|
} else { |
339 |
|
$cmp->{delete}++; |
340 |
} |
} |
|
} else { |
|
|
tagpkg($cmp, 'nonbase'); |
|
341 |
} |
} |
|
} elsif ( rprop($cmp, 'prio') < rprop($pkg, 'prio') ) { |
|
|
tagpkg($cmp, 'obsolete'); |
|
342 |
} |
} |
343 |
|
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
344 |
|
$pkgs{$cmp->{nvra}}++; |
345 |
|
$latest{$cmp->{base}} = $cmp->{svr} if $repos->{$cmp->{repo}}->{inc} && ! $latest{$cmp->{base}}; |
346 |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
347 |
|
if ( $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc} ) { |
348 |
|
$cmp->{latest}++ if ! $seen{$cmp->{nvra}} || $cmp->{src}; |
349 |
|
} |
350 |
|
$seen{$cmp->{nvra}} = $cmp unless $seen{$cmp->{nvra}}; |
351 |
|
push @{$acnt->{$cmp->{repo}}->{$cmp->{rpm}->as_nvre}->{$cmp->{src} ? 'src' : $cmp->{rpm}->arch}}, $cmp unless $cmp->{done}; |
352 |
|
} |
353 |
|
$cmp->{done}++; |
354 |
} |
} |
355 |
printline('dark blue', 1, ' - checking source packages') if $opts{d}; |
if ( $srpm ) { |
356 |
if ( ! $pkg->{srpm} ) { |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
357 |
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (missing source ', $pkg->{rpm}->sourcerpm, ')'); |
unless ( $reposrc{$r}->{srpm} ) { |
358 |
} elsif ( $pkg->{srpm}->{repo} ne $pkg->{repo} ) { |
unshift @{$srpm->{repos}}, $r; |
359 |
movepkg($pkg->{srpm}, $pkg->{repo}, 0); |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
360 |
} |
$srpm->{repo} = $r; |
361 |
unless ( $orig ) { |
$reposrc{$r}->{srpm} = $srpm; |
362 |
foreach ( grep { $_->{base} eq $pkg->{base} && $_->{repo} eq $pkg->{repo} } @pkgs ) { |
} |
|
printline('bold yellow on_red', 1, ' - ', $_->{rpm}->filename, ' (missing original)'); |
|
363 |
} |
} |
364 |
|
} elsif ( scalar keys %pkgs && $opts{s} ) { |
365 |
|
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
366 |
} |
} |
367 |
|
print "\n * missing originals ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n" if $opts{o} && scalar keys %orig != scalar keys %pkgs; |
368 |
} |
} |
|
printline('bold black', 1, ' - missing stage packages') if $opts{d}; |
|
|
movepkg($_, $stage, 0) foreach grep { $_->{latest} && $_->{latest} == 1 } @pkgs; |
|
369 |
|
|
370 |
printline('bold black', 1, ' - obsolete packages') if $opts{d}; |
foreach my $r ( keys %$acnt ) { |
371 |
movepkg($_, 'delete') foreach grep { ! rprop($_, 'base') && ! $_->{done} && ( $_->{obsolete} || ( $_->{rpm}->is_source_package && ! $_->{inuse} ) ) } @pkgs; |
foreach my $p ( keys %{$acnt->{$r}} ) { |
372 |
|
foreach my $a ( keys %{$acnt->{$r}->{$p}} ) { |
|
printline('bold black', 1, ' - arch count check') if $opts{d}; |
|
|
foreach my $r ( keys %$archs ) { |
|
|
foreach my $p ( keys %{$archs->{$r}} ) { |
|
|
foreach my $a ( keys %{$archs->{$r}->{$p}} ) { |
|
|
my $p2 = ${$archs->{$r}->{$p}->{$a}}[0]; |
|
373 |
if ( $a eq 'noarch' ) { |
if ( $a eq 'noarch' ) { |
374 |
movepkg($p2, $p2->{repo}, 0) if ! $p2->{repos} && scalar @{$archs->{$r}->{$p}->{$a}} != scalar @archs; |
my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0]; |
375 |
} elsif ( scalar @{$archs->{$r}->{$p}->{$a}} != 1 ) { |
if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @archs ) { |
376 |
printline('bold yellow on_red', 1, ' - ', $p2->{rpm}->filename, ' (many arch)'); |
$p2->{oldrepo} = $p2->{repo}; |
377 |
|
push @{$p2->{repos}}, $p2->{repo}; |
378 |
|
} |
379 |
|
} elsif ( scalar @{$acnt->{$r}->{$p}->{$a}} != 1 ) { |
380 |
|
print "\n * many packages ($r, $a, $p)\n"; |
381 |
} |
} |
382 |
} |
} |
383 |
} |
} |
384 |
} |
} |
|
} |
|
|
printline('white', 0, "Finished processing.\n"); |
|
385 |
|
|
386 |
unless ( $opts{t} || $opts{r} ) { |
foreach my $pkg ( sort { $a->{nvra} cmp $b->{nvra} } @{$rpms->{$base}->{rpms}} ) { |
387 |
my %repochg = (); |
if ( $pkg->{latest} && $pkg->{latest} == 1 ) { |
388 |
# Move / Copy / Delete packages and tag repo for rebuild. |
unless ( grep { $_->{nvra} eq $pkg->{nvra} && $_->{repo} eq $stage } @{$rpms->{$base}->{rpms}} ) { |
389 |
foreach my $pkg ( grep { $_->{oldrepo} } @rpms ) { |
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
390 |
printline('white', 0, 'Copy/move: ', $pkg->{rpm}->filename); |
$pkg->{repo} = $stage; |
391 |
|
push @{$pkg->{repos}}, $stage; |
392 |
|
} |
393 |
|
} |
394 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
395 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
396 |
|
$print++; |
397 |
|
} |
398 |
|
|
399 |
my $src = $pkg->{rpm}->filename; |
my $src = $pkg->{rpm}->filename; |
400 |
|
if ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) { |
401 |
|
print "sign package (", basename($pkg->{rpm}->filename), ")\n"; |
402 |
|
unless ( $opts{t} ) { |
403 |
|
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null); |
404 |
|
if ($?) { |
405 |
|
print " * failed to sign package\n"; |
406 |
|
next; |
407 |
|
} |
408 |
|
} |
409 |
|
} |
410 |
|
|
|
qx(cat $HOME/.rpmpass | setsid rpm --addsign $src >& /dev/null) if $pkg->{nosig}; |
|
411 |
if ( $pkg->{repos} ) { |
if ( $pkg->{repos} ) { |
412 |
foreach my $dest ( dest($pkg, @{$pkg->{repos}}) ) { |
foreach my $repo ( @{$pkg->{repos}} ) { |
413 |
qx(cp --preserve=timestamps $src $dest) unless -f "$dest"; |
if ( $pkg->{delete} ) { |
414 |
|
print "move from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
415 |
|
$pkg->{delete} = 0; |
416 |
|
$repochg{$pkg->{oldrepo}}++ unless $repos->{$pkg->{oldrepo}}->{base} || $repos->{$pkg->{oldrepo}}->{stage}; |
417 |
|
} elsif ( $pkg->{oldrepo} eq $repo ) { |
418 |
|
print "distribute noarch in $repo (", basename($pkg->{rpm}->filename), ")\n"; |
419 |
|
} else { |
420 |
|
print "copy from ", $pkg->{oldrepo}, " to $repo (", basename($pkg->{rpm}->filename), ")\n"; |
421 |
|
} |
422 |
|
$repochg{$repo}++ unless $repos->{$repo}->{base} || $repos->{$repo}->{stage}; |
423 |
|
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
424 |
|
|
425 |
|
my @d = (); |
426 |
|
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
427 |
|
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
428 |
|
my $tail = $repos->{$repo}->{os} ? "$osdir/" . $distrepo->{$ver}->{os} : 'RPMS/'; |
429 |
|
if ( $pkg->{src} ) { |
430 |
|
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
431 |
|
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
432 |
|
push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @archs; |
433 |
|
} elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) { |
434 |
|
push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename); |
435 |
|
} else { |
436 |
|
push @d, $head . $pkg->{rpm}->arch . "/$tail" . basename($pkg->{rpm}->filename); |
437 |
|
} |
438 |
|
foreach my $dest ( @d ) { |
439 |
|
qx(cp --preserve=timestamps $src $dest) unless $opts{t} || -f "$dest"; |
440 |
|
} |
441 |
|
|
442 |
|
} |
443 |
|
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
444 |
|
} elsif ( $pkg->{delete} ) { |
445 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
446 |
|
qx(rm -f $src) unless $opts{t}; |
447 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
448 |
|
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
449 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
450 |
|
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
451 |
} |
} |
|
$repochg{$_}++ foreach @{$pkg->{repos}}; |
|
|
} |
|
|
if ( $pkg->{remove} ) { |
|
|
qx(rm -f $src); |
|
|
$repochg{$pkg->{oldrepo}}++; |
|
452 |
} |
} |
453 |
} |
} |
|
finddepth(sub{rmdir}, $distrepo->{$rel}->{builds}); |
|
|
printline('white', 0, "Finished copying/moving.\n"); |
|
454 |
|
|
455 |
foreach my $repo ( sort keys %repochg ) { |
if ( $rpms->{$base}->{srpms} ) { |
456 |
next if ! $repos->{$repo} || $repos->{$repo}->{base} || $repos->{$repo}->{builds} || $repos->{$repo}->{stage}; |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
457 |
foreach my $arch ( @archs ) { |
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
458 |
my $dir = $distrepo->{$rel}->{repo} . "$repo/$arch"; |
$pkg->{delete}++; |
459 |
$dir = qx(readlink -f $dir); |
my $src = $pkg->{rpm}->filename; |
460 |
chomp $dir; |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || ( $pkg->{nosig} && $distrepo->{$ver}->{sign} ) ) ) { |
461 |
printline('white', 0, "Createrepo: $repo/$arch"); |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
462 |
qx(createrepo $dir); |
$print++; |
463 |
printline('white', 0, "Repoview: $repo/$arch"); |
} |
464 |
qx(repoview $dir); |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
465 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -f $src) unless $opts{t}; |
466 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
467 |
} |
} |
468 |
} |
} |
|
printline('white', 0, "Finished rebuilding repos.\n"); |
|
469 |
} |
} |
470 |
|
|
471 |
print "\n================================================================================\n\n"; |
if ( %repochg ) { |
472 |
} |
print "\nrebuild repo ($disttag$ver)\n", "=" x length("rebuild repo ($disttag$ver)"), "\n"; |
473 |
|
} |
474 |
|
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
475 |
|
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
476 |
|
foreach my $arch ( @archs ) { |
477 |
|
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
478 |
|
$dir = qx(readlink -f $dir); |
479 |
|
chomp $dir; |
480 |
|
print "rebuild $repo/$arch\n"; |
481 |
|
unless ( $opts{t} ) { |
482 |
|
my $checksum = "--checksum $distrepo->{$ver}->{checksum}"; |
483 |
|
|
484 |
sub pkgsrt { |
my $exclude = ""; |
485 |
return $a->{rpm}->is_source_package <=> $b->{rpm}->is_source_package || $b->{rpm} cmp $a->{rpm} || rprop($b, 'prio') <=> rprop($a, 'prio'); |
$exclude = "--exclude *smeserver-release*.rpm" if $dir =~ m{test/|-testing/}; |
|
} |
|
486 |
|
|
487 |
sub rprop { |
my $groupfile = ""; |
488 |
my ($pkg, $prop) = @_; |
$groupfile = "--groupfile repodata/comps.xml" if -f "$dir/repodata/comps.xml"; |
|
return $repos->{$pkg->{repo}} ? $repos->{$pkg->{repo}}->{$prop} : 0; |
|
|
} |
|
489 |
|
|
490 |
sub names { |
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $checksum $exclude $groupfile $dir); |
491 |
my $pkg = shift; |
qx(repoview $dir); |
|
my @rpms = @_; |
|
|
return map { $_->{name} => rprop($_, 'inc') ? 2 : 1 } grep { $_->{base} eq $pkg->{base} && |
|
|
rprop($_, 'prio') >= rprop($pkg, 'prio') && |
|
|
! rprop($_, 'base') && |
|
|
! rprop($_, 'builds') && |
|
|
! $_->{rpm}->is_source_package |
|
|
} @rpms; |
|
|
} |
|
492 |
|
|
493 |
sub dest { |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
494 |
my ($pkg, @repos) = @_; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
495 |
my @d = (); |
qx(rm -rf $dir/repodata/index.html) if -f "$dir/repodata/index.html"; |
496 |
foreach my $repo ( @repos ) { |
qx(rm -rf $dir/repodata/update-info) if -d "$dir/repodata/update-info"; |
497 |
my $base = $distrepo->{$rel}->{repo} . $repo; |
qx(rm -rf $dir/repodata/repoview) if -d "$dir/repodata/repoview"; |
498 |
$base = $distrepo->{$rel}->{stage} if $repos->{$repo}->{stage}; |
} |
|
if ( $pkg->{arch} eq 'noarch' ) { |
|
|
push @d, "$base/i386/" . |
|
|
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
|
|
basename $pkg->{rpm}->filename; |
|
|
push @d, "$base/x86_64/" . |
|
|
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
|
|
basename $pkg->{rpm}->filename; |
|
|
} elsif ( $pkg->{arch} =~ m{^(i[356]86)$} ) { |
|
|
push @d, "$base/i386/" . |
|
|
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
|
|
basename $pkg->{rpm}->filename; |
|
|
} elsif ( $pkg->{arch} eq 'x86_64' ) { |
|
|
push @d, "$base/x86_64/" . |
|
|
( $repos->{$repo}->{os} ? $distrepo->{$rel}->{os} : 'RPMS/' ) . |
|
|
basename $pkg->{rpm}->filename; |
|
|
} elsif ( $pkg->{arch} eq 'zsrc' ) { |
|
|
push @d, "$base/SRPMS/" . |
|
|
basename $pkg->{rpm}->filename; |
|
|
} else { |
|
|
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (bad arch: ', $pkg->{arch}, ')'); |
|
499 |
} |
} |
500 |
} |
} |
501 |
return @d; |
unless ( $opts{t} ) { |
502 |
} |
finddepth(sub{rmdir}, $distrepo->{$ver}->{builds}) if -d "$distrepo->{$ver}->{builds}"; |
503 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
|
sub movepkg { |
|
|
my ($pkg, $repo, $done, $remove) = @_; |
|
|
defined $done or $done = 2; |
|
|
defined $remove or $remove = 0; |
|
|
$remove = 0 if rprop($pkg, 'base') || rprop($pkg, 'builds'); |
|
|
$remove = 1 if $repo eq 'delete'; |
|
|
|
|
|
if ( $repo eq 'delete' && ( rprop($pkg, 'base') || ( rprop($pkg, 'builds') && $done == 1 ) ) ) { |
|
|
tagpkg($pkg, 'inuse', 1); |
|
|
} else { |
|
|
printline('bold magenta', 1, " - ($repo) ", $pkg->{rpm}->filename) if $opts{d}; |
|
|
my $color = 'bold white'; |
|
|
$color = 'bold yellow' if rprop($pkg, 'builds'); |
|
|
$color = 'dark green' if $repos->{$repo} && $repos->{$repo}->{devel}; |
|
|
$color = 'dark red' if $repo eq 'delete'; |
|
|
push @{$pkg->{repos}}, $repo unless $repo eq 'delete'; |
|
|
$pkg->{oldrepo} = $pkg->{repo} unless $pkg->{oldrepo}; |
|
|
$pkg->{repo} = $repo; |
|
|
$pkg->{remove}++ if $remove; |
|
|
printline($color, 1, ' - ', $pkg->{rpm}->filename, ' (', $pkg->{oldrepo}, " to $repo)") if $opts{v} || $opts{d}; |
|
|
done($pkg) if $done; |
|
504 |
} |
} |
505 |
} |
} |
506 |
|
|
507 |
sub tagpkg { |
sub verrel { |
508 |
my ($pkg, $tag, $done) = @_; |
my $pkg = shift; |
509 |
defined $done or $done = 0; |
my $repo = shift; |
510 |
|
my $counts = shift; |
511 |
printline('bold magenta', 1, " - ($tag) ", $pkg->{rpm}->filename) if $opts{d}; |
|
512 |
delete $pkg->{obsolete} if $pkg->{obsolete}; |
return 0 if $pkg->{src}; |
513 |
$pkg->{$tag}++; |
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
514 |
done($pkg) if $done; |
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
515 |
|
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
516 |
|
return 0; |
517 |
} |
} |
518 |
|
|
519 |
sub done { |
sub pkgdest { |
520 |
my $pkg = shift; |
my $pkg = shift; |
521 |
printline('bold yellow on_red', 1, " - ", $pkg->{rpm}->filename, " (already processed)") if $pkg->{done}; |
my $dest = shift; |
522 |
$pkg->{done}++; |
my $hirepo = shift; |
523 |
delete $pkg->{obsolete} if $pkg->{obsolete}; |
my $pkgs = shift; |
524 |
|
|
525 |
if ( $repos->{$pkg->{repo}} && ! rprop($pkg, 'base') && ! rprop($pkg, 'builds') ) { |
foreach my $cmp ( @$pkgs ) { |
526 |
# FIXME: Nasty hack for comps package |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
527 |
if ( $pkg->{name} eq 'comps' ) { |
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
528 |
if ( ! $latest{$pkg->{name}.'.'.$pkg->{arch}} || $latest{$pkg->{name}.'.'.$pkg->{arch}}->{rpm} eq $pkg->{rpm} ) { |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
529 |
if ( rprop($pkg, 'inc') && ! $pkg->{rpm}->is_source_package ) { |
$dest = $hirepo; |
530 |
$latest{$pkg->{name}.'.'.$pkg->{arch}} = $pkg if ! $latest{$pkg->{name}.'.'.$pkg->{arch}}; |
last; |
531 |
$pkg->{latest}++; |
} else { |
532 |
} |
$dest = $cmp->{repo}; |
|
} |
|
|
} elsif ( ! $latest{$pkg->{name}} || $latest{$pkg->{name}}->{rpm} eq $pkg->{rpm} ) { |
|
|
if ( rprop($pkg, 'inc') && ! $pkg->{rpm}->is_source_package ) { |
|
|
$latest{$pkg->{name}} = $pkg if ! $latest{$pkg->{name}}; |
|
|
$pkg->{latest}++; |
|
|
} |
|
|
} |
|
|
unless ( $pkg->{oldrepo} ) { |
|
|
my $goodarch = 0; |
|
|
$goodarch++ if $pkg->{rpm}->filename =~ m{/(i386|x86_64)/.*\.noarch\.rpm$}; |
|
|
$goodarch++ if $pkg->{rpm}->filename =~ m{/i386/.*\.(i[56]86)\.rpm$}; |
|
|
$goodarch++ if $pkg->{rpm}->filename =~ m{/(noarch|i[356]86|x86_64)/.*\.\1\.rpm$}; |
|
|
printline('bold yellow on_red', 1, ' - ', $pkg->{rpm}->filename, ' (wrong arch)') unless $goodarch; |
|
533 |
} |
} |
|
push @{$archs->{$pkg->{repo}}->{$pkg->{rpm}->as_nvre}->{$pkg->{rpm}->is_source_package ? 'src' : $pkg->{rpm}->arch}}, $pkg; |
|
534 |
} |
} |
535 |
|
return $dest; |
536 |
} |
} |
537 |
|
|
538 |
sub printline { |
sub process_rpm { |
539 |
my $color = shift; |
my $rpm = shift; |
540 |
my $nline = shift; |
my $ver = shift; |
541 |
my $string = join '', @_; |
my $repo = shift; |
542 |
|
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
543 |
if ( $nline ) { |
my $base = $1; |
544 |
print "\n" unless $newline; |
return unless ! $opts{r} || $base =~ m[$opts{r}]; |
545 |
$newline++; |
return unless $latest{$base} || $sources{$base} || ! $repos->{$repo}->{base}; |
|
} else { |
|
|
$newline = 0; |
|
|
print "\r\e[0K"; |
|
|
} |
|
|
print color $color; |
|
|
print $string; |
|
|
print color 'reset'; |
|
|
print "\n" if $nline; |
|
|
} |
|
|
|
|
|
sub loadpkg { |
|
|
printline('white', 0, "Loading: $_") if -d _; |
|
|
return unless m{/([^/]*)-[^-]+-[^-]+\.\w+.rpm} && ( ! $opts{r} || $1 =~ m{$opts{r}} ); |
|
546 |
|
|
547 |
my $pkg; |
my $pkg; |
548 |
eval { $pkg = RPM2->open_package($_, $rpm_flags); }; |
eval { $pkg = RPM2->open_package($rpm, $rpm_flags); }; |
549 |
if ($@) { printline('bold yellow on_red', 1, "Corrupt package $_"); return; } |
if ($@) { print " * corrupt package ($rpm)\n"; return; } |
550 |
eval { my $sig = $pkg->siggpg }; |
eval { my $sig = $pkg->siggpg }; |
551 |
my $nosig = ! $@; |
my $nosig = ! $@; |
|
if ( $nosig && ! -f "$HOME/.rpmpass" ) { |
|
|
printline('bold yellow on_red', 1, ' - ', $pkg->filename, ' (missing signature)'); |
|
|
return; |
|
|
} |
|
552 |
|
|
|
my ($srcname, $version, $release) = ($pkg->is_source_package ? basename $pkg->filename : $pkg->sourcerpm) =~ m{^([^/]*)-([^-]+)-([^-]+)\.\w+.rpm}; |
|
|
foreach my $repo ( keys %{$skippkg->{$rel}} ) { return if (dirname $pkg->filename) =~ m{/$repo/} && grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; } |
|
|
my $reponame = 'unknown'; |
|
|
if ( substr($_, 0, length($distrepo->{$rel}->{builds})) eq $distrepo->{$rel}->{builds} ) { |
|
|
$reponame = 'builds'; |
|
|
} elsif ( substr($_, 0, length($distrepo->{$rel}->{stage})) eq $distrepo->{$rel}->{stage} ) { |
|
|
$reponame = 'stage'; |
|
|
} elsif ( (dirname $pkg->filename) =~ m{\d/(sme[^/]+)/} ) { |
|
|
$reponame = $1; |
|
|
} |
|
|
|
|
|
push @rpms, { base => $srcname, |
|
|
name => $pkg->name, |
|
|
repo => $reponame, |
|
|
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
|
|
arch => $pkg->is_source_package ? 'zsrc' : $pkg->tag('ARCH'), |
|
|
version => $version, |
|
|
release => $release, |
|
|
rpm => $pkg, |
|
|
nosig => $nosig, |
|
|
}; |
|
|
$sources{$srcname}++; |
|
|
$latest{$pkg->name} = $rpms[$#rpms] if ! $pkg->is_source_package && ( ! $latest{$pkg->name} || $pkg gt $latest{$pkg->name}->{rpm} ); |
|
|
} |
|
|
|
|
|
sub loadbase { |
|
|
printline('white', 0, "Loading: $_") if -d _; |
|
|
return unless m{/([^/]*)-[^-]+-[^-]+\.\w+.rpm} && ($latest{$1} || $sources{$1}); |
|
|
|
|
|
my $pkg; |
|
|
eval { $pkg = RPM2->open_package($_, $rpm_flags); }; |
|
|
if ($@) { printline('bold yellow on_red', 1, "Corrupt package $_"); return; } |
|
|
eval { my $sig = $pkg->siggpg }; |
|
|
unless ($@) { printline('bold yellow on_red', 1, ' - ', $pkg->filename, ' (missing signature)'); return; } |
|
|
|
|
553 |
my $cmp = $latest{$pkg->name}; |
my $cmp = $latest{$pkg->name}; |
554 |
my ($srcname, $version, $release) = ($pkg->is_source_package ? basename $pkg->filename : $pkg->sourcerpm) =~ m{^([^/]*)-([^-]+)-([^-]+)\.\w+.rpm}; |
if ( $repos->{$repo}->{base} && ! $pkg->is_source_package ) { |
555 |
my $pkgrepo = 'base'; |
return unless $cmp; |
556 |
foreach my $repo ( keys %{$skippkg->{$rel}} ) { |
return if $repos->{$cmp->{repo}}->{base} && $repos->{$cmp->{repo}}->{prio} > $repos->{$repo}->{prio} && $pkg ge $cmp->{rpm}; |
557 |
if ( (dirname $pkg->filename) =~ m{/$repo/} ) { |
} |
558 |
return if grep { $_ eq $srcname } @{$skippkg->{$rel}->{$repo}}; |
my ($src, $version, $release) = ($pkg->is_source_package ? $pkg->filename : $pkg->sourcerpm) =~ m{(?:^|/)([^/]*)-([^-]+)-([^-]+)\.\w+\.rpm$}; |
559 |
$pkgrepo = $repo; |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
560 |
return unless $pkg->is_source_package || $cmp; |
return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign}; |
561 |
return if ! $pkg->is_source_package && $pkg gt $cmp->{rpm} && rprop($cmp, 'base') && rprop($cmp, 'prio') > $repos->{$pkgrepo}->{prio}; |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
562 |
last; |
my $arch = 'unknown'; |
563 |
} |
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
564 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
565 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
566 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
567 |
|
|
568 |
|
my $rpmhash = { base => $src, |
569 |
|
name => $pkg->name, |
570 |
|
repo => $repo, |
571 |
|
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
572 |
|
svr => $src.'-'.$version.'-'.$release, |
573 |
|
src => $pkg->is_source_package, |
574 |
|
arch => $arch, |
575 |
|
ver => $version, |
576 |
|
rel => $release, |
577 |
|
rpm => $pkg, |
578 |
|
nosig => $nosig, |
579 |
|
}; |
580 |
|
if ( $pkg->is_source_package ) { |
581 |
|
push @{$rpms->{$src}->{srpms}}, $rpmhash; |
582 |
|
push @{$rpms->{$src}->{vers}->{$rpmhash->{svr}}}, $rpmhash; |
583 |
|
} else { |
584 |
|
push @{$rpms->{$src}->{rpms}}, $rpmhash; |
585 |
} |
} |
586 |
|
$sources{$src}++; |
587 |
|
|
588 |
push @rpms, { base => $srcname, |
return if $pkg->is_source_package || $repos->{$repo}->{stage}; |
589 |
name => $pkg->name, |
if ( ! $repos->{$repo}->{base} ) { |
590 |
repo => $pkgrepo, |
if ( ! $cmp || $pkg gt $cmp->{rpm} ) { |
591 |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
$latest{$pkg->name} = $rpmhash; |
592 |
arch => $pkg->is_source_package ? 'zsrc' : $pkg->tag('ARCH'), |
} |
593 |
version => $version, |
} elsif ( ( $repos->{$repo}->{prio} >= $repos->{$cmp->{repo}}->{prio} || ! $repos->{$cmp->{repo}}->{base} ) && $pkg ge $cmp->{rpm} ) { |
594 |
release => $release, |
$latest{$pkg->name} = $rpmhash; |
|
rpm => $pkg, |
|
|
nosig => 0, |
|
|
}; |
|
|
if ( ! $pkg->is_source_package && $pkg ge $cmp->{rpm} && ( $repos->{$pkgrepo}->{prio} >= rprop($cmp, 'prio') || ! rprop($cmp, 'base') ) ) { |
|
|
$latest{$pkg->name} = $rpms[$#rpms]; |
|
595 |
} |
} |
596 |
} |
} |
|
|
|