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