/[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.1 by gordonr, Thu Sep 15 23:55:09 2005 UTC Revision 1.5 by slords, Tue Jan 16 18:18:19 2007 UTC
# Line 8  use Data::Dumper; Line 8  use Data::Dumper;
8  my $rpm_flags =  RPM2->vsf_nodsa;  my $rpm_flags =  RPM2->vsf_nodsa;
9  my $build_dir  = "/builds/RPMS";  my $build_dir  = "/builds/RPMS";
10  my @repositories = qw(  my @repositories = qw(
11          /mirrors/centos/4/updates/i386/RPMS/          /mirrors/centos/4/fasttrack/i386/RPMS/
12          /mirrors/centos/4/os/i386/CentOS/RPMS/          /mirrors/centos/4/updates/i386/RPMS/
13          /mirrors/centos/4/dag/i386/RPMS.dag/          /mirrors/centos/4/os/i386/CentOS/RPMS/
14          /mirrors/centos/4/atrpms/i386/RPMS.stable/          /mirrors/centos/4/extras/i386/RPMS/
15          /mirrors/centos/4/dries/i386/RPMS.dries/          /mirrors/rpmforge/dag/redhat/el4/en/i386/dag/RPMS/
16          /mirrors/fedora/updates/3/i386/          /mirrors/atrpms/el4-i386/atrpms/stable/
17          /mirrors/fedora/3/i386/os/Fedora/RPMS/          /mirrors/rpmforge/dag/dries/redhat/el4/en/i386/RPMS.dries/
18          /mirrors/mitel/devel/repo/RPMS/          /mirrors/fedora-legacy/fedora/3/updates/i386/
19          /builds/rpms/RPMS/i686/          /mirrors/fedora-legacy/fedora/3/os/i386/
20          /builds/rpms/RPMS/i586/          /builds/rpms/RPMS/i686/
21          /builds/rpms/RPMS/i386/          /builds/rpms/RPMS/i586/
22          /builds/rpms/RPMS/noarch/          /builds/rpms/RPMS/i386/
23          );          /builds/rpms/RPMS/noarch/
24            );
25    
26  opendir RPMS, $build_dir or die "Couldn't opendir $build_dir";  opendir RPMS, $build_dir or die "Couldn't opendir $build_dir";
27  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("$build_dir/$_", $rpm_flags); $x->tag('NAME') => $x; } grep { /\.rpm$/ } readdir RPMS;
# Line 44  foreach my $rpm ( sort keys %rpms ) Line 45  foreach my $rpm ( sort keys %rpms )
45      foreach my $file ( grep { /^$rpmfix-[0-9].*\.rpm$/ } keys %repos )      foreach my $file ( grep { /^$rpmfix-[0-9].*\.rpm$/ } keys %repos )
46      {      {
47          $header = RPM2->open_package("$repos{$file}/$file", $rpm_flags);          $header = RPM2->open_package("$repos{$file}/$file", $rpm_flags);
48          if ($header ge $rpms{$rpm} || $header->filename =~ m#/centos.*/(os|updates)/#)          if ($header ge $rpms{$rpm} || $header->filename =~ m#/centos/[\d.]+/(os|updates|fasttrack|extras)/#)
49          {          {
50              push @headers, $header;              push @headers, $header;
51          }          }
52      }      }
53      @headers = reverse sort { $a cmp $b } @headers;      @headers = reverse sort { $a cmp $b } @headers;
54      if (grep { $_->filename =~ m#/centos.*/updates/# } @headers)      if (grep { $_->filename =~ m#/centos/[\d.]+/(updates|fasttrack)/# } @headers)
55      {      {
56          @headers = grep { $_->filename !~ m#/centos.*/os/# } @headers;          @headers = grep { $_->filename !~ m#/centos/[\d.]+/os/# || $_ eq $rpms{$rpm} } @headers;
57      }      }
58      if (grep { $_->filename =~ m#/centos.*/(updates|os|dag)/# } @headers)      if (grep { $_->filename =~ m#/centos/[\d.]+/(os|updates|fasttrack|extras)/# || $_->filename =~ m#/dag/[^d]# } @headers)
59      {      {
60          @headers = grep { $_->filename !~ m#/fedora.*/(updates|os)/# } @headers;          @headers = grep { $_->filename !~ m#/atrpms/# || $_ eq $rpms{$rpm} } @headers;
61          @headers = grep { $_->filename !~ m#/centos.*/atrpms/# } @headers;          @headers = grep { $_->filename !~ m#/fedora/# || $_ eq $rpms{$rpm} } @headers;
62            @headers = grep { $_->filename !~ m#/fedora-legacy/# || $_ eq $rpms{$rpm} } @headers;
63      }      }
64      if ($#headers < 0)      if ($#headers < 0)
65      {      {
66          print "$rpm\n";          print "$rpm\n";
67          print "  ***** can't find $rpm in any repository *****\n";          print "  ***** can't find $rpm in any repository *****\n";
68      }      }
69      elsif ( $headers[0]->filename !~ m#/centos.*/(updates|os)/#  || $headers[0] ne $rpms{$rpm} )      elsif ( $headers[0]->filename !~ m#/centos/[\d.]+/(os|updates|fastrrack|extras)/#  || $headers[0] ne $rpms{$rpm} )
70      {      {
71          if (grep { $_ ne $rpms{$rpm} } @headers)          if (grep { $_ ne $rpms{$rpm} } @headers)
72          {          {
# Line 73  foreach my $rpm ( sort keys %rpms ) Line 75  foreach my $rpm ( sort keys %rpms )
75              {              {
76                  my $path = $header->filename;                  my $path = $header->filename;
77                  $path =~ s@^(.*)/.*@$1@;                  $path =~ s@^(.*)/.*@$1@;
78                    my $filename = $rpms{$rpm}->filename;
79                    $filename =~ s@^.*/(.*)@$1@;
80                  print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n";                  print " " . ($header eq $rpms{$rpm} ? "** " : "-- ") . $header->as_nvre . " ($path)\n";
81                    #print "     - rm $build_dir/$filename; cp ". $header->filename . " $build_dir\n";
82              }              }
83          }          }
84      }      }


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