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
Родитель 0b25bab279
Коммит 81ad5d4df2
4 изменённых файлов: 22 добавлений и 6 удалений

Просмотреть файл

@ -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
;
}

Просмотреть файл

@ -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)

Просмотреть файл

@ -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
;
}

Просмотреть файл

@ -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