rpms/cvs2cl/devel cvs2cl.pl,1.1,1.2 cvs2cl.spec,1.5,1.6

Ville Skytta (scop) fedora-extras-commits at redhat.com
Sun Jan 23 16:29:04 UTC 2005


Author: scop

Update of /cvs/extras/rpms/cvs2cl/devel
In directory cvs.fedora.redhat.com:/tmp/cvs-serv10778/devel

Modified Files:
	cvs2cl.pl cvs2cl.spec 
Log Message:
auto-import cvs2cl-2.58-1 on branch devel from cvs2cl-2.58-1.src.rpm


Index: cvs2cl.pl
===================================================================
RCS file: /cvs/extras/rpms/cvs2cl/devel/cvs2cl.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- cvs2cl.pl	8 Nov 2004 04:11:22 -0000	1.1
+++ cvs2cl.pl	23 Jan 2005 16:29:02 -0000	1.2
@@ -19,6 +19,7 @@
 use File::Basename qw( fileparse );
 use Getopt::Long   qw( GetOptions );
 use Text::Wrap     qw( );
+use Time::Local    qw( timegm );
 use User::pwent    qw( getpwnam );
 
 # The Plan:
@@ -956,7 +957,20 @@
 # -------------------------------------
 
 sub output_tagdate {
-  # NOT YET DONE
+  my $self = shift;
+  my ($fh, $time, $tag) = @_;
+
+  my ($y, $m, $d, $H, $M, $S) = (gmtime($time))[5,4,3,2,1,0];
+
+  # Ideally, this would honor $UTC_Times and use +HH:MM syntax
+  my $isoDate = sprintf("%04d-%02d-%02dT%02d:%02d:%02dZ",
+                       $y + 1900, $m + 1, $d, $H, $M, $S);
+
+  print $fh "<tagdate>\n";
+  print $fh "<tagisodate>$isoDate</tagisodate>\n";
+  print $fh "<tagdatetag>$tag</tagdatetag>\n";
+  print $fh "</tagdate>\n\n";
+  return;
 }
 
 # -------------------------------------
@@ -1052,11 +1066,6 @@
   my $follow_branches = $self->{follow_branches};
   my $follow_only     = $self->{follow_only};
 
