[Rt-commit] rt branch, 4.0/more-flexible-license_tag, created. rt-4.0.11rc1-30-g812b23a
Kevin Falcone
falcone at bestpractical.com
Thu Apr 11 17:02:44 EDT 2013
The branch, 4.0/more-flexible-license_tag has been created
at 812b23a8296d258bb7ee910011c153c6a256d489 (commit)
- Log -----------------------------------------------------------------
commit 68860d4da9b213a353d923db357179496ec3a554
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Apr 11 15:38:05 2013 -0400
Don't exit a sub via next
If your lib/ contained anything but .pm files you would get a bunch of
perl warnings about next'ing out of the sub instead of returning.
diff --git a/devel/tools/license_tag b/devel/tools/license_tag
index 03992d1..4fad057 100755
--- a/devel/tools/license_tag
+++ b/devel/tools/license_tag
@@ -182,7 +182,7 @@ sub tag_makefile {
sub tag_pm {
my $pm = $_;
- next unless $pm =~ /\.pm/s;
+ return unless $pm =~ /\.pm/s;
open( FILE, '<', $pm ) or die "Failed to open $pm";
my $file = (join "", <FILE>);
close (FILE);
commit 6ba647646e3143183ebe79966dbc27cec5100dc2
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Apr 11 15:37:34 2013 -0400
Allow for an html/ directory
RT doesn't have one (since the 3.8 days) but external extensions use
html not share/html.
diff --git a/devel/tools/license_tag b/devel/tools/license_tag
index 4fad057..4f3642d 100755
--- a/devel/tools/license_tag
+++ b/devel/tools/license_tag
@@ -103,7 +103,10 @@ use File::Find;
my @MAKE = qw(Makefile);
File::Find::find({ no_chdir => 1, wanted => \&tag_pm}, 'lib');
-File::Find::find({ no_chdir => 1, wanted => \&tag_mason}, 'share/html');
+for my $masondir (qw( html share/html )) {
+ next unless -d $masondir;
+ File::Find::find({ no_chdir => 1, wanted => \&tag_mason}, $masondir);
+}
File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'sbin');
File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'bin');
File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'etc/upgrade');
commit 812b23a8296d258bb7ee910011c153c6a256d489
Author: Kevin Falcone <falcone at bestpractical.com>
Date: Thu Apr 11 15:38:55 2013 -0400
Check for the existence of items before tagging
When running this script outside of RT, you often won't have a
devel/tools or a Makefile.in
diff --git a/devel/tools/license_tag b/devel/tools/license_tag
index 4f3642d..9acf647 100755
--- a/devel/tools/license_tag
+++ b/devel/tools/license_tag
@@ -107,11 +107,11 @@ for my $masondir (qw( html share/html )) {
next unless -d $masondir;
File::Find::find({ no_chdir => 1, wanted => \&tag_mason}, $masondir);
}
-File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'sbin');
-File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'bin');
-File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'etc/upgrade');
-File::Find::find({ no_chdir => 1, wanted => \&tag_script}, 'devel/tools');
-tag_makefile ('Makefile.in');
+for my $bindir (qw( sbin bin etc/upgrade devel/tools )) {
+ next unless -d $bindir;
+ File::Find::find({ no_chdir => 1, wanted => \&tag_script}, $bindir);
+}
+tag_makefile ('Makefile.in') if -f 'Makefile.in';
tag_makefile ('README');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list