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
Родитель 4ff1572cca
Коммит 046e1b6b15
3 изменённых файлов: 35 добавлений и 6 удалений

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

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

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

@ -19,6 +19,16 @@
# 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.
# 1998091509 = 1998, September, 15th, 9am local time zone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;

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

@ -19,6 +19,16 @@
# 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.
# 1998091509 = 1998, September, 15th, 9am local time zone
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime;