bug 816059 - properly reset blocklist in browser-chrome tests r=jaws
[gecko.git] / config / milestone.pl
blobdb3f6dd36ba1ce2224e951780f7c580e60a4c812
1 #!/usr/bin/perl -w
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 use Getopt::Long;
8 use strict;
9 use vars qw(
10 $OBJDIR
11 $SRCDIR
12 $TOPSRCDIR
13 $SCRIPTDIR
14 @TEMPLATE_FILE
15 $MILESTONE_FILE
16 $MILESTONE
17 $MILESTONE_NUM
18 @MILESTONE_PARTS
19 $MINI_VERSION
20 $MICRO_VERSION
21 $opt_debug
22 $opt_template
23 $opt_uaversion
24 $opt_help
27 $SCRIPTDIR = $0;
28 $SCRIPTDIR =~ s/[^\/]*$//;
29 push(@INC,$SCRIPTDIR);
31 require "Moz/Milestone.pm";
33 &GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
35 if (defined($opt_help)) {
36 &usage();
37 exit;
40 if (defined($opt_template)) {
41 @TEMPLATE_FILE = @ARGV;
42 if ($opt_debug) {
43 print("TEMPLATE_FILE = --@TEMPLATE_FILE--\n");
47 if (!defined($SRCDIR)) { $SRCDIR = '.'; }
48 if (!defined($OBJDIR)) { $OBJDIR = '.'; }
50 $MILESTONE_FILE = "$TOPSRCDIR/config/milestone.txt";
51 @MILESTONE_PARTS = (0, 0, 0, 0);
54 # Grab milestone (top line of $MILESTONE_FILE that starts with a digit)
56 my $milestone = Moz::Milestone::getOfficialMilestone($MILESTONE_FILE);
58 if (defined(@TEMPLATE_FILE)) {
59 my $TFILE;
61 foreach $TFILE (@TEMPLATE_FILE) {
62 my $BUILT_FILE = "$OBJDIR/$TFILE";
63 $TFILE = "$SRCDIR/$TFILE.tmpl";
65 if (-e $TFILE) {
67 Moz::Milestone::build_file($TFILE,$BUILT_FILE);
69 } else {
70 warn("$0: No such file $TFILE!\n");
73 } elsif(defined($opt_uaversion)) {
74 my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . "." .
75 Moz::Milestone::getMilestoneMinor($milestone);
76 # strip off trailing pre-release indicators
77 $uaversion =~ s/[a-z]+\d*$//;
78 print "$uaversion\n";
79 } else {
80 print "$milestone\n";
83 sub usage() {
84 print <<END
85 `milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files
86 END