Bug 572659 - Don't expose the Gecko patch level (13.X.Y) in the UA string, only show the major version (13.X). r=glandium,bz sr=gerv

This commit is contained in:
Dão Gottwald 2012-02-20 15:39:33 +01:00
parent 64de674dcd
commit db675026d9
4 changed files with 22 additions and 6 deletions

View File

@ -51,6 +51,7 @@ use vars qw(
$MICRO_VERSION
$opt_debug
$opt_template
$opt_uaversion
$opt_help
);
@ -60,7 +61,7 @@ push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template');
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
if (defined($opt_help)) {
&usage();
@ -100,13 +101,19 @@ if (defined(@TEMPLATE_FILE)) {
warn("$0: No such file $TFILE!\n");
}
}
} elsif(defined($opt_uaversion)) {
my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . "." .
Moz::Milestone::getMilestoneMinor($milestone);
# strip off trailing pre-release indicators
$uaversion =~ s/[a-z]+\d*$//;
print "$uaversion\n";
} else {
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files
END
;
}

View File

@ -2266,6 +2266,7 @@ fi
dnl Get mozilla version from central milestone file
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
dnl Get version of various core apps from the version files.
FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
@ -2276,6 +2277,7 @@ fi
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
MOZ_DOING_LTO(lto_is_enabled)

View File

@ -51,6 +51,7 @@ use vars qw(
$MICRO_VERSION
$opt_debug
$opt_template
$opt_uaversion
$opt_help
);
@ -60,7 +61,7 @@ push(@INC,$SCRIPTDIR);
require "Moz/Milestone.pm";
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template');
&GetOptions('topsrcdir=s' => \$TOPSRCDIR, 'srcdir=s' => \$SRCDIR, 'objdir=s' => \$OBJDIR, 'debug', 'help', 'template', 'uaversion');
if (defined($opt_help)) {
&usage();
@ -100,13 +101,19 @@ if (defined(@TEMPLATE_FILE)) {
warn("$0: No such file $TFILE!\n");
}
}
} elsif(defined($opt_uaversion)) {
my $uaversion = Moz::Milestone::getMilestoneMajor($milestone) . "." .
Moz::Milestone::getMilestoneMinor($milestone);
# strip off trailing pre-release indicators
$uaversion =~ s/[a-z]+\d*$//;
print "$uaversion\n";
} else {
print "$milestone\n";
}
sub usage() {
print <<END
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list]` # will build file list from .tmpl files
`milestone.pl [--topsrcdir TOPSRCDIR] [--objdir OBJDIR] [--srcdir SRCDIR] --template [file list] --uaversion` # will build file list from .tmpl files
END
;
}

View File

@ -270,7 +270,7 @@ nsHttpHandler::Init()
PrefsChanged(prefBranch, nsnull);
}
mMisc.AssignLiteral("rv:" MOZILLA_VERSION);
mMisc.AssignLiteral("rv:" MOZILLA_UAVERSION);
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
@ -307,7 +307,7 @@ nsHttpHandler::Init()
rv = InitConnectionMgr();
if (NS_FAILED(rv)) return rv;
mProductSub.AssignLiteral(MOZILLA_VERSION);
mProductSub.AssignLiteral(MOZILLA_UAVERSION);
// Startup the http category
// Bring alive the objects in the http-protocol-startup category