Skip to content
Snippets Groups Projects
Unverified Commit d4460a92 authored by boklm's avatar boklm
Browse files

Bug 25101: Add support for generating nightly incremental mars

parent f1cc6bc7
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,11 @@ incrementals-alpha: submodule-update
tools/update-responses/gen_incrementals alpha
$(rbm) build release --step hash_incrementals --target alpha
incrementals-nightly: submodule-update
$(rbm) build release --step update_responses_config --target nightly
NO_CODESIGNATURE=1 tools/update-responses/gen_incrementals nightly
$(rbm) build release --step hash_incrementals --target nightly
update_responses-release: submodule-update
$(rbm) build release --step update_responses_config --target release --target signed
$(rbm) build release --step create_update_responses_tar --target release --target signed
......
......@@ -82,7 +82,19 @@ build number defined as var/torbrowser_version and var/torbrowser_build.
incrementals-{release,alpha}
----------------------------
Create incremental mar files for an unsigned build in the release or
alpha channel.
alpha channel. The list of versions we create incrementals from is
defined as var/torbrowser_incremental_from in rbm.conf.
incrementals-nightly
--------------------
Create incremental mar files for the current nightly build. The number
of previous versions we should generate incremental mars from is defined
as var/max_torbrowser_incremental_from in rbm.conf.
If you want to create incremental mars for a version that is not the
current one, you can define the environment variable
TORBROWSER_NIGHTLY_VERSION to the version you want to generate
incremental mars for.
dmg2mar-{release,alpha)
-----------------------
......
#!/bin/bash
[% c("var/set_default_env") -%]
cd [% shell_quote(path(dest_dir)) %]/[% c("var/signed_status") %]/[% c("version") %]-[% c("var/torbrowser_build") %]
[% IF c("var/nightly") -%]
cd [% shell_quote(path(dest_dir)) %]/[% c("version") %]
[% ELSE -%]
cd [% shell_quote(path(dest_dir)) %]/[% c("var/signed_status") %]/[% c("version") %]-[% c("var/torbrowser_build") %]
[% END -%]
sha256sum `ls -1 | grep '\.incremental\.mar$' | sort` > sha256sums-[% c("var/signed_status") %]-build.incrementals.txt
......@@ -4,8 +4,9 @@ cat > [% shell_quote(c("basedir")) %]/tools/update-responses/config.yml << 'EOF'
[% INCLUDE update_responses_config.yml -%]
EOF
# Update / create symlink $torbrowser_version -> $torbrowser_version-buildN
versiondir=[% shell_quote(path(dest_dir)) _ '/' _ c("var/signed_status") _ '/' _ c("version") %]
test -L "$versiondir" && rm -f "$versiondir"
test -d "$versiondir" || ln -s [% shell_quote(c("version")) %]-[% shell_quote(c("var/torbrowser_build")) %] "$versiondir"
[% IF ! c("var/nightly") -%]
# Update / create symlink $torbrowser_version -> $torbrowser_version-buildN
versiondir=[% shell_quote(path(dest_dir)) _ '/' _ c("var/signed_status") _ '/' _ c("version") %]
test -L "$versiondir" && rm -f "$versiondir"
test -d "$versiondir" || ln -s [% shell_quote(c("version")) %]-[% shell_quote(c("var/torbrowser_build")) %] "$versiondir"
[% END -%]
......@@ -5,7 +5,7 @@ appname_bundle_osx: TorBrowser
appname_bundle_linux: tor-browser
appname_bundle_win32: torbrowser-install
appname_bundle_win64: torbrowser-install-win64
releases_dir: [% path(c('output_dir')) %]/signed
releases_dir: [% path(c('output_dir')) %][% IF ! c("var/nightly") %]/signed[% END %]
download:
archive_url: https://archive.torproject.org/tor-package-archive/torbrowser
gpg_keyring: ../../keyring/torbrowser.gpg
......@@ -31,7 +31,8 @@ versions:
platformVersion: [% pc('firefox', 'var/firefox_platform_version') %]
detailsURL: https://blog.torproject.org/new-release-tor-browser-[% c("var/torbrowser_version") FILTER remove('\.') %]
incremental_from:
[% FOREACH v IN c("var/torbrowser_incremental_from") -%]
[% SET incr_from = c("var/nightly") ? c("var_p/nightly_torbrowser_incremental_from") : c("var/torbrowser_incremental_from");
FOREACH v IN incr_from -%]
- [% v %]
[% END -%]
migrate_archs:
......
......@@ -154,6 +154,7 @@ targets:
- es-ES
- fr
- ru
max_torbrowser_incremental_from: 2
torbrowser-testbuild:
- testbuild
......@@ -521,5 +522,23 @@ ENV:
$version = sprintf("tbb-nightly.%u.%02u.%02u", $year + 1900, $mon + 1, $day);
return $version;
},
nightly_torbrowser_incremental_from => sub {
my ($project, $options) = @_;
my $nightly_dir = project_config($project, 'basedir', $options) . '/nightly';
my $current_version = project_config($project, 'var/torbrowser_version', $options);
use Path::Tiny;
return [] unless -d $nightly_dir;
my @dirs = sort map { $_->basename } path($nightly_dir)->children(qr/^tbb-nightly\./);
my $nb_incr = project_config($project, ['var', 'max_torbrowser_incremental_from'], $options);
my @res;
while ($nb_incr > 0) {
my $dir = pop @dirs;
last unless $dir;
next if $dir eq $current_version;
$nb_incr--;
push @res, $dir;
}
return [@res];
},
},
)
......@@ -220,7 +220,8 @@ sub create_incremental_mar {
extract_mar(mar_filename($config, $appname, $new_version, $os, $lang),
"$tmpdir/B", $mar_c_new);
# bug 26054: make sure previous macOS version is code signed
if (($os eq 'osx64') && ! -f "$tmpdir/A/Contents/_CodeSignature/CodeResources") {
if (!$ENV{NO_CODESIGNATURE} && ($os eq 'osx64')
&& ! -f "$tmpdir/A/Contents/_CodeSignature/CodeResources") {
exit_error "Missing code signature in $from_version while creating $mar_file";
}
if ($ENV{CHECK_CODESIGNATURE_EXISTS}) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment