/[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.78 by slords, Sat Oct 11 16:43:16 2014 UTC Revision 1.84 by unnilennium, Fri Jun 24 07:35:28 2016 UTC
# Line 45  my $distrepo = { '8' => { active    => 1 Line 45  my $distrepo = { '8' => { active    => 1
45                            keyname   => 'SME Server 7 signing key <bugteam@contribs.org>',                            keyname   => 'SME Server 7 signing key <bugteam@contribs.org>',
46                            checksum  => 'sha256',                            checksum  => 'sha256',
47                          },                          },
48                   '10' => { active   => 0,                   '10' => { active   => 1,
49                            centos    => 7,                            centos    => 7,
50                            archs     => [ 'x86_64' ],                            archs     => [ 'x86_64' ],
51                            repo      => '/build/smeserver/repo/testing/10/',                            repo      => '/build/smeserver/repo/testing/10/',
# Line 53  my $distrepo = { '8' => { active    => 1 Line 53  my $distrepo = { '8' => { active    => 1
53                            community => '/build/builds/smeserver-10-contribs/',                            community => '/build/builds/smeserver-10-contribs/',
54                            stage     => '/build/smeserver/stage/10/',                            stage     => '/build/smeserver/stage/10/',
55                            sign      => 1,                            sign      => 1,
56                            keyname   => 'SME Server 7 signing key <bugteam@contribs.org>',                            keyname   => 'Koozali SME Server signing key (10) <bugteam@koozali.org>',
57                            checksum  => 'sha256',                            checksum  => 'sha256',
58                          },                          },
59                 };                 };
# Line 110  my $skippkg = { '8'  => { 'atrpms' Line 110  my $skippkg = { '8'  => { 'atrpms'
110                          },                          },
111                  '9'  => { 'atrpms'        => { map { $_ => 1 } ( 'clamav', 'perl-Pod-Escapes', 'perl-Pod-Simple' ) },                  '9'  => { 'atrpms'        => { map { $_ => 1 } ( 'clamav', 'perl-Pod-Escapes', 'perl-Pod-Simple' ) },
112                            'epel'          => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) },                            'epel'          => { map { $_ => 1 } ( 'oidentd', 'perl-Razor-Agent' ) },
113                            'rpmforge'      => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin' ) },                            'rpmforge'      => { map { $_ => 1 } ( 'perl-CGI', 'perl-Compress-Raw-Zlib', 'perl-ExtUtils-ParseXS', 'perl-Pod-Escapes', 'perl-Pod-Simple', 'perl-Time-HiRes', 'perl-version', 'spamassassin', 'portreserve', 'perl-libwww-perl' , 'lzo', 'perl-BSD-Resource', 'perl-Convert-ASN1', 'perl-Devel-StackTrace', 'perl-Digest-SHA1', 'perl-MIME-tools', 'perl-MailTools', 'perl-PPI', 'perl-URI', 'perl-XML-NamespaceSupport', 'perl-XML-Parser', 'perl-XML-SAX-Writer', 'perl-YAML-Syck', 'proftpd', 'syslinux') },
114                          },                          },
115                  '10' => {                  '10' => {
116                          },                          },
# Line 129  foreach my $ver ( sort { $a <=> $b } key Line 129  foreach my $ver ( sort { $a <=> $b } key
129      %sources = ();      %sources = ();
130      %base = ();      %base = ();
131    
132      @{$distrepo->{$ver}->{all_archs}} = ('noarch', @{$distrepo->{$ver}->{archs}});      @{$distrepo->{$ver}->{all_archs}} = ('noarch', @{$distrepo->{$ver}->{'archs'}});
133      if ( grep $_ eq 'i386', @{$distrepo->{$ver}->{archs}} ) {      if ( grep $_ eq 'i386', @{$distrepo->{$ver}->{'archs'}} ) {
134          push @{$distrepo->{$ver}->{all_archs}}, ('i586', 'i686');          push @{$distrepo->{$ver}->{all_archs}}, ('i586', 'i686');
135      }      }
136    
# Line 139  foreach my $ver ( sort { $a <=> $b } key Line 139  foreach my $ver ( sort { $a <=> $b } key
139          $bdir =~ s/~S/$distrepo->{$ver}->{repo}/;          $bdir =~ s/~S/$distrepo->{$ver}->{repo}/;
140          $bdir =~ s/~s/$ver/;          $bdir =~ s/~s/$ver/;
141          $bdir =~ s/~C/$distrepo->{$ver}->{centos}/;          $bdir =~ s/~C/$distrepo->{$ver}->{centos}/;
142          for my $arch ( @{$distrepo->{$ver}->{archs}}, 'SRPMS/' ) {          for my $arch ( @{$distrepo->{$ver}->{'archs'}}, 'SRPMS/' ) {
143              my $adir = $bdir;              my $adir = $bdir;
144              if ( $arch eq 'SRPMS/' ) {              if ( $arch eq 'SRPMS/' ) {
145                  $adir =~ s/~A.*//;                  $adir =~ s/~A.*//;
# Line 162  foreach my $ver ( sort { $a <=> $b } key Line 162  foreach my $ver ( sort { $a <=> $b } key
162              }              }
163              next unless -d $adir;              next unless -d $adir;
164              opendir DIR, $adir or next;              opendir DIR, $adir or next;
165              process_rpm("$adir$_", $ver, $baserepo->{$dir}) foreach readdir DIR;              my @txt = grep {  /\.rpm$/ && -f "$adir/$_" }  readdir DIR;
166              closedir DIR;              closedir DIR;
167                if (scalar(@txt)) {
168                   opendir DIR, $adir or next;
169                   process_rpm("$adir$_", $ver, $baserepo->{$dir})  foreach readdir DIR;
170                   closedir DIR;
171                } elsif ($baserepo->{$dir} eq 'epel') {
172                   # EPEL 7  uses a structure with subfolders of first letter of package
173                   find( { wanted => sub { process_rpm($_, $ver, $baserepo->{$dir}) if ($_ =~ m/\.rpm$/);}, no_chdir => 1, follow_fast => 1 }, $adir );
174                }
175              last unless $dir =~ m{~A};              last unless $dir =~ m{~A};
176          }          }
177      }      }
178      find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{builds}};      find( { wanted => sub { process_rpm($_, $ver, 'builds'); }, no_chdir => 1, follow_fast => 1 }, "$_" ) foreach @{$distrepo->{$ver}->{'builds'}};
179      find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{community} ) if $distrepo->{$ver}->{community};      find( { wanted => sub { process_rpm($_, $ver, 'community'); }, no_chdir => 1, follow_fast => 1 }, $distrepo->{$ver}->{'community'} ) if $distrepo->{$ver}->{'community'};
180    
181      foreach my $base ( sort keys %$rpms ) {      foreach my $base ( sort keys %$rpms ) {
182          next unless $rpms->{$base}->{rpms};          next unless $rpms->{$base}->{rpms};
# Line 394  foreach my $ver ( sort { $a <=> $b } key Line 402  foreach my $ver ( sort { $a <=> $b } key
402                  foreach my $a ( keys %{$acnt->{$r}->{$p}} ) {                  foreach my $a ( keys %{$acnt->{$r}->{$p}} ) {
403                      if ( $a eq 'noarch' ) {                      if ( $a eq 'noarch' ) {
404                          my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0];                          my $p2 = ${$acnt->{$r}->{$p}->{$a}}[0];
405                          if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{archs}} ) {                          if ( ! $p2->{repos} && scalar @{$acnt->{$r}->{$p}->{$a}} != scalar @{$distrepo->{$ver}->{'archs'}} ) {
406                              $p2->{oldrepo} = $p2->{repo};                              $p2->{oldrepo} = $p2->{repo};
407                              push @{$p2->{repos}}, $p2->{repo};                              push @{$p2->{repos}}, $p2->{repo};
408                          }                          }
# Line 452  foreach my $ver ( sort { $a <=> $b } key Line 460  foreach my $ver ( sort { $a <=> $b } key
460                      if ( $pkg->{src} ) {                      if ( $pkg->{src} ) {
461                          push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename);                          push @d, "${head}SRPMS/" . basename($pkg->{rpm}->filename);
462                      } elsif ( $pkg->{rpm}->arch eq 'noarch' ) {                      } elsif ( $pkg->{rpm}->arch eq 'noarch' ) {
463                          push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{archs}};                          push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}};
464                        } elsif ($ver>=10 && $pkg->{rpm}->arch =~ m{^(i[356]86)$}  && $pkg->{arch} =~ m{^(x86_64)$}  ) {
465                           #add copy of i686 packages in x86_64 folder for SME>=10
466                           push @d, map { "${head}$_/$tail" . basename($pkg->{rpm}->filename) } @{$distrepo->{$ver}->{'archs'}};
467                      } elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) {                      } elsif ( $pkg->{rpm}->arch =~ m{^(i[356]86)$} ) {
468                          push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename);                          push @d, "${head}i386/$tail" . basename($pkg->{rpm}->filename);
469                      } else {                      } else {
# Line 496  foreach my $ver ( sort { $a <=> $b } key Line 507  foreach my $ver ( sort { $a <=> $b } key
507      }      }
508      foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) {      foreach my $repo ( sort { $repos->{$b}->{prio} <=> $repos->{$a}->{prio} } keys %repochg ) {
509          next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage};          next if $repos->{$repo}->{orig} || $repos->{$repo}->{stage};
510          foreach my $arch ( @{$distrepo->{$ver}->{archs}} ) {          foreach my $arch ( @{$distrepo->{$ver}->{'archs'}} ) {
511              my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch";              my $dir = $distrepo->{$ver}->{repo} . "$repo/$arch";
512              $dir = qx(readlink -f $dir);              $dir = qx(readlink -f $dir);
513              if ( $dir ) {              if ( $dir ) {
# Line 527  foreach my $ver ( sort { $a <=> $b } key Line 538  foreach my $ver ( sort { $a <=> $b } key
538          }          }
539      }      }
540      unless ( $opts{t} ) {      unless ( $opts{t} ) {
541          foreach (@{$distrepo->{$ver}->{builds}})          foreach (@{$distrepo->{$ver}->{'builds'}})
542          {          {
543              finddepth(sub{rmdir}, "$_") if -d "$_";              finddepth(sub{rmdir}, "$_") if -d "$_";
544          }          }
545          finddepth(sub{rmdir}, $distrepo->{$ver}->{community}) if -d "$distrepo->{$ver}->{community}";          finddepth(sub{rmdir}, $distrepo->{$ver}->{'community'}) if -d "$distrepo->{$ver}->{'community'}";
546      }      }
547  }  }
548    


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