SF.net SVN: geany: [2433] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Apr 1 12:53:35 UTC 2008


Revision: 2433
          http://geany.svn.sourceforge.net/geany/?rev=2433&view=rev
Author:   ntrel
Date:     2008-04-01 05:53:26 -0700 (Tue, 01 Apr 2008)

Log Message:
-----------
Add scripts folder for any useful scripts to work on code.
These scripts are not distributed with Geany, and are only in SVN.
Add changelist.pl to group and reverse ChangeLog entries, useful for writing NEWS.
Add missing-mnemonics.sh, to search for missing menu item mnemonics.

Added Paths:
-----------
    trunk/scripts/
    trunk/scripts/changelist.pl
    trunk/scripts/missing-mnemonics.sh

Added: trunk/scripts/changelist.pl
===================================================================
--- trunk/scripts/changelist.pl	                        (rev 0)
+++ trunk/scripts/changelist.pl	2008-04-01 12:53:26 UTC (rev 2433)
@@ -0,0 +1,54 @@
+#!/usr/bin/perl -w
+# Author:	Nick Treleaven
+# License:	GPL V2 or later
+
+# Searches a ChangeLog file for a line matching 'matchstring', then matches
+# all lines until two consecutive empty lines are found. The process then
+# repeats until all matching blocks of text are found.
+# Results are printed in reverse, hence in chronological order (as ChangeLogs
+# are usually written in reverse date order).
+
+use strict;
+
+my $scriptname = "changelist";
+my $argc = $#ARGV + 1;
+
+($argc == 2)
+	or die "Usage:\n$scriptname matchstring changelogfile\n";
+
+my ($matchstr, $infile) = @ARGV;
+
+open(INPUT, $infile)
+	or die "Couldn't open $infile for reading: $!\n";
+
+my $entry;	# the current matching block of text
+my @entries;
+my $found = 0;	# if we're in a matching block of text
+my $blank = 0;	# whether the last line was empty
+
+while (<INPUT>) {
+	my $line = $_;	# read a line, including \n char
+
+	if (! $found) {
+		($line =~ m/$matchstr/) and $found = 1;
+	} else {
+		if (length($line) <= 1)	# current line is empty
+		{
+			if ($blank > 0) {	# previous line was also empty
+				push(@entries, $entry);	# append entry
+				$entry = "";
+				$found = 0;	# now look for next match
+				$blank = 0;
+			}
+			else {
+				$blank = 1;
+			}
+		}
+	}
+	$found and $entry .= $line;
+}
+close(INPUT);
+
+foreach $entry (reverse @entries) {
+	print "$entry\n\n";
+}


Property changes on: trunk/scripts/changelist.pl
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Added: trunk/scripts/missing-mnemonics.sh
===================================================================
--- trunk/scripts/missing-mnemonics.sh	                        (rev 0)
+++ trunk/scripts/missing-mnemonics.sh	2008-04-01 12:53:26 UTC (rev 2433)
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Author:	Nick Treleaven
+# License:	GPL V2 or later
+# Usage:	check-mnemonics.sh [file list]
+
+if [[ $1 == '' ]]; then
+	FILES='src/*.c plugins/*.c'
+else
+	FILES=$1
+fi
+
+fgrep -n 'menu_item_new' $FILES |egrep -v '".*_[a-zA-Z0-9]' |fgrep -v from_stock |fgrep -v '_("No custom commands defined.")' |fgrep -vi '_("invisible")' |egrep '_\(".+' --color


Property changes on: trunk/scripts/missing-mnemonics.sh
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list