[tbb-commits] [tor-browser-build/master] Bug 25099: Set nightly version to tbb-nightly.$year.$month.$day
gk at torproject.org
gk at torproject.org
Tue Nov 19 10:20:13 UTC 2019
commit 0f019cf3aa17c6b77bb8126a9c4bdf47886238cb
Author: Nicolas Vigier <boklm at torproject.org>
Date: Mon Oct 7 18:16:06 2019 +0200
Bug 25099: Set nightly version to tbb-nightly.$year.$month.$day
Include the current day in the nightly version number, so that each
build gets a different version number.
We get this version number using a perl function, and a "state"
variable, so that the day when the build was started is used.
This avoids issues when a build is started on a day but finishs on a
different day.
In the nightly directory, the builds are now stored using the version
instead of just the date.
We also allow overriding this version number by using the
TORBROWSER_NIGHTLY_VERSION environment variable. This could be useful
for example if you need to generate incremental mars for the version
from the previous day.
---
README | 2 +-
projects/firefox/get-moz-build-date | 5 ++---
projects/release/config | 3 +--
rbm.conf | 9 ++++++++-
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/README b/README
index 6dc5112..d77a460 100644
--- a/README
+++ b/README
@@ -62,7 +62,7 @@ channel you want to build:
You can find the build result in the directory release/unsigned/$version
or alpha/unsigned/$version for release or alpha builds. The result of
-nightly can be found in the nightly/$date directory.
+nightly can be found in the nightly/$version directory.
If you want to build for a specific platform only, append the platform
name to the makefile target:
diff --git a/projects/firefox/get-moz-build-date b/projects/firefox/get-moz-build-date
index 4e55c92..e6989ff 100755
--- a/projects/firefox/get-moz-build-date
+++ b/projects/firefox/get-moz-build-date
@@ -6,9 +6,8 @@ use strict;
die "wrong number of arguments" unless @ARGV == 2;
my ($year, $version) = @ARGV;
my $date;
-if ($version eq 'tbb-nightly') {
- my (undef, undef, undef, $day, $mon, $y) = localtime;
- $date = sprintf("%d%02d%02d010101", $y + 1900, $mon + 1, $day);
+if ($version =~ m/^tbb-nightly\.([^\.]+)\.([^\.]+)\.([^\.]+)$/) {
+ $date = sprintf("%d%02d%02d010101", $1, $2, $3);
} else {
my @v = split(/[\.ab]/, $version);
push @v, '0' if @v < 4;
diff --git a/projects/release/config b/projects/release/config
index c705a6f..17db3d0 100644
--- a/projects/release/config
+++ b/projects/release/config
@@ -4,7 +4,6 @@ output_dir: release
var:
signed_status: unsigned
- today: '[% USE date; date.format(format = "%Y-%m-%d") %]'
publish_dir: '[% c("var/signed_status") %]/[% c("version") %]-[% c("var/torbrowser_build") %]'
containers_target: with_containers
@@ -74,7 +73,7 @@ targets:
output_dir: 'nightly'
var:
build_target: nightly
- publish_dir: '[% c("var/today") %]'
+ publish_dir: '[% c("version") %]'
alpha:
output_dir: alpha
diff --git a/rbm.conf b/rbm.conf
index 4a90ccc..f0ae4f9 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -147,7 +147,7 @@ targets:
var:
nightly: 1
channel: nightly
- torbrowser_version: tbb-nightly
+ torbrowser_version: '[% ENV.TORBROWSER_NIGHTLY_VERSION ? ENV.TORBROWSER_NIGHTLY_VERSION : c("var_p/nightly_torbrowser_version") %]'
torbrowser-testbuild:
- testbuild
@@ -508,5 +508,12 @@ ENV:
my ($out) = capture_exec('sudo', 'runc', '--version');
return $out =~ m/^.*spec: 1\.[0-9]+\.[0-9]+(?:-dev)?$/m;
},
+ nightly_torbrowser_version => sub {
+ state $version = '';
+ return $version if $version;
+ my (undef, undef, undef, $day, $mon, $year) = gmtime;
+ $version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
+ return $version;
+ },
},
)
More information about the tbb-commits
mailing list