bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Minor chagnes to contrib/check_cvs.in


From: Donald Sharp
Subject: Minor chagnes to contrib/check_cvs.in
Date: Mon, 24 Feb 2003 11:30:26 -0500
User-agent: Mutt/1.4i

Index: ChangeLog
===================================================================
RCS file: /home2/cvsroot/ccvs/contrib/ChangeLog,v
retrieving revision 1.90
diff -c -r1.90 ChangeLog
*** ChangeLog   3 Feb 2003 23:50:51 -0000       1.90
--- ChangeLog   24 Feb 2003 16:29:12 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2003-02-24  Donald Sharp <address@hidden>
+ 
+       * check_cvs.in: Fixed multiple symlinks in your cvsroot,
+       improved CVSROOT/CVSROOT handling( Patch from Shlomo
+       Reinstein <address@hidden ).  Fixed retrieving revisions
+       of ,v files. 
+  
  2003-02-03  Derek Price  <address@hidden>
  
        * newcvsroot.sh: New file.
Index: check_cvs.in
===================================================================
RCS file: /home2/cvsroot/ccvs/contrib/check_cvs.in,v
retrieving revision 1.1
diff -c -r1.1 check_cvs.in
*** check_cvs.in        21 Nov 2002 19:04:38 -0000      1.1
--- check_cvs.in        24 Feb 2003 16:29:12 -0000
***************
*** 67,72 ****
--- 67,73 ----
  my $total_revisions;
  my $total_interesting_revisions;
  my $total_files;
+ my @ignore_files;
  
  ######################################################################
  #                    SUBROUTINES                                     #
***************
*** 121,132 ****
  }
  
  $directory_to_look_at = $ENV{ CVSROOT };
! if( -l $directory_to_look_at )
  {
      $directory_to_look_at = readlink( $directory_to_look_at );
  }
  
  print( "Processing: $directory_to_look_at\n" ) if( $verbose );
  find( \&process_file, $directory_to_look_at );
  
  my $num_files = @list_of_broken_files;
--- 122,140 ----
  }
  
  $directory_to_look_at = $ENV{ CVSROOT };
! my $sym_count = 0;
! while( -l $directory_to_look_at )
  {
      $directory_to_look_at = readlink( $directory_to_look_at );
+     $sym_count += 1;
+     if( $sym_count > 5 )
+     {
+         die( "Encountered too many symlinks for $ENV{ CVSROOT }\n" );
+     }
  }
  
  print( "Processing: $directory_to_look_at\n" ) if( $verbose );
+ @ignore_files = &get_ignore_files_from_cvsroot( $directory_to_look_at );
  find( \&process_file, $directory_to_look_at );
  
  my $num_files = @list_of_broken_files;
