/[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.5 by slords, Fri May 4 15:05:25 2007 UTC Revision 1.9 by slords, Sat May 19 21:55:09 2007 UTC
# Line 11  my $releases = 2; Line 11  my $releases = 2;
11    
12  my $releasedir = '/releases';  my $releasedir = '/releases';
13  my $smerel = '7';  my $smerel = '7';
 my $arch = 'i386';  
14  my $centosrel = '4';  my $centosrel = '4';
15  my $fedorarel = '3';  my $fedorarel = '3';
16  my $builds = '/builds/rpms';  my $builds = '/builds/rpms';
17  my $stagedir = '/builds';  my $stagedir = '/builds';
18    my $arch = `uname -i`;
19    chomp $arch;
20    
21  my @repos = (  my @repos = (
22                "$releasedir/$smerel/smeos/$arch/CentOS/RPMS",                "$releasedir/$smerel/smeos/$arch/CentOS/RPMS",
# Line 127  foreach my $pkg ( keys %repohash ) { Line 128  foreach my $pkg ( keys %repohash ) {
128                                          @{$repohash{$pkg}{$pos}} = grep { $_ gt $repohash{$pkg}{latest} } @{$repohash{$pkg}{$pos}};                                          @{$repohash{$pkg}{$pos}} = grep { $_ gt $repohash{$pkg}{latest} } @{$repohash{$pkg}{$pos}};
129                                          delete $repohash{$pkg}{$pos};                                          delete $repohash{$pkg}{$pos};
130                                  }                                  }
131                          } else {                          } elsif ( ref($repohash{$pkg}{$pos}) eq 'ARRAY' ) {
132                                  my ($latest, @rest) = sort { $b cmp $a } @{$repohash{$pkg}{$pos}};                                  my ($latest, @rest) = sort { $b cmp $a } @{$repohash{$pkg}{$pos}};
133                                  delete $repohash{$pkg}{$pos};                                  delete $repohash{$pkg}{$pos};
134                                  if ( $repohash{$pkg}{latest} && $repohash{$pkg}{latest} ge $latest ) {                                  if ( $repohash{$pkg}{latest} && $repohash{$pkg}{latest} ge $latest ) {
# Line 184  foreach my $repo ( sort keys %srcrepohas Line 185  foreach my $repo ( sort keys %srcrepohas
185          foreach my $pkg ( sort grep { $repohash{$_}{$repo} } keys %repohash ) {          foreach my $pkg ( sort grep { $repohash{$_}{$repo} } keys %repohash ) {
186                  my @rpms = ref($repohash{$pkg}{$repo}) eq "ARRAY" ? @{$repohash{$pkg}{$repo}} : ($repohash{$pkg}{$repo});                  my @rpms = ref($repohash{$pkg}{$repo}) eq "ARRAY" ? @{$repohash{$pkg}{$repo}} : ($repohash{$pkg}{$repo});
187                  foreach my $rpm ( sort @rpms ) {                  foreach my $rpm ( sort @rpms ) {
188                          my $src = $rpm->tag("SOURCERPM");                          my $src;
189    
190                          my @sources = ();                          my @sources = ();
191                          push @sources, $src;                          push @sources, ($src = $rpm->tag("SOURCERPM"));
192                          push @sources, $src if ($src =~ s/\.\d+\.el\d+\.rf\./\.rf\./);                          push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.el\d\.rf\./\.rf\./);
193                          push @sources, $src if ($src =~ s/\.el\d\.rf\./\.rf\./);                          push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.[0-3]\.el\d+\.rf\./\.rf\./);
194                          push @sources, $src if ($src =~ s/\.el\d\.at\./\.at\./);                          push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.(el|fc)\d\.at//);
195                          push @sources, $src if ($src =~ s/\.fc\d\.at\./\.at\./);                          push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.at//);
196                          push @sources, $src if ($src =~ s/\.rf\./\.dag\./);                          push @sources, $src if (($src = $rpm->tag("SOURCERPM")) =~ s/\.(el|fc)\d//);
197                            $src = $rpm->tag("SOURCERPM");
198    
199                          my $found = 0;                          my $found = 0;
200                          foreach my $source ( @sources ) {                          foreach my $source ( @sources ) {
# Line 240  print "\n"; Line 242  print "\n";
242  foreach my $repo ( sort keys %changed ) {  foreach my $repo ( sort keys %changed ) {
243          next if $repo =~ m{^$stagedir};          next if $repo =~ m{^$stagedir};
244    
245          print "rebuilding $repo/$arch...\n";          my $dir=`readlink -f $repo/$arch`;
246          system(qw(createrepo), "$repo/$arch");          chomp $dir;
247          system(qw(repoview), "$repo/$arch");          print "rebuilding $dir...\n";
248            system(qw(createrepo), "$dir");
249            system(qw(repoview), "$dir");
250  }  }
251    


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