From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mathias Megyei Newsgroups: gmane.emacs.devel Subject: GPL v3 Date: Thu, 12 Jul 2007 23:05:30 +0200 Message-ID: <18070.38810.32996.85427@gargle.gargle.HOWL> Reply-To: mathias@mnet-mail.de NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184274373 10126 80.91.229.12 (12 Jul 2007 21:06:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Jul 2007 21:06:13 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 12 23:06:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I95r4-0005om-HG for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2007 23:05:46 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I95r3-00080B-Qb for ged-emacs-devel@m.gmane.org; Thu, 12 Jul 2007 17:05:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I95qz-0007zr-82 for emacs-devel@gnu.org; Thu, 12 Jul 2007 17:05:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I95qv-0007zH-Qo for emacs-devel@gnu.org; Thu, 12 Jul 2007 17:05:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I95qv-0007zD-N3 for emacs-devel@gnu.org; Thu, 12 Jul 2007 17:05:33 -0400 Original-Received: from mail-out.m-online.net ([212.18.0.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I95qv-0000QD-6N for emacs-devel@gnu.org; Thu, 12 Jul 2007 17:05:33 -0400 Original-Received: from mail01.m-online.net (mail.m-online.net [192.168.3.149]) by mail-out.m-online.net (Postfix) with ESMTP id 7ACDA24A880; Thu, 12 Jul 2007 23:10:11 +0200 (CEST) Original-Received: from champfer (ppp-82-135-1-131.dynamic.mnet-online.de [82.135.1.131]) by mail.mnet-online.de (Postfix) with ESMTP id BC45E91923; Thu, 12 Jul 2007 23:05:30 +0200 (CEST) X-Mailer: VM 7.19 under Emacs 22.1.2 X-detected-kernel: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74696 Archived-At: Hi, I wrote a little perl script to change the gpl version to 3. It looks for the strings "Free\s+Software\s+Foundation" and "version\s+2" in the same line and replaces 2 by 3. I started the script on EMACS_22_BASE branch. It has changed 1617 files. Perhaps somebody finds it useful. Mathias #!/usr/bin/perl use strict; use FileHandle; use vars qw($dir $file @list ); sub change_gpl($); # start in current directory @list = glob("./*"); foreach my $d (@list) { $fhtest->print("$d\n"); if (-d $d and ! -l $d) { # if directory, append to @list and look into it later push(@list, glob($d . "/*")); } elsif (-f $d) { # file found, update it to gpl3 change_gpl($d); } else { # not file and not directory, should never happen print("of unknown type: $d\n"); } } sub change_gpl($) { my ($file, $fhtes) = @_; my $fh = new FileHandle $file, "r"; my $gplfound = 0; if (! defined($fh)) { die "Couldn't open file $file for reading!"; } else { my @thefile; my $linenr = 0; while (my $line = $fh->getline()) { $linenr++; chomp($line); if ($line =~ m/Free\s+Software\s+Foundation/) { if ($line =~ m/version\s+2/) { $line =~ s/(version)\s+2/$1 3/; $gplfound = 1; } } push(@thefile, $line); } $fh->close(); # write $file only when the gpl version has been changed if ($gplfound) { $fh->open($file, "w"); if (! defined($fh)) { die "Couldn't open file $file for writing!"; } foreach my $l (@thefile) { $fh->print($l . "\n"); } $fh->close(); } } }