-#print STDERR "IG: ", join(',', keys %{$self->{ignore_tags}}), "\n";
-#print STDERR "IX: ", join(',', @{$qunk->{tags}}), "\n" if defined $qunk->{tags};
-#print STDERR "IQ: ", join(',', keys %{$qunk->{branch_numbers}}), "\n" if defined $qunk->{branch_numbers};
-#use Data::Dumper; print STDERR Dumper $qunk;
-
   for my $ignore_tag (keys %{$self->{ignore_tags}}) {
     return
       if defined $qunk->{tags} and grep $_ eq $ignore_tag, @{$qunk->{tags}};
@@ -1096,12 +1105,13 @@
            ($branch_number . ".") ) {
         if ( $followsub ) {
           return 1;
-        } elsif (length($revision) == length($branch_number)+2 ) {
+#        } elsif ( length($revision) == length($branch_number)+2 ) {
+        } elsif ( substr($revision, length($branch_number)+1) =~ /^\d+$/ ) {
           return 1;
         }
       } elsif ( length($branch_number) > length($revision)
                 and
-                $No_Ancestors ) {
+                ! $No_Ancestors ) {
         # Non-trivial case: check if rev is ancestral to branch
 
         # r_left still has the trailing "."
@@ -1214,13 +1224,13 @@
       # XML output includes everything else, we might as well make
       # it always include Day Of Week too, for consistency.
       my $authorhash = $changelog{$time};
-      if ($Show_Tag_Dates) {
+      if ( $Show_Tag_Dates || $XML_Output ) {
         my %tags;
         while (my ($author,$mesghash) = each %$authorhash) {
           while (my ($msg,$qunk) = each %$mesghash) {
-            foreach my $qunkref2 (@$qunk) {
+            for my $qunkref2 (@$qunk) {
               if (defined ($qunkref2->tags)) {
-                foreach my $tag (@{$qunkref2->tags}) {
+                for my $tag (@{$qunkref2->tags}) {
                   $tags{$tag} = 1;
                 }
               }
@@ -1925,22 +1935,38 @@
 sub read_changelog {
   my ($self, $command) = @_;
 
-#  my $grand_poobah = CVS::Utils::ChangeLog::EntrySet->new;
-
+  local (*READER, *WRITER);
+  my $pid;
   if (! $Input_From_Stdin) {
-    my $Log_Source_Command = join(' ', @$command);
-    &main::debug ("(run \"${Log_Source_Command}\")\n");
-    open (LOG_SOURCE, "$Log_Source_Command |")
-        or die "unable to run \"${Log_Source_Command}\"";
+    pipe(READER, WRITER)
+      or die "Couldn't form pipe: $!\n";
+    $pid = fork;
+    die "Couldn't fork: $!\n"
+      if ! defined $pid;
+    if ( ! $pid ) { # child
+      open STDOUT, '>&=' . fileno WRITER
+        or die "Couldn't dup stderr to ", fileno WRITER, "\n";
+      # strangely, some perls give spurious warnings about STDIN being opened
+      # for output only these close calls precede the STDOUT reopen above.
+      # I think they must be reusing fd 1.
+      close READER;
+      close STDIN;
+
+      exec @$command;
+    }
+
+    close WRITER;
+
+    &main::debug ("(run \"@$command\")\n");
   }
   else {
-    open (LOG_SOURCE, "-") or die "unable to open stdin for reading";
+    open READER, '-' or die "unable to open stdin for reading";
   }
 
-  binmode LOG_SOURCE;
+  binmode READER;
 
  XX_Log_Source:
-  while (<LOG_SOURCE>) {
+  while (<READER>) {
     chomp;
     s!\r$!!;
 
@@ -1968,17 +1994,19 @@
       # log message texts:
       $self->{rev_msg} .= $_ . "\n";   # Normally, just accumulate the message...
     } else {
+      my $noadd = 0;
       if ( ! $self->{rev_msg}
            or $self->{rev_msg} =~ /^\s*(\.\s*)?$/
            or index($self->{rev_msg}, EMPTY_LOG_MESSAGE) > -1 ) {
         # ... until a msg separator is encountered:
         # Ensure the message contains something:
-        $self->clear_msg
+        $self->clear_msg, $noadd = 1
           if $Prune_Empty_Msgs;
         $self->{rev_msg} = "[no log message]\n";
       }
 
-      $self->add_file_entry;
+      $self->add_file_entry
+        unless $noadd;
 
       if ( $_ eq FILE_SEPARATOR ) {
         $self->clear_file;
@@ -1988,9 +2016,15 @@
     }
   }
 
-  close LOG_SOURCE
-    or die sprintf("Problem reading log input (exit/signal/core: %d/%d/%d)\n",
-                   $? >> 8, $? & 127, $? & 128);
+  close READER
+    or die "Couldn't close pipe reader: $!\n";
+  if ( defined $pid ) {
+    my $rv;
+    waitpid $pid, 0;
+    0 == $?
+      or $!=1, die sprintf("Problem reading log input (pid/exit/signal/core: %d/%d/%d/%d)\n",
+                           $pid, $? >> 8, $? & 127, $? & 128);
+  }
   return;
 }
 
@@ -2127,9 +2161,8 @@
     ($base, undef, undef) = fileparse($path);
 
     my $xpath = $Case_Insensitive ? lc($path) : $path;
-    if ( grep index($path, $_) > -1, @Ignore_Files ) {
-      return;
-    }
+    return
+      if grep $path =~ /$_/, @Ignore_Files;
   }
 
   $self->{filename} = $path;
@@ -2399,7 +2432,7 @@
   my $accumulation_date = maybe_grab_accumulation_date;
   if ($accumulation_date) {
     # Insert -d immediately after 'cvs log'
-    my $Log_Date_Command = "-d\'>${accumulation_date}\'";
+    my $Log_Date_Command = "-d>${accumulation_date}";
 
     my ($log_index) = grep $command->[$_] eq 'log', 0..$#$command;
     splice @$command, $log_index+1, 0, $Log_Date_Command;
@@ -2456,6 +2489,7 @@
 }
 
 # -------------------------------------
+
 sub parse_options {
   # Check this internally before setting the global variable.
   my $output_file;
@@ -2605,7 +2639,7 @@
             )
     or die "options parsing failed\n";
 
-  push @log_source_command, map "'$_'", @ARGV;
+  push @log_source_command, map "$_", @ARGV;
 
   ## Check for contradictions...
 
@@ -2858,7 +2892,8 @@
 =item B<-I> I<REGEXP>, B<--ignore> I<REGEXP>
 
 Ignore files whose names match I<REGEXP>.  This option may be used multiple
-times.
+times.  The regexp is a perl regular expression.  It is matched as is; you may
+want to prefix with a ^ or suffix with a $ to anchor the match.
 
 =item B<-C>, B<--case-insensitive>
 
@@ -3038,6 +3073,14 @@
 
 Note that the rules for quoting under windows shells are different.
 
+=item *
+
+To run in an automated environment such as CGI or PHP, suidperl may be needed
+in order to execute as the correct user to enable /cvsroot read lock files to
+be written for the 'cvs log' command.  This is likely just a case of changing
+the /usr/bin/perl command to /usr/bin/suidperl, and explicitly declaring the
+PATH variable.
+
 =back
 
 =head1 EXAMPLES
@@ -3099,6 +3142,8 @@
 
 =item Terry Kane
 
+=item Pete Kempf
+
 =item Akos Kiss
 
 =item Claus Klein
@@ -3121,7 +3166,11 @@
 
 =item Thomas Parmelan
 
-=item Johanne Stezenbach
+=item Jordan Russell
+
+=item Jacek Sliwerski
+
+=item Johannes Stezenbach
 
 =item Joseph Walton
 


Index: cvs2cl.spec
===================================================================
RCS file: /cvs/extras/rpms/cvs2cl/devel/cvs2cl.spec,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- cvs2cl.spec	10 Dec 2004 22:03:02 -0000	1.5
+++ cvs2cl.spec	23 Jan 2005 16:29:02 -0000	1.6
@@ -1,5 +1,5 @@
 Name:           cvs2cl
-Version:        2.57
+Version:        2.58
 Release:        1
 Epoch:          0
 Summary:        Utility which generates ChangeLogs from CVS working copies
@@ -67,6 +67,9 @@
 
 
 %changelog
+* Sun Jan 16 2005 Marius L. Jøhndal <mariuslj at ifi.uio.no> - 0:2.58-1
+- Updated to 2.58.
+
 * Sat Jul 10 2004 Marius L. Jøhndal <mariuslj at ifi.uio.no> - 0:2.57-0.fdr.1
 - Updated to 2.57.
 - Moved XML and XSLT files from _datadir/sgml to _datadir/xml.




More information about the fedora-extras-commits mailing list