aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-11-25 03:37:08 +0000
committermkanat%bugzilla.org <>2009-11-25 03:37:08 +0000
commit74060782dd67e3e960fac20c759bc025c91caece (patch)
tree357be5a889e555012298dcb8893b3bdf67214f90 /contrib
parentBug 530746: Create a script that converts extensions from the old format to t... (diff)
downloadbugzilla-74060782dd67e3e960fac20c759bc025c91caece.tar.gz
bugzilla-74060782dd67e3e960fac20c759bc025c91caece.tar.bz2
bugzilla-74060782dd67e3e960fac20c759bc025c91caece.zip
Bug 530960: Put hooks into template/default/hook instead of template/hook
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
Diffstat (limited to 'contrib')
-rw-r--r--contrib/extension-convert.pl17
1 files changed, 8 insertions, 9 deletions
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