anjuta r3730 - in trunk: . libanjuta plugins/tools/scripts



Author: jhs
Date: Fri Feb 29 18:07:21 2008
New Revision: 3730
URL: http://svn.gnome.org/viewvc/anjuta?rev=3730&view=rev

Log:
2008-02-29  Johannes Schmid  <jhs gnome org>

	* libanjuta/Makefile.am:
	Fixed a build error when building with -j X
	
	* plugins/tools/scripts/prepare-changelog.pl:
	Updated to latest script version in gnome svn

Modified:
   trunk/ChangeLog
   trunk/libanjuta/Makefile.am
   trunk/plugins/tools/scripts/prepare-changelog.pl

Modified: trunk/libanjuta/Makefile.am
==============================================================================
--- trunk/libanjuta/Makefile.am	(original)
+++ trunk/libanjuta/Makefile.am	Fri Feb 29 18:07:21 2008
@@ -132,11 +132,11 @@
 	&& rm -f xgen-gmc
 
 anjuta-marshal.c: anjuta-marshal.h anjuta-marshal.list
-	echo "#include \"anjuta-marshal.h\"" > xgen-gmc \
+	echo "#include \"anjuta-marshal.h\"" > xgenc-gmc \
 	&& @GLIB_GENMARSHAL@ \
-	        --prefix=anjuta_cclosure_marshal $(srcdir)/anjuta-marshal.list --body >> xgen-gmc \
-	&& cp xgen-gmc $(@F) \
-	&& rm -f xgen-gmc
+	        --prefix=anjuta_cclosure_marshal $(srcdir)/anjuta-marshal.list --body >> xgenc-gmc \
+	&& cp xgenc-gmc $(@F) \
+	&& rm -f xgenc-gmc
 
 anjuta-enum-types.h: stamp-anjuta-enum-types.h
 	@true

Modified: trunk/plugins/tools/scripts/prepare-changelog.pl
==============================================================================
--- trunk/plugins/tools/scripts/prepare-changelog.pl	(original)
+++ trunk/plugins/tools/scripts/prepare-changelog.pl	Fri Feb 29 18:07:21 2008
@@ -1,4 +1,5 @@
 #!/usr/bin/perl -w
+# vim: ft=perl
 # -*- Mode: perl; indent-tabs-mode: nil; c-basic-offset: 2  -*-
 
 # Perl script to create a ChangeLog entry with names of files
@@ -7,11 +8,15 @@
 # Darin Adler <darin eazel com>, started 20 April 2000
 # Java support added by Maciej Stachowiak <mjs eazel com>
 # Multiple ChangeLog support added by Laszlo (Laca) Peter <laca sun com>
-# last updated 23 May 2006
+# Fernando Herrera added Subversion support
+# Sven Herzberg added Git support
+# Behdad Esfahbod improved the file format
+# last updated 13 February 2007
 #
 # (Someone put a license in here, like maybe GPL.)
 #
 # TODO:
+#   Command line parameter for reviewed-by lines
 #   Provide option to put new ChangeLog into a separate file
 #     instead of editing the ChangeLog.
 #   For new files, just say "New file" instead of listing
@@ -45,21 +50,25 @@
 use English;
 use Text::Wrap;
 use File::Basename;
+use File::Temp qw/ tempfile /;
 
-# Check for cvs or svn system
+# Check for cvs, svn or git system
 my $command;
-if (-e ".svn/entries")
+if (-e "CVS/Root")
+  {
+    $command = "cvs";
+  }
+elsif (-e ".svn/entries")
   {
     $command = "svn";
   }
-elsif (-e "CVS/Root")
+elsif (system ("git-rev-parse --git-dir > /dev/null") >> 8 == 0)
   {
-    $command = "cvs";
+    $command = "git";
   }
 else
   {
-    my $curr_dir = getcwd();
-    die "There is not known revision system in $curr_dir.\n"
+    die "There is not known revision system.\n"
   }
 
 # Update the change log file.
