/[smeserver]/builds_bin/checkrpms
ViewVC logotype

Diff of /builds_bin/checkrpms

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

Revision 1.4 by slords, Sat Dec 2 17:19:10 2006 UTC Revision 1.6 by slords, Wed Jan 17 14:50:10 2007 UTC
# Line 4  use strict; Line 4  use strict;
4  use warnings;  use warnings;
5  use RPM2;  use RPM2;
6  use Data::Dumper;  use Data::Dumper;
7    use Getopt::Std;
8    
9    my %opts;
10    getopts( "s:", \%opts );
11    my $src = $opts{s} || '/builds/RPMS';
12    
13  my $rpm_flags =  RPM2->vsf_nodsa;  my $rpm_flags =  RPM2->vsf_nodsa;
 my $build_dir  = "/builds/RPMS";  
14  my @repositories = qw(  my @repositories = qw(
15          /mirrors/centos/4/fasttrack/i386/RPMS/          /mirrors/centos/4/fasttrack/i386/RPMS/
16          /mirrors/centos/4/updates/i386/RPMS/          /mirrors/centos/4/updates/i386/RPMS/
# Line 23  my @repositories = qw( Line 27  my @repositories = qw(
27          /builds/rpms/RPMS/noarch/          /builds/rpms/RPMS/noarch/
28          );          );
29    
30  opendir RPMS, $build_dir or die "Couldn't opendir $build_dir";  opendir RPMS, $src or die "Couldn't opendir $src";
31  my %rpms = map { my $x = RPM2->open_package("$build_dir/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS;  my %rpms = map { my $x = RPM2->open_package("$src/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS;
32  closedir RPMS;  closedir RPMS;
33    
34  my %repos;  my %repos;
# Line 53  foreach my $rpm ( sort keys %rpms ) Line 57  foreach my $rpm ( sort keys %rpms )
57      @headers = reverse sort { $a cmp $b } @headers;      @headers = reverse sort { $a cmp $b } @headers;
58      if (grep { $_->filename =~ m#/centos/[\d.]+/(updates|fasttrack)/# } @headers)      if (grep { $_->filename =~ m#/centos/[\d.]+/(updates|fasttrack)/# } @headers)
59      {      {
60          @headers = grep { $_->filename !~ m#/centos/[\d.]+/os/# } @headers;          @headers = grep { $_->filename !~ m#/centos/[\d.]+/os/# || $_ eq $rpms{$rpm} } @headers;
61      }      }
62      if (grep { $_->filename =~ m#/centos/[\d.]+/(os|updates|fasttrack|extras)/# || $_->filename =~ m#/dag/[^d]# } @headers)      if (grep { $_->filename =~ m#/centos/[\d.]+/(os|updates|fasttrack|extras)/# || $_->filename =~ m#/dag/[^d]# } @headers)
63      {      {
64          @headers = grep { $_->filename !~ m#/atrpms/# } @headers;          @headers = grep { $_->filename !~ m#/atrpms/# || $_ eq $rpms{$rpm} } @headers;
65          @headers = grep { $_->filename !~ m#/fedora/# } @headers;          @headers = grep { $_->filename !~ m#/fedora/# || $_ eq $rpms{$rpm} } @headers;
66          @headers = grep { $_->filename !~ m#/fedora-legacy/# } @headers;          @headers = grep { $_->filename !~ m#/fedora-legacy/# || $_ eq $rpms{$rpm} } @headers;
67      }      }
68      if ($#headers < 0)      if ($#headers < 0)
69      {      {
# Line 78  foreach my $rpm ( sort keys %rpms ) Line 82  foreach my $rpm ( sort keys %rpms )
82                  my $filename = $rpms{$rpm}->filename;                  my $filename = $rpms{$rpm}->filename;
83                  $filename =~ s@^.*/(.*)@$1@;                  $filename =~ s@^.*/(.*)@$1@;
84                  print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n";                  print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n";
85                  #print "     - rm $build_dir/$filename; cp ". $header->filename . " $build_dir\n";                  #print "     - rm $src/$filename; cp ". $header->filename . " $src\n";
86              }              }
87          }          }
88      }      }


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