From kde-devel Tue Jun 13 20:47:58 2000 From: Mirko Sucker Date: Tue, 13 Jun 2000 20:47:58 +0000 To: kde-devel Subject: Re: The Licencing Issue X-MARC-Message: https://marc.info/?l=kde-devel&m=96092919721534 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------F6D1CEC7585DEBCF78B7C2FC" This is a multi-part message in MIME format. --------------F6D1CEC7585DEBCF78B7C2FC Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Talin wrote: > = > Here are some things that I hear often from KDE developers on this > issue: > = > 1. "We don't need to change the license, therefore we won't change it."= > = > My question is: Do you generally refuse to add features that yo= ur users > have requested, even if you personally don't need them? Attached is a perl script that suits for changing licenses, contact information etc in C++ source file automatically. For the people who simply do not want to spend the time to change the licenses :-) Just put, instead of your normal headers, the macros $Author$, $License$, ... (read the script) in your sources, and run the script on the file. To change the license, change the script. = Example start of a C++ file: /* Hello World implemented using a graphical user interface. $Copyright$ $Author$ $License$ $Contact$ */ Run the script, and it will look like: /* Hello World implemented using a graphical user interface. $ Copyright: (C) 2000, Mirko Sucker $ $ Author: Mirko Sucker $ $ License: GPL with the following explicit addition: This code may be linked against any version of the Qt toolkit from Troll Tech, Norway. $ $ Contact: mirko@kde.org http://www.kde.org $ */ The script may run as often as you want to, and will replace the text blocks. Does this make sense? I do not know, but if it helps... --Mirko. -- = Drei Dinge gibt es, denen alle Menschen gern gem=FCtlich zuschauen: =B0 fliessendes Wasser, =B0 knisterndes Feuer und (am allerliebsten) =B0 anderen Menschen beim Arbeiten. (Charlie Brown). --------------F6D1CEC7585DEBCF78B7C2FC Content-Type: application/x-perl; name="makeheaders.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="makeheaders.pl" #!/usr/bin/perl -w # # (C) Mirko Sucker, 2000. # Released under GPL. # # This script replaces all keywords found as elements in the hash # @Contents embraced by dollar signs by the contents predefined in the # hash. It processes all files given at the command line. The texts # may not contain the dollar sign ($), as this is used to mark texts # to replace. Example: $Author$ will be replaced by the text $ Author: # $ The script is intended to be used in # # C++ files, place a multiline comment around the macros. # Some constants for clearer code: $LicenseText= "License: GPL with the following explicit addition:\n" . " This code may be linked against any version of the Qt toolkit\n" . " from Troll Tech, Norway."; $ContactText= "Contact: mirko\@kde.org\n" . " http://www.kde.org"; # This hash defines the keywords: %Contents = ( "Author" => "Author: Mirko Sucker", "License" => $LicenseText, "Copyright" => "Copyright: (C) 2000, Mirko Sucker", "Contact" => $ContactText ); # ----- main part: # preparation: $#ARGV+1>0 || die "Give filenames to search and replace keywords in!"; print "Using the following settings and keywords:\n"; foreach $key (keys %Contents) { print $key . " = " . $Contents{$key} . "\n"; } # iterate over given files: foreach $file(@ARGV) { print("Processing $file.\n"); if(open(InFileHandle, "<".$file)) { # read complete file content into scalar text: $text=""; @temp=; foreach(@temp) { $text=$text . $_; } # start replacing: foreach $key (keys %Contents) { $keyword=$key; if($text=~ s/\$\s*$key\s*.*?\s*\$/\$ $Contents{$key} \$/s) { print(" Found keyword $key.\n"); } } close(InFileHandle); if(open(OutFileHandle, ">".$file)) { print(OutFileHandle $text); } else { print(" Cannot write $file: permission denied."); } } else { print(" File $file does not exist.\n"); } print("Done processing $file.\n"); } --------------F6D1CEC7585DEBCF78B7C2FC-- >> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<