@@ -68,9 +77,13 @@
     if ($command eq "cvs") {
         print STDERR "  Updating $logname from cvs repository.\n";
         open ERRORS, "cvs update $logname |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n";
-    } else {
+    } elsif ($command eq "svn") {
         print STDERR "  Updating $logname from svn repository.\n";
         open ERRORS, "svn update $logname |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n";
+    } else {
+        print STDERR "  Not updating ChangeLog from git repository.\n";
+	#open ERRORS, "svn update ChangeLog |" or die "The cvs update of ChangeLog failed: $OS_ERROR.\n";
+	open ERRORS, "true |";
     }
     print STDERR "    $ARG" while <ERRORS>;
     close ERRORS;
@@ -85,21 +98,46 @@
     print STDERR "  Running cvs diff to find changes.\n";
     open DIFF, "cvs -fq diff -N |" or die "The cvs diff failed: $OS_ERROR.\n";
   }
-else
+elsif ($command eq "svn")
   {
     print STDERR "  Running svn diff to find changes.\n";
-    open DIFF, "svn --non-interactive diff --diff-cmd diff -x \"-b\" |" or die "The cvs diff failed: $OS_ERROR.\n";
+    open DIFF, "svn --non-interactive diff --diff-cmd diff -x \"-b\" |" or die "The svn diff failed: $OS_ERROR.\n";
+  }
+else
+  {
+    my ($tmphandle,$tmpname) = tempfile (UNLINK => 1);
+    print STDERR "  Running git diff to find changes.\n";
+    my @args = ("git-diff", "--cached", "--quiet");
+    my $cached = "HEAD";
+    my $reference = ""; # our reference for diffing; HEAD or --cached
+    system (@args);
+    if ($? >> 8)
+      {
+	$cached = "--cached";
+      }
+    print $tmphandle <<EOF;
+#!/bin/bash
+echo "Index: \$1"
+echo "==================================================================="
+diff -b \$2 \$5 || true
+EOF
+    close $tmphandle or die "Failed closing the script file: $OS_ERROR.\n";
+    chmod (0700, $tmpname);
+    open DIFF, "GIT_EXTERNAL_DIFF='$tmpname' git diff $cached |" or die "The git diff failed: $OS_ERROR.\n";
   }
 
 while (<DIFF>)
   {
     $file = $1 if /^Index: (\S+)$/;
-    my $basename = basename ($file);
-    if (defined $file
-        and $basename ne "ChangeLog"
-        and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) )
+
+    if (defined $file)
       {
-        push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ];
+        my $basename = basename ($file);
+        if ($basename ne "ChangeLog"
+            and (/^\d+(,\d+)?[acd](\d+)(,(\d+))?/ or /^Binary files/) )
+          {
+            push @{$changed_line_ranges{$file}}, [ $2, $4 || $2 ];
+          }
       }
   }
 close DIFF;
@@ -157,7 +195,7 @@
       }
 
     # Format the list of functions now.
-    $function_lists{$file} = " (" . join("), (", @functions) . "):" if @functions;
+    $function_lists{$file} = " (" . join("), (", @functions) . ")" if @functions;
   }
 
 # Write out a new ChangeLog file.
@@ -186,7 +224,7 @@
   (localtime $BASETIME)[3]; # day within month
 my $name = $ENV{CHANGE_LOG_NAME}
   || $ENV{REAL_NAME}
-  || (getpwuid $REAL_USER_ID)[6]
+  || ((split(",",(getpwuid $REAL_USER_ID)[6]))[0])
   || "set REAL_NAME environment variable";
 my $email_address = $ENV{CHANGE_LOG_EMAIL_ADDRESS}
   || $ENV{EMAIL_ADDRESS}
@@ -207,7 +245,7 @@
         my $fname = "./$file";
         if ($fname =~ /^${chlog}\//) {
             $fname =~ s/^${chlog}\///;
-            my $lines = wrap("\t", "\t", "XX$fname:$function_lists{$file}");
+            my $lines = wrap("\t", "\t", "XX$fname$function_lists{$file}:");
             $lines =~ s/^\tXX/\t* /;
             print CHANGE_LOG "$lines\n";
             delete ($function_lists{$file});
@@ -218,7 +256,7 @@
     
     # Done.
     print STDERR "  Done editing ${chlog}/ChangeLog.\n";
-    # To open the changelog file in emacs/similar editor 	 
+    # To open the changelog file in emacs/similar editor        
     print "\032\032${chlog}/ChangeLog:0\n";
     last if not (keys %function_lists);
 }



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