boklm pushed to branch main at The Tor Project / Applications / tor-browser-build
Commits: b1ae0065 by Nicolas Vigier at 2024-04-12T21:11:31+02:00 Bug 41122: Add var/browser_release_date
Add a release date, and use it for MOZ_BUILD_DATE, and as timestamp on files in projects/browser.
For nightly we use a release date based on the version number.
- - - - -
4 changed files:
- .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md - .gitlab/issue_templates/Release Prep - Tor Browser Alpha.md - projects/browser/config - rbm.conf
Changes:
===================================== .gitlab/issue_templates/Release Prep - Mullvad Browser Alpha.md ===================================== @@ -39,6 +39,7 @@ Mullvad Browser Alpha (and Nightly) are on the `main` branch - [ ] Update `rbm.conf` - [ ] `var/torbrowser_version` : update to next version - [ ] `var/torbrowser_build` : update to `$(MULLVAD_BROWSER_BUILD_N)` + - [ ] `var/browser_release_date` : update to build date - [ ] `var/torbrowser_incremental_from` : update to previous Desktop version - **NOTE**: We try to build incrementals for the previous 3 desktop versions except in the case of a watershed update - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make mullvadbrowser-incrementals-*` step will fail
===================================== .gitlab/issue_templates/Release Prep - Tor Browser Alpha.md ===================================== @@ -38,6 +38,7 @@ Tor Browser Alpha (and Nightly) are on the `main` branch - [ ] Update `rbm.conf` - [ ] `var/torbrowser_version` : update to next version - [ ] `var/torbrowser_build` : update to `$(TOR_BROWSER_BUILD_N)` + - [ ] `var/browser_release_date` : update to build date - [ ] ***(Desktop Only)***`var/torbrowser_incremental_from` : update to previous Desktop version - **NOTE**: We try to build incrementals for the previous 3 desktop versions except in the case of a watershed update - **IMPORTANT**: Really *actually* make sure this is the previous Desktop version or else the `make torbrowser-incrementals-*` step will fail
===================================== projects/browser/config ===================================== @@ -1,6 +1,7 @@ # vim: filetype=yaml sw=2 version: '[% c("var/torbrowser_version") %]' filename: '[% c("var/project-name") %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %]' +timestamp: '[% c("var/browser_release_date_timestamp") %]' container: use_container: 1
===================================== rbm.conf ===================================== @@ -79,6 +79,8 @@ var: - '13.5a5' - '13.5a4' - '13.5a3' + browser_release_date: '2024/03/28 01:02:03' + browser_release_date_timestamp: '[% USE date; date.format(c("var/browser_release_date"), "%s") %]' updater_enabled: 1 build_mar: 1 mar_channel_id: '[% c("var/projectname") %]-torproject-[% c("var/channel") %]' @@ -206,7 +208,8 @@ var: [% END -%]
DOCSDIR_project: '[% project %]' - set_MOZ_BUILD_DATE: 'export MOZ_BUILD_DATE=[% c("var_p/MOZ_BUILD_DATE") %]' + set_MOZ_BUILD_DATE: 'export MOZ_BUILD_DATE=[% c("var/MOZ_BUILD_DATE") %]' + MOZ_BUILD_DATE: '[% USE date; date.format(c("var/browser_release_date"), "%Y%m%d%H%M%S") %]'
# var/essential_deps is the same as var/deps, except that we never # redefine it in projects config. This is for the packages we want to @@ -248,6 +251,14 @@ targets: GET c("var_p/nightly_torbrowser_version"); END; -%] + browser_release_date: | + [% + IF (matches = c("var/torbrowser_version").match('^tbb-nightly.(\d\d\d\d).(\d\d).(\d\d)$')); + GET matches.0 _ "/" _ matches.1 _ "/" _ matches.2 _ " 01:01:01"; + ELSE; + GET "2000/01/01 01:01:01"; + END + -%] max_torbrowser_incremental_from: 2 build_infos_json: 1
@@ -727,31 +738,5 @@ gpg_allow_expired_keys: 1 } return [@res]; }, - MOZ_BUILD_DATE => sub { - use POSIX qw(strftime); - my ($project, $options) = @_; - my $nightly = project_config($project, 'var/nightly', $options); - my $testbuild = project_config($project, 'var/testbuild', $options); - - if ($nightly && !$testbuild) { - my $torbrowser_version = project_config($project, 'var/torbrowser_version', $options); - return sprintf("%d%02d%02d000001", $1, $2, $3) - if $torbrowser_version =~ m/^tbb-nightly.([^.]+).([^.]+).([^.]+)$/; - return strftime("%Y%m%d000001", gmtime); - } - - my $timestamp = project_config($project, 'timestamp', $options); - if (!$nightly) { - my $torbrowser_version = project_config($project, 'var/torbrowser_version', $options); - my @n = reverse split /[.\D]/, $torbrowser_version; - my $i = 1; - unshift @n, 0 if @n < 3; - for my $n (@n) { - $timestamp += $n * $i; - $i = $i * 10; - } - } - return strftime "%Y%m%d%H%M%S", gmtime($timestamp); - }, }, )
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commit/b1...
tbb-commits@lists.torproject.org