From 46fd1b68722ab711bb64f24b1f55a25e6f62cacf Mon Sep 17 00:00:00 2001 From: bill-auger Date: May 01 2022 12:42:01 +0000 Subject: [iceweasel]: restore v98 branding --- diff --git a/libre/iceweasel/PKGBUILD b/libre/iceweasel/PKGBUILD index c480125..a349c66 100644 --- a/libre/iceweasel/PKGBUILD +++ b/libre/iceweasel/PKGBUILD @@ -37,6 +37,7 @@ # - allow skipping profiling build for x86_64 (_x86_64_skip_pgo) # - prefer as many system libs as possible, over their vendored couterparts # - Rebrand to Iceweasel, per the mozilla trademark policy, due to the FSDG changes +# - set user profile directory to ~/.mozilla/iceweasel # # privacy: # - Remove Google API keys and usage @@ -62,7 +63,7 @@ epoch=1 pkgver=99.0.1 pkgrel=1 pkgrel+=.parabola1 -_brandingver=95.0-1 +_brandingver=98.0-1 pkgdesc="Standalone web browser derived from Mozilla Firefox" arch=(x86_64) arch+=(armv7h i686) @@ -100,7 +101,7 @@ source_i686=('avoid-libxul-OOM-python-check.patch' sha256sums=('76d22279ce99588a728bb2d034064be0d5918b5900631f2148d4565b8a72e00b' 'SKIP' '9cdc2602661717712092d28bb494e5b48e518cb930898aca85eaf21f91f7ef58') -sha256sums+=('d1b9d98cea5356df97fc5c221830de1ced8f826cb39fac9427c407e3eae54c02' +sha256sums+=('f3e89499909b172476e931d9ab18b856d0001e3042b3816d1728809536179768' 'SKIP' 'af53bd22378cd87c27438c34dc1daf3f1909735e85c914b56440751a9dc16856' 'a2c71759290dd48c87bf8aacb681040dcaefdabe0d57317de361d2d2d509664b' @@ -682,4 +683,20 @@ END # else # anti-feature # cp -fvt "$startdir" obj/dist/*crashreporter-symbols-full.tar.zst # anti-feature # fi + + # BEGIN RENAME_PROFILE - temporary + # replace binary with a temporary wrapper, to rename the user profile directory + # NOTE: prior to v99, if another 'firefox' is installed in addition to iceweasel, + # both applications would share a profile, which is not very sane behavior. + # TODO: this 'rename-profile.sh' source file, and the following two LOC, + # could be removed after a reasonable deprecation period (eg: in 2023) + mv "${pkgdir}"/usr/lib/iceweasel/ice{,-}weasel + install -Dm755 ../rename-profile.sh "${pkgdir}"/usr/lib/iceweasel/iceweasel + # END RENAME_PROFILE } + + +# BEGIN RENAME_PROFILE - temporary - see note in package() +depends+=(gxmessage) ; source+=(rename-profile.sh) ; +sha256sums+=('da332a538662b6f8ebe67c0aee85a12af57a6f20309b1eec9f30add3ac1cbc4f') +# END RENAME_PROFILE diff --git a/libre/iceweasel/rename-profile.sh b/libre/iceweasel/rename-profile.sh new file mode 100644 index 0000000..655cb53 --- /dev/null +++ b/libre/iceweasel/rename-profile.sh @@ -0,0 +1,101 @@ +#!/bin/bash + +# rename existing 'firefox' user profile directory to 'iceweasel' +# +# NOTE: Prior to v99, if another Firefox is installed in addition to Iceweasel, +# both applications would share a profile, which is not very sane behavior. +# TODO: This source file could be deleted after a reasonable deprecation period. +# +# NOTE: The Iceweasel binary is inaccessible via the usual means +# (`iceweasel`, `/usr/bin/iceweasel`, or the iceweasel.desktop launcher). +# The binary has been renamed to ice-weasel, and replaced by this script. +# Therefore all usual means of launching, will go through this script. + + +Defer() +{ + gxmessage -title "Parabola Iceweasel Updater" \ + -buttons "OK:0" \ + -default "OK" \ + -font "sans 16" \ + -geometry 620x460 \ + -center -wrap -ontop -sticky \ +"A new version of Iceweasel has been installed; +but the upgrade can not continue just yet. + +A previous version of Iceweasel is already running. + +Please close all running Iceweasel windows, +then start Iceweasel again. + +If this message persists, try restarting the computer." +} + +Prompt() +{ + gxmessage -title "Parabola Iceweasel Updater" \ + -buttons "Move:0,Copy:1" \ + -default "Move" \ + -font "monospace 12" \ + -geometry 780x580 \ + -center -wrap -ontop -sticky \ +"A new version of Iceweasel has been installed; but the upgrade can not continue just yet. + +This upgrade intends to move the storage location of the Iceweasel user profile, from ~/.mozilla/firefox to ~/.mozilla/iceweasel, in order to isolate it from other Firefox variants. + +You have two options: + + * 'Move': This is the recommended option, + if you do not have any other Firefox variants installed. + However, if you have another Firefox variant installed, + the other's preferences may be reset to defaults. + Parabola does not distribute any other Firefox variant, + which would be affected by this decision. + If all software on your computer came from the Parabola repos + (as recommended), then 'Move' is the best option. + + * 'Copy': If you have another Firefox variant installed, + it will keep all user preferences as they are, + and Iceweasel will inherit the preferences. + +Note that neither option would affect Icecat, nor any other Firefox variant +which does not store user profiles under ~/.mozilla/firefox. +" +} + +Launch() { /usr/lib/iceweasel/ice-weasel "$@" ; } + + +if [[ -d ~/.mozilla/firefox ]] && \ + ! [[ -e ~/.mozilla/iceweasel ]] +then # This is the expected case, where the user has previously run + # either Iceweasel or Firefox on this system; + # and this is the first time, that this script has run. + pids=( $(pgrep --euid ${EUID} firefox ) \ + $(pgrep --euid ${EUID} iceweasel) ) + if [[ -n "${pids[*]/$$/}" ]] + then # In this case, Firefox or Iceweasel is already running; + # so ask the user to terminate them. + Defer + else # Ready to move the profile directory. + # Give the user the option to preserve the Firefox profile, + # then launch the binary. + if Prompt + then mv ~/.mozilla/{firefox,iceweasel} + else cp -a ~/.mozilla/{firefox,iceweasel} + fi + Launch "$@" + fi +else # This branch is executed in any of three cases: + # 1) The user has run Iceweasel or some other Firefox variant in the past, + # AND ~/.mozilla/iceweasel already exists for some reason. + # 2) The expected case, where the user has previously selected 'Copy' + # during a previous run of this script, + # perhaps from a previous Iceweasel release. + # 3) The remaining expected case, where the user has never run + # neither Iceweasel nor Firefox on this system. + # So, simply launch the binary. + # This is potentially problematic in the (unlikely) case #1; + # but is easily resolved manually: $ rm -rf ~/.mozilla/iceweasel + Launch "$@" +fi