From 74060782dd67e3e960fac20c759bc025c91caece Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 25 Nov 2009 03:37:08 +0000 Subject: Bug 530960: Put hooks into template/default/hook instead of template/hook Patch by Max Kanat-Alexander (module owner) a=mkanat --- contrib/extension-convert.pl | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'contrib') diff --git a/contrib/extension-convert.pl b/contrib/extension-convert.pl index 1f29db3da..88718cf83 100644 --- a/contrib/extension-convert.pl +++ b/contrib/extension-convert.pl @@ -261,23 +261,22 @@ sub move_template_hooks { my ($dir) = @_; foreach my $lang (glob("$dir/template/*")) { next if !_file_matters($lang); - mkpath("$lang/hook") || die "$lang/hook: $!"; + my $hook_container = "$lang/default/hook"; + mkpath($hook_container) || warn "$hook_container: $!"; # Hooks can be in all sorts of weird places, including # template/default/hook. - foreach my $hooks_container ($lang, "$lang/default/hook") { - foreach my $file (glob("$hooks_container/*")) { - next if !_file_matters($file, 1); - my $dirname = basename($file); - print "Moving $file to $lang/hook/$dirname...\n"; - rename($file, "$lang/hook/$dirname") || die "move failed: $!"; - } + foreach my $file (glob("$lang/*")) { + next if !_file_matters($file, 1); + my $dirname = basename($file); + print "Moving $file to $hook_container/$dirname...\n"; + rename($file, "$hook_container/$dirname") || die "move failed: $!"; } } } sub _file_matters { my ($path, $tmpl) = @_; - my @ignore = qw(default custom CVS hook); + my @ignore = qw(default custom CVS); my $file = basename($path); return 0 if grep(lc($_) eq lc($file), @ignore); # Hidden files -- cgit v1.2.3-24-g4f1b