***************
*** 184,217 ****
      elsif( ! -d $File::Find::name )
      {
          my $save = 0;
-         my @ignore_files = ( 'CVS\/fileattr$',
-                              '^CVSROOT\/modules',
-                              '^CVSROOT\/.#modules',
-                              '^CVSROOT\/loginfo',
-                              '^CVSROOT\/.#loginfo',
-                              '^CVSROOT\/rcsinfo',
-                              '^CVSROOT\/.#rcsinfo',
-                              '^CVSROOT\/editinfo',
-                              '^CVSROOT\/.#editinfo',
-                              '^CVSROOT\/commitinfo',
-                              '^CVSROOT\/.#commitinfo',
-                              '^CVSROOT\/taginfo',
-                              '^CVSROOT\/.#taginfo',
-                              '^CVSROOT\/notify',
-                              '^CVSROOT\/.#notify',
-                              '^CVSROOT\/checkoutlist',
-                              '^CVSROOT\/.#checkoutlist',
-                              '^CVSROOT\/cvswrappers',
-                              '^CVSROOT\/.#cvswrappers',
-                              '^CVSROOT\/val-tags',
-                              '^CVSROOT\/.#val-tags',
-                              '^CVSROOT\/verifymsg',
-                              '^CVSROOT\/.#verifymsg',
-                              '^CVSROOT\/config',
-                              '^CVSROOT\/.#config',
-                              '^CVSROOT\/history',
-                              '^CVSROOT\/cvsignore',
-                              '^CVSROOT\/.#cvsignore' );
  
          foreach my $ignore ( @ignore_files )
          {
--- 192,197 ----
***************
*** 324,339 ****
      my( $file ) = @_;
      my @revisions;
      my $revision;
! 
      my $save_ = $_;
  
      open( FILE, "rlog -N '$file' 2>&1 |" ) or die( "unable to run rlog, help" 
);
  
      while( <FILE> )
      {
!         if( ( $revision ) = /^revision (.*)$/  )
          {
             push( @revisions, $revision );
          }
      }
  
--- 304,328 ----
      my( $file ) = @_;
      my @revisions;
      my $revision;
!     my $ignore = 1;
      my $save_ = $_;
  
      open( FILE, "rlog -N '$file' 2>&1 |" ) or die( "unable to run rlog, help" 
);
  
      while( <FILE> )
      {
!         #rlog outputs a "----" line before the actual revision
!         #without this we'll pick up peoples comments if they 
!         #happen to start with revision
!       if( /^----------------------------$/ )
!       {
!           $ignore = 0;
!         }
! 
!         if( ( !$ignore ) && ( ( $revision ) = /^revision (.*)$/ ) )
          {
             push( @revisions, $revision );
+            $ignore = 1;
          }
      }
  
***************
*** 752,755 ****
--- 741,817 ----
      }
  
      return( $branch, pop( @split_rev ) );
+ }
+ 
+ ######################################################################
+ #
+ #    NAME :
+ #      get_ignore_files_from_cvsroot
+ #
+ #    PURPOSE :
+ #      Retrieve the list of files from the CVSROOT/ directory
+ #      that should be ignored. 
+ #      These are the regular files (e.g., commitinfo, loginfo)
+ #      and those specified in the checkoutlist file.
+ #
+ #    PARAMETERS :
+ #      The CVSROOT
+ #
+ #    GLOBALS :
+ #      NONE
+ #
+ #    RETURNS :
+ #      @ignore - the list of files to ignore
+ #
+ #    COMMENTS :
+ #      NONE
+ #
+ ######################################################################
+ sub get_ignore_files_from_cvsroot {
+     my( $cvsroot ) = @_;
+     my @ignore = ( 'CVS\/fileattr$',
+                    '^CVSROOT\/modules',
+                    '^CVSROOT\/.#modules',
+                    '^CVSROOT\/loginfo',
+                    '^CVSROOT\/.#loginfo',
+                    '^CVSROOT\/rcsinfo',
+                    '^CVSROOT\/.#rcsinfo',
+                    '^CVSROOT\/editinfo',
+                    '^CVSROOT\/.#editinfo',
+                    '^CVSROOT\/commitinfo',
+                    '^CVSROOT\/.#commitinfo',
+                    '^CVSROOT\/taginfo',
+                    '^CVSROOT\/.#taginfo',
+                    '^CVSROOT\/notify',
+                    '^CVSROOT\/.#notify',
+                    '^CVSROOT\/checkoutlist',
+                    '^CVSROOT\/.#checkoutlist',
+                    '^CVSROOT\/cvswrappers',
+                    '^CVSROOT\/.#cvswrappers',
+                    '^CVSROOT\/val-tags',
+                    '^CVSROOT\/.#val-tags',
+                    '^CVSROOT\/verifymsg',
+                    '^CVSROOT\/.#verifymsg',
+                    '^CVSROOT\/config',
+                    '^CVSROOT\/.#config',
+                    '^CVSROOT\/history',
+                    '^CVSROOT\/cvsignore',
+                    '^CVSROOT\/.#cvsignore' );
+     my $checkoutlist_file = "$cvsroot\/CVSROOT\/checkoutlist";
+     open( CHECKOUTLIST, "<$cvsroot\/CVSROOT\/checkoutlist" )
+         or die( "Unable to read checkoutlist file: $!\n" );
+ 
+     my @list = <CHECKOUTLIST>;
+     chomp( @list );
+     close( CHECKOUTLIST )
+         or die( "Unable to close checkoutlist file: $!\n" );
+ 
+     foreach my $line( @list )
+     {
+         next if( $line =~ /^#/ || $line =~ /^$/ );
+         if( $line =~ /^\s*(\S*)\s*/ ) { $line = $1 };
+         push( @ignore, "^CVSROOT\/$line", "^CVSROOT\/\.#$line" );
+     } 
+ 
+     return @ignore;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]