/[smeserver]/builds_bin/update_repos
ViewVC logotype

Diff of /builds_bin/update_repos

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.87 by unnilennium, Thu Dec 1 17:36:44 2016 UTC Revision 1.88 by unnilennium, Tue Feb 14 21:38:34 2017 UTC
# Line 16  $| = 1; Line 16  $| = 1;
16  my %opts;  my %opts;
17  getopts( 'ostr:', \%opts );  getopts( 'ostr:', \%opts );
18  $opts{r} ||= '';  $opts{r} ||= '';
19    #available options
20    #-o = verify we have originals of the packages in repos (not really used anymore)
21    #-s = verify every package has a source package (so we can rebuild if necessary)
22    #-t = test run (don't do anything just print out what would be done)
23    #-r {regex} = regex of packages to run the script against
24    
25  my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa;  my $rpm_flags = RPM2->vsf_nodsaheader | RPM2->vsf_norsaheader | RPM2->vsf_nodsa | RPM2->vsf_norsa;
26    
# Line 58  my $distrepo = { '8' => { active    => 1 Line 63  my $distrepo = { '8' => { active    => 1
63                          },                          },
64                 };                 };
65    
66    # list here repo and priority
67    # prio: highest priority will hide lowest priority
68    # inc: include for iso ?
69    # ver:
70    # rel:
71    # orig:
72    # base, os, stage:
73  my $repos = { "${repotag}os"              => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 },  my $repos = { "${repotag}os"              => { prio => 19, inc => 1, ver => 1, rel => 1, os => 1 },
74                "${repotag}updates"         => { prio => 18, inc => 1, ver => 1, rel => 1 },                "${repotag}updates"         => { prio => 18, inc => 1, ver => 1, rel => 1 },
75                "${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 },                "${repotag}updates-testing" => { prio => 17, inc => 1, ver => 1, rel => 3 },
# Line 67  my $repos = { "${repotag}os" Line 79  my $repos = { "${repotag}os"
79                "${repotag}test"            => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 },                "${repotag}test"            => { prio => 13, inc => 0, ver => 2, rel => 3, devel => 2 },
80                "${repotag}dev"             => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 },                "${repotag}dev"             => { prio => 12, inc => 0, ver => 1, rel => 1, devel => 1 },
81                '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 },
82                'epel'                      => { prio =>  9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },                'remi'                      => { prio =>  9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },
83                  'remisafe'                  => { prio =>  9, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },
84                  'epel'                      => { prio =>  8, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },
85                'rpmforge'                  => { prio =>  7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },                'rpmforge'                  => { prio =>  7, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },
86                'atrpms'                    => { prio =>  6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },                'atrpms'                    => { prio =>  6, inc => 0, ver => 0, rel => 0, orig => 1, base => 1 },
87                'builds'                    => { prio =>  4, inc => 0, ver => 0, rel => 0, orig => 1 },                'builds'                    => { prio =>  4, inc => 0, ver => 0, rel => 0, orig => 1 },
# Line 75  my $repos = { "${repotag}os" Line 89  my $repos = { "${repotag}os"
89                'stage'                     => { prio =>  1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 },                'stage'                     => { prio =>  1, inc => 0, ver => 0, rel => 0, stage => 1, os => 1 },
90              };              };
91    
92    # list here the path on our local mirror to each upstream and our mirrors
93    # ~A will be expanded to architecture
94    # ~C will be expanded to Centos main version number, i.e. 7 for SME 10.
95  my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os",  my $baserepo = { "~S${repotag}os/~A/" => "${repotag}os",
96                   "~S${repotag}updates/~A/" => "${repotag}updates",                   "~S${repotag}updates/~A/" => "${repotag}updates",
97                   "~S${repotag}updates-testing/~A/" => "${repotag}updates-testing",                   "~S${repotag}updates-testing/~A/" => "${repotag}updates-testing",
# Line 94  my $baserepo = { "~S${repotag}os/~A/" => Line 111  my $baserepo = { "~S${repotag}os/~A/" =>
111                   '/mirrors/centos-vault/~C/extras/~A/' => 'centos',                   '/mirrors/centos-vault/~C/extras/~A/' => 'centos',
112                   '/mirrors/fedora/epel/~C/~A/' => 'epel',                   '/mirrors/fedora/epel/~C/~A/' => 'epel',
113                   '/mirrors/fedora/epel/testing/~C/~A/' => 'epel',                   '/mirrors/fedora/epel/testing/~C/~A/' => 'epel',
114                     '/mirrors/remi/enterprise/~C/remi/~A/' => 'remi',
115                     '/mirrors/remi/SRPMS/' => 'remi',
116                     '/mirrors/remi/enterprise/~C/safe/~A/' => 'remisafe',
117                     '/mirrors/remi/SRPMS/' => 'remisafe',
118                   '/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge',                   '/mirrors/rpmforge/redhat/el~C/en/~A/dag/' => 'rpmforge',
119                   '/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge',                   '/mirrors/rpmforge/redhat/el~C/en/~A/extras/' => 'rpmforge',
120                   '/mirrors/rpmforge/source/' => 'rpmforge',                   '/mirrors/rpmforge/source/' => 'rpmforge',
# Line 103  my $baserepo = { "~S${repotag}os/~A/" => Line 124  my $baserepo = { "~S${repotag}os/~A/" =>
124                   '/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms',                   '/mirrors/atrpms/src/el~C-~A/atrpms/testing/' => 'atrpms',
125                 };                 };
126    
127    # add here packages to exclude
128    # for each version, if a repo is listed and rpm are listed they will be ignored fromt his repo
129  my $skippkg = { '8'  => { 'atrpms'        => { map { $_ => 1 } ( 'clamav', 'gnupg' ) },  my $skippkg = { '8'  => { 'atrpms'        => { map { $_ => 1 } ( 'clamav', 'gnupg' ) },
130                            'centos'        => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) },                            'centos'        => { map { $_ => 1 } ( 'horde', 'imp-h3', 'ingo-h3', 'turba-h3' ) },
131                            'epel'          => { map { $_ => 1 } ( 'clamav', 'cppunit', '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' ) },                            'epel'          => { map { $_ => 1 } ( 'clamav', 'cppunit', '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' ) },
# Line 116  my $skippkg = { '8'  => { 'atrpms' Line 139  my $skippkg = { '8'  => { 'atrpms'
139                          },                          },
140                };                };
141    
142    # add here include only conditions
143    # for each version if a repo is listed here, only listed rpm will be considered
144    my $onlypkg = { '8' => {
145                              'remi' => { },
146                              'remisafe' => { },
147                            },
148                    '9'  => {
149                              'remi' => { },
150                            },
151                    '10' => {
152                              'remi' => { map { $_ => 1 } ( 'php-pear' )},
153                            },
154    };
155    
156  my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos;  my ($stage) = sort { $repos->{$a}->{stage} <=> $repos->{$b}->{stage} } grep { $repos->{$_}->{stage} } keys %$repos;
157  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;
158  $devel2 ||= $devel1;  $devel2 ||= $devel1;
# Line 604  sub process_rpm { Line 641  sub process_rpm {
641      }      }
642      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$};
643      return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} );      return if $skippkg->{$ver}->{$repo} && ( $skippkg->{$ver}->{$repo}->{$src} || $skippkg->{$ver}->{$repo}->{$pkg->name} );
644        return if $onlypkg->{$ver}->{$repo} && !( $onlypkg->{$ver}->{$repo}->{$src} || $onlypkg->{$ver}->{$repo}->{$pkg->name} );
645      return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign};      return if $repos->{$repo}->{base} && $nosig && $baserepo->{$ver}->{sign};
646      if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; }      if ( $nosig && ! -f "$HOME/.rpmpass" ) { print " * missing signature (" .$pkg->filename . ")\n"; return; }
647      my $arch = 'unknown';      my $arch = 'unknown';


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed