~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
cvs/emstar/make/get-cvs-tag.pl


  1 #!/usr/bin/perl
  2 
  3 #
  4 # This script examines all the CVS entries in a subdirectory tree and
  5 # prints, to standard output, their CVS tag.  If they are not tagged,
  6 # "None" is printed.  If the sources don't all share the same tag,
  7 # "Mixed_Sources" is printed.
  8 #
  9 # $Id: get-cvs-tag.pl,v 1.2 2004-03-29 07:28:57 jelson Exp $
 10 #
 11 
 12 use strict;
 13 
 14 my $dir;
 15 my $tag = undef;
 16 
 17 # print STDERR "\n\n\nRUNNING GET-CVS-TAG\n\n\n";
 18 
 19 # First command-line paramter is the directory we should search
 20 $dir = $ARGV[0] or $dir = ".";
 21 
 22 # First check for a VERSION file, if one exists.  Used for exported
 23 # releases.
 24 if (open(FILE, "VERSION")) {
 25     my $line = <FILE>;
 26     chop $line;
 27     print "$line";
 28     exit;
 29 }
 30 
 31 my @filelist = split(/\n/, `find $dir -name Entries -print`);
 32 
 33 foreach my $file (@filelist) {
 34     open(FILE, $file) or die "can't open $file: $!\n";
 35     while (my $line = <FILE>) {
 36         chomp $line;
 37 
 38         my ($dir, $fname, $rev, $date, $kflags, $rawtag) = split(/\//, $line);
 39         my $this_tag;
 40 
 41         # Skip directories
 42         next if ($dir eq "D");
 43 
 44         # First see if this source file is tagged
 45         if ($rawtag =~ /^T(.*)/) {
 46             $this_tag = "cvstag_" . $1;
 47         } else {
 48             $this_tag = "None";
 49         }
 50 
 51         # for debugging:
 52         # print "$fname: $this_tag (from $file, line $line)\n";
 53 
 54         # Now see if the tag matches other tags from this repo
 55         if (!defined $tag) {
 56             $tag = $this_tag;
 57         } else {
 58             $tag = "Mixed_Sources" if ($tag ne $this_tag);
 59         }
 60     }
 61     close FILE;
 62 }
 63 
 64 #print STDERR "CVS tag in  $dir: $tag\n";
 65 print "$tag";

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.