Allow distributors to set specific builddate by setting MOZ_BUILD_DATE in the env.

Thanks to Christopher Blizzard <blizzard@redhat.com> for the patch.
Bug #123391 r=cls,blizzard
This commit is contained in:
seawood%netscape.com 2002-02-20 06:21:10 +00:00
Родитель 3e6fee2041
Коммит ba8c602f9c
3 изменённых файлов: 25 добавлений и 33 удалений

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

@ -46,14 +46,23 @@ sub write_number($) {
sub UpdateBuildNumber($$) { sub UpdateBuildNumber($$) {
my ($outfile, $official) = @_; my ($outfile, $official) = @_;
my $given_date = $ENV{"MOZ_BUILD_DATE"};
my $build_number;
# XP way of doing the build date. if ($given_date eq "") {
# 1998091509 = 1998, September, 15th, 9am local time zone # XP way of doing the build date.
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; # 1998091509 = 1998, September, 15th, 9am local time zone
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
# localtime returns year minus 1900 # localtime returns year minus 1900
$year = $year + 1900; $year = $year + 1900;
my $build_number = sprintf("%04d%02d%02d%02d", $year, 1+$mon, $mday, $hour); $build_number = sprintf("%04d%02d%02d%02d", $year, 1+$mon,
$mday, $hour);
}
else {
$build_number = $given_date;
}
if ("$outfile" eq "") { if ("$outfile" eq "") {
print "$build_number\n"; print "$build_number\n";

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

@ -1,27 +0,0 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
# XP way of doing the build date.
# 1998091509 = 1998, September, 15th, 9am local time zone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;
# localtime returns year minus 1900
$year = $year + 1900;
printf("#define PRODUCT_VERSION \"%04d%02d%02d\"\n", $year, 1+$mon, $mday);

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

@ -19,6 +19,16 @@
# Contributor(s): # Contributor(s):
# #
$given_date = $ENV{"MOZ_BUILD_DATE"};
if ($given_date ne "") {
# The gecko date does not use hour resolution
chop($given_date);
chop($given_date);
printf("#define PRODUCT_VERSION \"%08d\"\n", $given_date);
exit(0);
}
# XP way of doing the build date. # XP way of doing the build date.
# 1998091509 = 1998, September, 15th, 9am local time zone # 1998091509 = 1998, September, 15th, 9am local time zone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;