You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@gump.apache.org by Sam Ruby <ru...@apache.org> on 2003/02/08 02:08:51 UTC
Automated search for licenses....
I'm attaching the Perl script I wrote to search for license files in
case it inspires any suggestions...
- Sam Ruby
Re: Automated search for licenses....
Posted by Sam Ruby <ru...@apache.org>.
Conor MacNeill wrote:
>>
>> Hopefully, tomorrow's bootstrap of Ant won't blow up,
>
> Ummm, sorry about that - bad timing 'n' all.
It happens. ;-)
OK, I'm submitting a build all as we speak. This will use the current
contents of the jakarta-gump repository as the definitions and will only
do a cvs update on ant (picking up the PumpStreamHandler changes).
In the morning (EST), we can take inventory of what we have got. Conor,
if you like, you can watch it in realtime (both the build and the jars).
As for me, I'll be in bed. ;-)
Meanwhile, I've uploaded the necessary packages to ensure that a build
gump check runs clean on that machine.
- Sam Ruby
Re: Automated search for licenses....
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
Sam Ruby wrote:
> Martin van den Bemt wrote:
>
>> Cool :) Thought you said it was going to be hard :)
>
>
> It was. ;-)
>
> Hopefully, tomorrow's bootstrap of Ant won't blow up,
Ummm, sorry about that - bad timing 'n' all.
Conor
Re: Automated search for licenses....
Posted by Sam Ruby <ru...@apache.org>.
Martin van den Bemt wrote:
> Cool :)
> Thought you said it was going to be hard :)
It was. ;-)
Hopefully, tomorrow's bootstrap of Ant won't blow up, and then we can
assess what needs to be done, and based on what's left figure out what
can be automated and what should be done by hand.
- Sam Ruby
Re: Automated search for licenses....
Posted by Martin van den Bemt <ml...@mvdb.net>.
Cool :)
Thought you said it was going to be hard :)
Mvgr,
Martin
On Sat, 2003-02-08 at 02:08, Sam Ruby wrote:
> I'm attaching the Perl script I wrote to search for license files in
> case it inspires any suggestions...
>
> - Sam Ruby
> ----
>
> #!/usr/bin/perl
> $path = "/home/rubys/jakarta";
>
> for $file (@ARGV) {
> open FILE, "<$file";
> @LINE = <FILE>;
> close FILE;
>
> ($module) = ($LINE[0] =~ /module\s+name="([-\w]+)"/);
> next unless $module;
> next unless -d "$path/$module";
>
> $license="";
> $license="license.txt" if -e "$path/$module/license.txt";
> $license="LICENSE.TXT" if -e "$path/$module/LICENSE.TXT";
> $license="LICENSE.txt" if -e "$path/$module/LICENSE.txt";
> $license="LICENSE" if -e "$path/$module/LICENSE";
>
> next unless $license;
>
> $lastjar = 0;
> for ($i=0; $i<=$#LINE; $i++) {
> ($lastjar,$indent) = ($i,$1) if ($LINE[$i] =~ /^(\s*)<jar/);
> last if $LINE[$i] =~ "</project>";
> }
>
> next unless $lastjar;
>
> if ($LINE[$lastjar+1] =~ /^\s*$/) {
> splice(@LINE,$lastjar+1,0,("\n", "$indent<license name=\"$license\"/>\n"));
> } else {
> splice(@LINE,$lastjar+1,0,("$indent<license name=\"$license\"/>\n"));
> }
>
> print "$file\n";
> open FILE, ">$file";
> print FILE join("",@LINE);
> close FILE;
> }
>
> ----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: gump-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: gump-help@jakarta.apache.org