[m-rev.] For review: automatically update copyright messages

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 13 14:06:43 AEDT 2002


On 12-Nov-2002, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> > The regexp substitions there do not look entirely 100% fool-proof.
> 
> I've tested the substitutions with:
> 
> Copyright (C) 1999 The University of Melbourne.
> Copyright (C) 2002 The University of Melbourne.
> Copyright (C) 1999-2002 The University of Melbourne.
> Copyright (C) 1999-2001 The University of Melbourne.
> Copyright (C) 1999-2000 The University of Melbourne.
> Copyright (C) 1999-2000, 2001 The University of Melbourne.
> 
> and it all works fine.

Sure, but what about e.g.

	Copyright (C) J. R. Hacker and The University of Melbourne, 2001

?

> +		$tmp = POSIX::tmpnam();
> +		open(TMP, ">$tmp") or die "Error opening temporary file $tmp for writing: $!\n";
>  		foreach $line (@lines)
>  		{
> -			print ARG $line;
> +			print TMP $line;
> +		}
> +		close(TMP);
> +
> +		print "Updated the copyright message in file `$arg'\n";
> +		print "Here is the diff:\n";
> +		system("diff", "-u", $arg, $tmp);
> +		if ( query_user("Accept the version with the updated copyright message?", 1) )
> +		{
> +			system("mv", $tmp, $arg);

Maybe you should use `system(...) || die("...")'?

> +
> +		if ( $default_yes )
> +		{ $default_string = "[y]" }
> +		else
> +		{ $default_string = "[n]" }

Missing semicolons before "}"?

> @@ -246,8 +264,12 @@
>  		# redirects X connections back to their origin.
>  		#
>  
> -		$result = system "xmessage", "-buttons", "yes:0,no:1",
> -				"Problem with `$file'.  Commit anyway?";
> +		if ( $default_yes )
> +		{ $default_string = "-default yes" }
> +		else
> +		{ $default_string = "-default no" }

Missing semicolons before "}"?


-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list