summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/new-yui3.pl41
1 files changed, 41 insertions, 0 deletions
diff --git a/contrib/new-yui3.pl b/contrib/new-yui3.pl
new file mode 100755
index 000000000..c593cc3a2
--- /dev/null
+++ b/contrib/new-yui3.pl
@@ -0,0 +1,41 @@
+#!/usr/bin/perl -w
+#
+# Updates the version of YUI3 used by Bugzilla. Just pass the path to
+# an unzipped yui release directory, like:
+#
+# contrib/new-yui3.pl /path/to/yui3/
+#
+
+use strict;
+
+use File::Copy::Recursive qw(dircopy);
+use File::Find;
+use File::Basename;
+
+my $SOURCE_PATH = shift;
+my $DEST_PATH = shift;
+
+
+dircopy("$SOURCE_PATH/build", $DEST_PATH) || die $!;
+
+find(
+ sub {
+ my $delete = 0;
+ my $filename = basename $File::Find::name;
+ if ($filename =~ /-debug\.js$/
+ || $filename =~ /-coverage\.js$/
+ || $filename =~ /-skin\.css$/)
+
+ {
+ $delete = 1;
+ }
+ elsif ($filename =~ /-min\.js/) {
+ $filename =~ s/-min//;
+ $delete = 1;
+ }
+ return if !$delete;
+ print "deleting $filename\n";
+ unlink($filename) || die $!;
+ },
+ $DEST_PATH
+);