14 |
$| = 1; |
$| = 1; |
15 |
|
|
16 |
my %opts; |
my %opts; |
17 |
getopts( 'otr:', \%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_nosha1header | RPM2->vsf_nomd5header | RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader; |
21 |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
$rpm_flags |= RPM2->vsf_nosha1 | RPM2->vsf_nomd5 | RPM2->vsf_nodsa | RPM2->vsf_norsa; |
22 |
|
|
23 |
|
my $osdir = 'SME'; |
24 |
|
my $disttag = 'sme'; |
25 |
|
my $repotag = 'sme'; |
26 |
|
|
27 |
my @archs = ( 'i386', 'x86_64' ); |
my @archs = ( 'i386', 'x86_64' ); |
28 |
|
|
29 |
my $distrepo = { '7' => { active => 1, |
my $distrepo = { '7' => { active => 1, |
30 |
centos => 4, |
centos => 4, |
31 |
fedora => 3, |
repo => '/releases/7/', |
32 |
repo => '/releases/7/', |
os => 'RPMS/', |
33 |
os => 'RPMS/', |
builds => '/builds/smeserver-7-core/', |
34 |
builds => '/builds/smeserver-7-core/', |
community => '/builds/smeserver-7-contribs/', |
35 |
contribs => '/builds/smeserver-7-contribs/', |
stage => '/stage/7/', |
|
qa => '/builds/smeserver-7-qa/', |
|
|
stage => '/stage/7/', |
|
36 |
}, |
}, |
37 |
'8' => { active => 1, |
'8' => { active => 1, |
38 |
centos => 5, |
centos => 5, |
39 |
fedora => 6, |
repo => '/releases/testing/8/', |
40 |
repo => '/releases/testing/8/', |
os => '', |
41 |
os => '', |
builds => '/builds/smeserver-8-core/', |
42 |
builds => '/builds/smeserver-8-core/', |
community => '/builds/smeserver-8-contribs/', |
43 |
contribs => '/builds/smeserver-8-contribs/', |
stage => '/stage/8/', |
|
qa => '/builds/smeserver-8-qa/', |
|
|
stage => '/stage/8/', |
|
44 |
}, |
}, |
45 |
}; |
}; |
46 |
|
|
47 |
my $repos = { 'smeos' => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
my $repos = { "${repotag}os" => { prio => 18, inc => 1, ver => 1, rel => 1, os => 1 }, |
48 |
'smeupdates' => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates" => { prio => 17, inc => 1, ver => 1, rel => 1 }, |
49 |
'smeupdates-testing' => { prio => 16, inc => 1, ver => 1, rel => 1 }, |
"${repotag}updates-testing" => { prio => 16, inc => 1, ver => 1, rel => 3 }, |
50 |
'smeextras' => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
"${repotag}extras" => { prio => 15, inc => 0, ver => 1, rel => 1 }, |
51 |
'smeaddons' => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
"${repotag}addons" => { prio => 14, inc => 0, ver => 1, rel => 1 }, |
52 |
'smecontribs' => { prio => 13, inc => 0, ver => 1, rel => 2 }, |
"${repotag}contribs" => { prio => 13, inc => 0, ver => 1, rel => 1 }, |
53 |
'smetest' => { prio => 12, inc => 0, ver => 2, rel => 2, devel => 2 }, |
"${repotag}test" => { prio => 12, inc => 0, ver => 2, rel => 3, devel => 2 }, |
54 |
'smedev' => { prio => 11, inc => 0, ver => 2, rel => 2, devel => 1 }, |
"${repotag}dev" => { prio => 11, inc => 0, ver => 1, rel => 1, devel => 1 }, |
55 |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'centos' => { prio => 10, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
56 |
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'epel' => { prio => 9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
57 |
'fedora-extras' => { prio => 8, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
58 |
'rpmforge' => { prio => 7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
59 |
'atrpms' => { prio => 6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
60 |
'fedora' => { prio => 5, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 }, |
'community' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
61 |
'builds' => { prio => 4, inc => 0, ver => 0, rel => 0, orig => 1 }, |
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
'contribs' => { prio => 2, inc => 0, ver => 0, rel => 0, orig => 1 }, |
|
|
'stage' => { prio => 1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 }, |
|
62 |
}; |
}; |
63 |
|
|
64 |
my $baserepo = { '~Ssmeos/~A/SME/~O' => 'smeos', |
my $baserepo = { "~S${repotag}os/~A/$osdir/~O" => "${repotag}os", |
65 |
'~Ssmeupdates/~A/RPMS/' => 'smeupdates', |
"~S${repotag}updates/~A/RPMS/" => "${repotag}updates", |
66 |
'~Ssmeupdates-testing/~A/RPMS/' => 'smeupdates-testing', |
"~S${repotag}updates-testing/~A/RPMS/" => "${repotag}updates-testing", |
67 |
'~Ssmeextras/~A/RPMS/' => 'smeextras', |
"~S${repotag}extras/~A/RPMS/" => "${repotag}extras", |
68 |
'~Ssmeaddons/~A/RPMS/' => 'smeaddons', |
"~S${repotag}addons/~A/RPMS/" => "${repotag}addons", |
69 |
'~Ssmecontribs/~A/RPMS/' => 'smecontribs', |
"~S${repotag}contribs/~A/RPMS/" => "${repotag}contribs", |
70 |
'~Ssmetest/~A/RPMS/' => 'smetest', |
"~S${repotag}test/~A/RPMS/" => "${repotag}test", |
71 |
'~Ssmedev/~A/RPMS/' => 'smedev', |
"~S${repotag}dev/~A/RPMS/" => "${repotag}dev", |
72 |
'/stage/~s/~A/SME/~O' => 'stage', |
"/stage/~s/~A/$osdir/~O" => 'stage', |
73 |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/fasttrack/~A/RPMS/' => 'centos', |
74 |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/updates/~A/RPMS/' => 'centos', |
75 |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
'/mirrors/centos/~C/os/~A/CentOS/~O' => 'centos', |
76 |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
'/mirrors/centos/~C/extras/~A/RPMS/' => 'centos', |
|
'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O' => 'centos', |
|
|
'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/' => 'centos', |
|
77 |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/~C/~A/' => 'epel', |
78 |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
'/mirrors/fedora/epel/testing/~C/~A/' => 'epel', |
|
'/mirrors/fedora/extras/~F/~A/' => 'fedora-extras', |
|
79 |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
'/mirrors/rpmforge/dag/redhat/el~C/en/~A/dag/RPMS/' => 'rpmforge', |
80 |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
'/mirrors/rpmforge/dag/source/' => 'rpmforge', |
81 |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/stable/' => 'atrpms', |
82 |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/el~C-~A/atrpms/testing/' => 'atrpms', |
83 |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/stable/' => 'atrpms', |
84 |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
'/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms', |
|
'/mirrors/fedora/core/~F/~A/os/Fedora/RPMS/' => 'fedora', |
|
|
'/mirrors/fedora/core/updates/~F/~A/' => 'fedora', |
|
85 |
}; |
}; |
86 |
|
|
87 |
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3', 'vim' ) }, |
if ( $opts{q} ) { |
88 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent' ) }, |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/fasttrack/~A/RPMS/'} = 'centos'; |
89 |
'rpmforge' => { map { $_ => 1 } ( 'perl-Test-Inline' ) }, |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/updates/~A/RPMS/'} = 'centos'; |
90 |
'atrpms' => { map { $_ => 1 } ( 'dovecot', 'trac', 'yum' ) }, |
$baserepo->{'/mirrors/centos-qa/CentOS/~C/os/~A/CentOS/~O'} = 'centos'; |
91 |
|
$baserepo->{'/mirrors/centos-qa/CentOS/~C/extras/~A/RPMS/'} = 'centos'; |
92 |
|
} |
93 |
|
|
94 |
|
my $skippkg = { '7' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
95 |
|
'epel' => { map { $_ => 1 } ( 'clamav', 'fping', 'ocsinventory', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-DateTime', 'perl-Razor-Agent', 'perl-Text-Iconv', 'proftpd' ) }, |
96 |
|
'rpmforge' => { map { $_ => 1 } ( 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
97 |
|
'atrpms' => { map { $_ => 1 } ( 'check4updates', 'dovecot', 'trac', 'yum' ) }, |
98 |
}, |
}, |
99 |
'8' => { 'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
'8' => { 'atrpms' => { map { $_ => 1 } ( 'gnupg' ) }, |
100 |
'fedora' => { map { $_ => 1 } ( 'kernel-xen' ) }, |
'centos' => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) }, |
101 |
'epel' => { map { $_ => 1 } ( 'perl-Razor-Agent', 'smolt' ) }, |
'epel' => { map { $_ => 1 } ( 'clamav', 'horde', 'libtalloc', 'libtdb', 'perl-Compress-Bzip2', 'perl-Compress-Raw-Zlib', 'perl-Compress-Raw-Bzip2', 'perl-Crypt-OpenSSL-Bignum', 'perl-Crypt-OpenSSL-Random', 'perl-Crypt-OpenSSL-RSA', 'perl-Razor-Agent', 'proftpd', 'smolt' ) }, |
102 |
'fedora-extras' => { map { $_ => 1 } ( 'dstat', 'gocr', 'horde', 'oidentd', 'perl-Test-Inline', 'perl-Razor-Agent', 'smolt' ) }, |
'rpmforge' => { map { $_ => 1 } ( 'libtalloc', 'mod_auth_tkt', 'perl-Test-Inline', 'spamassassin' ) }, |
|
'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/~O/$distrepo->{$ver}->{os}/; |
122 |
$bdir =~ s/~S/$distrepo->{$smever}->{repo}/; |
$bdir =~ s/~S/$distrepo->{$ver}->{repo}/; |
123 |
$bdir =~ s/~s/$smever/; |
$bdir =~ s/~s/$ver/; |
124 |
$bdir =~ s/~C/$distrepo->{$smever}->{centos}/; |
$bdir =~ s/~C/$distrepo->{$ver}->{centos}/; |
|
$bdir =~ s/~F/$distrepo->{$smever}->{fedora}/; |
|
125 |
for my $arch ( @archs, 'SRPMS/' ) { |
for my $arch ( @archs, 'SRPMS/' ) { |
126 |
my $adir = $bdir; |
my $adir = $bdir; |
127 |
if ( $arch eq 'SRPMS/' ) { |
if ( $arch eq 'SRPMS/' ) { |
128 |
$adir =~ s/~A.*/$arch/ if $arch eq 'SRPMS/'; |
$adir =~ s/~A.*/$arch/; |
129 |
} else { |
} else { |
130 |
$adir =~ s/~A/$arch/; |
$adir =~ s/~A/$arch/; |
131 |
} |
} |
132 |
opendir DIR, $adir or next; |
opendir DIR, $adir or next; |
133 |
next unless -d $adir; |
next unless -d $adir; |
134 |
process_rpm("$adir$_", $smever, $baserepo->{$dir}) foreach readdir DIR; |
process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR; |
135 |
closedir DIR; |
closedir DIR; |
136 |
last unless $dir =~ m{~A}; |
last unless $dir =~ m{~A}; |
137 |
} |
} |
138 |
} |
} |
139 |
find( { wanted => sub { process_rpm($_, $smever, 'builds'); }, no_chdir => 1, follow_fast => 1 }, ( $distrepo->{$smever}->{'builds'}, $distrepo->{$smever}->{'qa'} ) ); |
find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'builds'} ); |
140 |
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'}; |
141 |
|
|
142 |
foreach my $base ( sort keys %$rpms ) { |
foreach my $base ( sort keys %$rpms ) { |
143 |
|
next unless $rpms->{$base}->{rpms}; |
144 |
my %track = (); |
my %track = (); |
145 |
my %seen = (); |
my %seen = (); |
146 |
my %counts = (); |
my %counts = (); |
151 |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{rpms}} ) { |
152 |
next if $pkg->{done}; |
next if $pkg->{done}; |
153 |
|
|
154 |
if ( $rpms->{$base}->{vers}->{$pkg->{svr}} ) { |
my $tmp = $pkg->{svr}; |
155 |
foreach my $tmp ( @{$rpms->{$base}->{vers}->{$pkg->{svr}}} ) { |
SRC: { |
156 |
|
$rpms->{$base}->{vers}->{$tmp} && last SRC; |
157 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
158 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
159 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
160 |
|
($tmp = $pkg->{svr}) =~ s{(\.el\d)\.rf$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
161 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.el5} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
162 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
163 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
164 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
165 |
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
166 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
167 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d_}{_} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
168 |
|
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
169 |
|
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
170 |
|
($tmp = $pkg->{svr}) =~ s{\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
171 |
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.$disttag$}{} && $rpms->{$base}->{vers}->{$tmp} && last SRC; |
172 |
|
} |
173 |
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
174 |
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
175 |
$tmp->{svr} = $pkg->{svr}; |
$tmp->{svr} = $pkg->{svr}; |
176 |
push @{$rpms->{$base}->{rpms}}, $tmp; |
push @{$rpms->{$base}->{rpms}}, $tmp unless $tmp->{added}; |
177 |
} |
$tmp->{added}++; |
|
} else { |
|
|
my $tmp = $pkg->{svr}; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.at$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d(\.rf)$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d(\.rf)$}{$1$2} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.rf$}{.dag} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(\d+)\.\d+\.el\d\.rf$}{$1.dag} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{(-\d+)\.\d+\.el\d$}{$1} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.centos\d$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
($tmp = $pkg->{svr}) =~ s{\.el\d\.sme$}{} && $rpms->{$base}->{vers}->{$tmp} && last; |
|
|
if ( $rpms->{$base}->{vers}->{$tmp} ) { |
|
|
foreach $tmp ( @{$rpms->{$base}->{vers}->{$tmp}} ) { |
|
|
$tmp->{svr} = $pkg->{svr}; |
|
|
push @{$rpms->{$base}->{rpms}}, $tmp; |
|
|
} |
|
178 |
} |
} |
179 |
} |
} |
180 |
|
|
182 |
my %pkgs = (); |
my %pkgs = (); |
183 |
my %reposrc = (); |
my %reposrc = (); |
184 |
my $srpm = undef; |
my $srpm = undef; |
185 |
foreach my $cmp ( sort { $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} || $a->{src} <=> $b->{src} } @{$rpms->{$base}->{rpms}} ) { |
foreach my $cmp ( sort { $a->{src} <=> $b->{src} || $repos->{$b->{repo}}->{prio} <=> $repos->{$a->{repo}}->{prio} } @{$rpms->{$base}->{rpms}} ) { |
186 |
next unless $cmp->{svr} eq $pkg->{svr}; |
next unless $cmp->{svr} eq $pkg->{svr}; |
187 |
|
|
188 |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
if ( ! $track{repo} || $repos->{$cmp->{repo}}->{prio} > $repos->{$track{repo}}->{prio} ) { |
|
$track{repo} = $cmp->{repo}; |
|
|
$track{svr} = $cmp->{svr}; |
|
|
} |
|
|
if ( $cmp->{svr} eq $track{svr} ) { |
|
189 |
if ( $cmp->{src} ) { |
if ( $cmp->{src} ) { |
190 |
$srpm = $cmp unless $srpm; |
if ( ! $track{repo} ) { |
|
if ( $reposrc{$cmp->{repo}} ) { |
|
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
|
|
$cmp->{latest}++ if $reposrc{$cmp->{repo}}->{latest}; |
|
|
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
|
191 |
$cmp->{delete}++; |
$cmp->{delete}++; |
192 |
|
$cmp->{done}++; |
193 |
|
next; |
194 |
} |
} |
195 |
} elsif ( $seen{$cmp->{nvra}} ) { |
} else { |
196 |
|
$track{repo} = $cmp->{repo}; |
197 |
|
$track{svr} = $cmp->{svr}; |
198 |
|
} |
199 |
|
} |
200 |
|
if ( $cmp->{svr} eq $track{svr} ) { |
201 |
|
if ( $seen{$cmp->{nvra}} ) { |
202 |
if ( $track{repo} ne $cmp->{repo} ) { |
if ( $track{repo} ne $cmp->{repo} ) { |
203 |
if ($repos->{$cmp->{repo}}->{stage} ) { |
if ($repos->{$cmp->{repo}}->{stage} ) { |
204 |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
if ( $seen{$cmp->{nvra}}->{latest} ) { |
208 |
} |
} |
209 |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
} elsif ( $repos->{$cmp->{repo}}->{orig}) { |
210 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
211 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
212 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
213 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
214 |
|
} |
215 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
216 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
217 |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
} elsif ( $seen{$cmp->{nvra}}->{repo} ne $cmp->{repo} ) { |
218 |
$cmp->{delete}++; |
$cmp->{delete}++; |
219 |
} |
} |
221 |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
} elsif ($repos->{$cmp->{repo}}->{stage} ) { |
222 |
$cmp->{delete}++; |
$cmp->{delete}++; |
223 |
} else { |
} else { |
224 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
225 |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
226 |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
227 |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
229 |
push @{$cmp->{repos}}, $dest; |
push @{$cmp->{repos}}, $dest; |
230 |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
231 |
$orig{$cmp->{nvra}}++; |
$orig{$cmp->{nvra}}++; |
232 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
233 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
234 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
235 |
|
} |
236 |
|
} elsif ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
237 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
238 |
} else { |
} else { |
239 |
$cmp->{delete}++; |
$cmp->{delete}++; |
240 |
} |
} |
241 |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
242 |
$cmp->{repo} = $dest; |
$cmp->{repo} = $dest; |
243 |
|
if ( ! $cmp->{src} && $repos->{$dest}->{prio} > $repos->{$track{repo}}->{prio} ) { |
244 |
|
$track{repo} = $dest; |
245 |
|
$track{svr} = $cmp->{svr}; |
246 |
|
} |
247 |
|
} |
248 |
|
if ( $cmp->{src} && $reposrc{$cmp->{repo}} ) { |
249 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp; |
250 |
} |
} |
251 |
} |
} |
252 |
} else { |
} else { |
253 |
if ( $track{repo} eq $cmp->{repo} ) { |
if ( $track{repo} eq $cmp->{repo} ) { |
254 |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
if ( verrel($cmp, $cmp->{repo}, \%counts) ) { |
255 |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
256 |
|
} elsif ( $cmp->{src} ) { |
257 |
|
$cmp->{delete}++ unless $repos->{$cmp->{repo}}->{base}; |
258 |
} else { |
} else { |
259 |
$track{svr} = $cmp->{svr}; |
$track{svr} = $cmp->{svr}; |
260 |
} |
} |
261 |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
} elsif ( ! $repos->{$cmp->{repo}}->{base} ) { |
262 |
$cmp->{delete}++; |
if ( $repos->{$cmp->{repo}}->{orig} ) { |
263 |
|
$srpm = $cmp if ! $srpm && $cmp->{src}; |
264 |
|
my $dest = $repos->{$track{repo}}->{prio} > $repos->{$devel2}->{prio} ? $track{repo} : $devel2; |
265 |
|
$dest = pkgdest($cmp, $devel1, $dest, $rpms->{$base}->{rpms}); |
266 |
|
$dest = $devel1 if verrel($cmp, $dest, \%counts); |
267 |
|
unless ( $cmp->{src} && ! $reposrc{$dest} ) { |
268 |
|
if ( $repos->{$dest}->{prio} >= $repos->{$track{repo}}->{prio} && ! verrel($cmp, $dest, \%counts) ) { |
269 |
|
unless ( $repos->{$cmp->{repo}}->{base} ) { |
270 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$cmp->{repo}}, $cmp->{name}, $cmp->{ver}, $cmp->{rel}; |
271 |
|
qx(touch $tag/PUSHED) if ! $opts{t} && -d $tag && ! -f "$tag/PUSHED"; |
272 |
|
} |
273 |
|
push @{$cmp->{repos}}, $dest; |
274 |
|
$cmp->{oldrepo} = $cmp->{repo} unless $cmp->{oldrepo}; |
275 |
|
$cmp->{repo} = $dest; |
276 |
|
$reposrc{$cmp->{repo}}->{srpm} = $cmp if $cmp->{src}; |
277 |
|
$orig{$cmp->{nvra}}++; |
278 |
|
} |
279 |
|
} |
280 |
|
} else { |
281 |
|
$cmp->{delete}++; |
282 |
|
} |
283 |
} |
} |
284 |
} |
} |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{delete} || $repos->{$cmp->{repo}}->{base}; |
|
285 |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
unless ( $repos->{$cmp->{repo}}->{orig} || ( $cmp->{delete} && ! $cmp->{repos} ) ) { |
286 |
$pkgs{$cmp->{nvra}}++; |
$pkgs{$cmp->{nvra}}++; |
287 |
$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}}; |
288 |
|
$reposrc{$cmp->{repo}} = $cmp unless $reposrc{$cmp->{repo}} || $cmp->{src} || $repos->{$cmp->{repo}}->{stage}; |
289 |
unless ( $seen{$cmp->{nvra}} ) { |
unless ( $seen{$cmp->{nvra}} ) { |
290 |
$seen{$cmp->{nvra}} = $cmp; |
$seen{$cmp->{nvra}} = $cmp; |
291 |
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
$cmp->{latest}++ if $latest{$cmp->{base}} && $cmp->{svr} eq $latest{$cmp->{base}} && $repos->{$cmp->{repo}}->{inc}; |
295 |
$cmp->{done}++; |
$cmp->{done}++; |
296 |
} |
} |
297 |
if ( $srpm ) { |
if ( $srpm ) { |
298 |
foreach my $r ( keys %reposrc ) { |
foreach my $r ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %reposrc ) { |
|
next if $repos->{$r}->{orig}; |
|
299 |
unless ( $reposrc{$r}->{srpm} ) { |
unless ( $reposrc{$r}->{srpm} ) { |
300 |
push @{$srpm->{repos}}, $r; |
unshift @{$srpm->{repos}}, $r; |
|
$pkgs{$srpm->{nvra}}++; |
|
|
$orig{$srpm->{nvra}}++ if $repos->{$srpm->{repo}}->{orig}; |
|
301 |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
$srpm->{oldrepo} = $srpm->{repo} unless $srpm->{oldrepo}; |
302 |
$srpm->{repo} = $r; |
$srpm->{repo} = $r; |
303 |
$reposrc{$r}->{srpm} = $srpm; |
$reposrc{$r}->{srpm} = $srpm; |
304 |
} |
} |
305 |
} |
} |
306 |
} elsif ( scalar keys %pkgs ) { |
} elsif ( scalar keys %pkgs && $opts{s} ) { |
307 |
print "\n * missing source (", $pkg->{svr}, ")\n"; |
print "\n * missing source ($disttag$ver, ", $pkg->{repo}, ", ", $pkg->{svr}, ")\n"; |
308 |
} |
} |
309 |
print "\n * missing originals (", $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; |
310 |
} |
} |
311 |
|
|
312 |
foreach my $r ( keys %$acnt ) { |
foreach my $r ( keys %$acnt ) { |
332 |
push @{$pkg->{repos}}, $stage; |
push @{$pkg->{repos}}, $stage; |
333 |
} |
} |
334 |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
335 |
print "\n$base (sme$smever)\n", "=" x length("$base (sme$smever)"), "\n"; |
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
336 |
$print++; |
$print++; |
337 |
} |
} |
338 |
|
|
363 |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
$pkg->{oldrepo} = $repo unless $pkg->{oldrepo} eq ${$pkg->{repos}}[0]; |
364 |
|
|
365 |
my @d = (); |
my @d = (); |
366 |
my $head = $distrepo->{$smever}->{repo} . $repo . '/'; |
my $head = $distrepo->{$ver}->{repo} . $repo . '/'; |
367 |
$head = $distrepo->{$smever}->{stage} if $repos->{$repo}->{stage}; |
$head = $distrepo->{$ver}->{stage} if $repos->{$repo}->{stage}; |
368 |
my $tail = $repos->{$repo}->{os} ? 'SME/' . $distrepo->{$smever}->{os} : 'RPMS/'; |
my $tail = $repos->{$repo}->{os} ? "$osdir/" . $distrepo->{$ver}->{os} : 'RPMS/'; |
369 |
if ( $pkg->{src} ) { |
if ( $pkg->{src} ) { |
370 |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename); |
371 |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
} elsif ( $pkg->{rpm}->arch eq 'noarch' ) { |
382 |
} |
} |
383 |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
qx(rm -f $src) if exists $pkg->{delete} && ! $opts{t}; |
384 |
} elsif ( $pkg->{delete} ) { |
} elsif ( $pkg->{delete} ) { |
385 |
print "delete from ", $pkg->{repo}, " (", basename($pkg->{rpm}->filename), ")\n"; |
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
386 |
qx(rm -f $src); |
qx(rm -f $src) unless $opts{t}; |
387 |
|
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
388 |
|
if ( $repos->{$pkg->{repo}}->{orig} && ! $repos->{$pkg->{repo}}->{base} ) { |
389 |
|
my $tag = sprintf '%s%s/%s-%s', $distrepo->{$ver}->{$pkg->{repo}}, $pkg->{name}, $pkg->{ver}, $pkg->{rel}; |
390 |
|
qx(rm -f $tag/PUSHED) if ! $opts{t} && -d $tag && -f "$tag/PUSHED"; |
391 |
|
} |
392 |
|
} |
393 |
|
} |
394 |
|
|
395 |
|
if ( $rpms->{$base}->{srpms} ) { |
396 |
|
foreach my $pkg ( sort { $b->{rpm} cmp $a->{rpm} } @{$rpms->{$base}->{srpms}} ) { |
397 |
|
next if $pkg->{done} || $repos->{$pkg->{repo}}->{orig} || $repos->{$pkg->{repo}}->{base}; |
398 |
|
$pkg->{delete}++; |
399 |
|
my $src = $pkg->{rpm}->filename; |
400 |
|
if ( ! $print && ($pkg->{delete} || $pkg->{repos} || $pkg->{nosig} ) ) { |
401 |
|
print "\n$base ($disttag$ver)\n", "=" x length("$base ($disttag$ver)"), "\n"; |
402 |
|
$print++; |
403 |
|
} |
404 |
|
print "delete from ", $pkg->{repo}, " (", $pkg->{arch}, ", ", basename($pkg->{rpm}->filename), ")\n"; |
405 |
|
qx(rm -f $src) unless $opts{t}; |
406 |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
$repochg{$pkg->{repo}}++ unless $repos->{$pkg->{repo}}->{base} || $repos->{$pkg->{repo}}->{stage}; |
407 |
} |
} |
408 |
} |
} |
409 |
} |
} |
410 |
|
|
411 |
if ( %repochg ) { |
if ( %repochg ) { |
412 |
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"; |
413 |
} |
} |
414 |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) { |
415 |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage}; |
416 |
foreach my $arch ( @archs ) { |
foreach my $arch ( @archs ) { |
417 |
my $dir = $distrepo->{$smever}->{repo} . "$repo/$arch"; |
my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch"; |
418 |
$dir = qx(readlink -f $dir); |
$dir = qx(readlink -f $dir); |
419 |
chomp $dir; |
chomp $dir; |
420 |
print "rebuild $repo/$arch\n"; |
print "rebuild $repo/$arch\n"; |
421 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
422 |
if ( -f "$dir/repodata/comps.xml" ) { |
if ( $dir =~ m{test/|-testing/} ) { |
423 |
qx(createrepo -g $dir/repodata/comps.xml $dir); |
if ( -f "$dir/repodata/comps.xml" ) { |
424 |
} else { |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
425 |
qx(createrepo $dir); |
} else { |
426 |
} |
qx(createrepo --update --database --exclude *smeserver-release*.rpm --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
427 |
|
} |
428 |
|
} else { |
429 |
|
if ( -f "$dir/repodata/comps.xml" ) { |
430 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm --groupfile repodata/comps.xml $dir); |
431 |
|
} else { |
432 |
|
qx(createrepo --update --database --exclude *.src.rpm --exclude *-debuginfo-*.rpm $dir); |
433 |
|
} |
434 |
|
} |
435 |
qx(repoview $dir); |
qx(repoview $dir); |
436 |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
qx(rm -rf $dir/.olddata) if -d "$dir/.olddata"; |
437 |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
qx(rm -rf $dir/.repodata) if -d "$dir/.repodata"; |
439 |
} |
} |
440 |
} |
} |
441 |
unless ( $opts{t} ) { |
unless ( $opts{t} ) { |
442 |
finddepth(sub{rmdir}, $distrepo->{$smever}->{$_}) foreach ('builds','contribs','qa'); |
finddepth(sub{rmdir}, $distrepo->{$ver}->{builds}) if -d "$distrepo->{$ver}->{builds}"; |
443 |
|
finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}"; |
444 |
} |
} |
445 |
} |
} |
446 |
|
|
449 |
my $repo = shift; |
my $repo = shift; |
450 |
my $counts = shift; |
my $counts = shift; |
451 |
|
|
452 |
|
return 0 if $pkg->{src}; |
453 |
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
$counts->{$repo}->{$pkg->{ver}}->{$pkg->{rel}}++; |
454 |
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
return 1 if $repos->{$repo}->{ver} && scalar keys %{$counts->{$repo}} > $repos->{$repo}->{ver}; |
455 |
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
return 1 if $repos->{$repo}->{rel} && scalar keys %{$counts->{$repo}->{$pkg->{ver}}} > $repos->{$repo}->{rel}; |
463 |
my $pkgs = shift; |
my $pkgs = shift; |
464 |
|
|
465 |
foreach my $cmp ( @$pkgs ) { |
foreach my $cmp ( @$pkgs ) { |
466 |
next if $cmp->{src} || $cmp->{name} ne $pkg->{name} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
next if $cmp->{src} || $repos->{$cmp->{repo}}->{prio} <= $repos->{$dest}->{prio}; |
467 |
|
next if $pkg->{name} ne ( $pkg->{src} ? $cmp->{base} : $cmp->{name} ); |
468 |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
if ( $repos->{$cmp->{repo}}->{prio} > $repos->{$hirepo}->{prio} ) { |
469 |
$dest = $hirepo; |
$dest = $hirepo; |
470 |
last; |
last; |
477 |
|
|
478 |
sub process_rpm { |
sub process_rpm { |
479 |
my $rpm = shift; |
my $rpm = shift; |
480 |
my $smever = shift; |
my $ver = shift; |
481 |
my $repo = shift; |
my $repo = shift; |
482 |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
return unless $rpm =~ m{/([^/]*)-[^-]+-[^-]+\.\w+\.rpm$}; |
483 |
my $base = $1; |
my $base = $1; |
496 |
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}; |
497 |
} |
} |
498 |
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$}; |
499 |
return if $skippkg->{$smever}->{$repo} && $skippkg->{$smever}->{$repo}->{$src}; |
return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} ); |
500 |
return if $repos->{$repo}->{base} && $nosig; |
return if $repos->{$repo}->{base} && $nosig; |
501 |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; } |
502 |
|
my $arch = 'unknown'; |
503 |
|
$arch = 'SRPMS' if $pkg->filename =~ m{[/-](SRPMS?|src|source)/}; |
504 |
|
$arch = 'x86_64' if $pkg->filename =~ m{[/-]x86_64/}; |
505 |
|
$arch = 'i386' if $pkg->filename =~ m{[/-](i[356]86)/}; |
506 |
|
$arch = 'noarch' if $pkg->filename =~ m{[/-]noarch/}; |
507 |
|
|
508 |
my $rpmhash = { base => $src, |
my $rpmhash = { base => $src, |
509 |
name => $pkg->name, |
name => $pkg->name, |
511 |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
nvra => $pkg->name.'-'.$pkg->version.'-'.$pkg->release.'.'.( $pkg->is_source_package ? 'src' : $pkg->tag('ARCH') ), |
512 |
svr => $src.'-'.$version.'-'.$release, |
svr => $src.'-'.$version.'-'.$release, |
513 |
src => $pkg->is_source_package, |
src => $pkg->is_source_package, |
514 |
|
arch => $arch, |
515 |
ver => $version, |
ver => $version, |
516 |
rel => $release, |
rel => $release, |
517 |
rpm => $pkg, |
rpm => $pkg, |