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/.
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)) {
40 if (defined($opt_template)) {
41 @TEMPLATE_FILE = @ARGV;
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)) {
61 foreach $TFILE (@TEMPLATE_FILE) {
62 my $BUILT_FILE = "$OBJDIR/$TFILE";
63 $TFILE = "$SRCDIR/$TFILE.tmpl";
67 Moz
::Milestone
::build_file
($TFILE,$BUILT_FILE);
70 warn("$0: No such file $TFILE!\n");
73 } elsif(defined($opt_uaversion)) {
74 # Only expose the major milestone in the UA string, hide the patch level
75 # (bugs 572659 and 870868).
76 my $uaversion = Moz
::Milestone
::getMilestoneMajor
($milestone) . ".0";
84 `milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files