From c9191b0d4a2a9c678e372a96cf4807a070d2e387 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Fri, 25 Nov 2022 11:39:39 -0800 Subject: [PATCH] disable_firefox_studies: don't run twice, skip uploads There's no need to run this twice (which can happen on some paths), so if the first file already exists, just bail. Also, don't bother uploading the config files any more - that was just for debug while I was making this stuff work, now it works, and this saves some time. Signed-off-by: Adam Williamson --- lib/utils.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/utils.pm b/lib/utils.pm index 00e0fe5f..e74f290c 100644 --- a/lib/utils.pm +++ b/lib/utils.pm @@ -415,6 +415,9 @@ sub disable_firefox_studies { # enable rpm-ostree /usr overlay so we can write to /usr assert_script_run "rpm-ostree usroverlay"; } + # if the first file exists, we've already run, so we can skip + # running again + return unless (script_run 'test -f $(rpm --eval %_libdir)/firefox/distribution/policies.json'); # create a config file that disables Firefox's dumb 'shield # studies' so they don't break tests: # https://bugzilla.mozilla.org/show_bug.cgi?id=1529626 @@ -435,10 +438,6 @@ sub disable_firefox_studies { assert_script_run 'mkdir -p $(rpm --eval %_libdir)/firefox/browser/defaults/preferences'; assert_script_run 'printf "// required comment\npref(\'general.config.filename\', \'openqa-overrides.cfg\');\npref(\'general.config.obscure_value\', 0);\n" > $(rpm --eval %_libdir)/firefox/browser/defaults/preferences/openqa-overrides.js'; assert_script_run 'printf "// required comment\npref(\'browser.urlbar.quicksuggest.shouldShowOnboardingDialog\', false);\npref(\'privacy.restrict3rdpartystorage.rollout.enabledByDefault\', false);\n" > $(rpm --eval %_libdir)/firefox/openqa-overrides.cfg'; - # for debugging - upload_logs "/usr/lib64/firefox/browser/defaults/preferences/openqa-overrides.js", failok => 1; - upload_logs "/usr/lib64/firefox/openqa-overrides.cfg", failok => 1; - upload_logs "/usr/lib64/firefox/distribution/policies.json", failok => 1; } sub repos_mirrorlist {