From c2824ce88d485fab0abf7dc05d9a44616b157e46 Mon Sep 17 00:00:00 2001
From: psykose <alice@ayaya.dev>
Date: Sat, 10 Sep 2022 18:05:49 +0000
Subject: [PATCH] community/firefox-esr: add appid change notice

---
 community/firefox-esr/APKBUILD                 |  3 ++-
 community/firefox-esr/firefox-esr.post-upgrade | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 community/firefox-esr/firefox-esr.post-upgrade

diff --git a/community/firefox-esr/APKBUILD b/community/firefox-esr/APKBUILD
index 80dca584c1c2..25745c1aa1d1 100644
--- a/community/firefox-esr/APKBUILD
+++ b/community/firefox-esr/APKBUILD
@@ -5,13 +5,14 @@ pkgname=firefox-esr
 pkgver=102.2.0
 # Date of release, YY-MM-DD for metainfo file (see package())
 _releasedate=2022-08-23
-pkgrel=1
+pkgrel=2
 pkgdesc="Firefox web browser - Extended Support Release"
 url="https://www.mozilla.org/en-US/firefox/organizations/"
 # s390x and riscv64: blocked by rust and cargo
 # armhf: build failure on armhf due to wasm
 arch="x86_64 armv7 aarch64 x86 ppc64le"
 license="GPL-3.0-only AND LGPL-2.1-only AND LGPL-3.0-only AND MPL-2.0"
+install="$pkgname.post-upgrade"
 depends="ffmpeg-libs"
 makedepends="
 	alsa-lib-dev
diff --git a/community/firefox-esr/firefox-esr.post-upgrade b/community/firefox-esr/firefox-esr.post-upgrade
new file mode 100644
index 000000000000..89a54b3caf1c
--- /dev/null
+++ b/community/firefox-esr/firefox-esr.post-upgrade
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+ver_old=$2
+
+if [ "$(apk version -t "$ver_old" '102.2.0-r2')" = '<' ]; then
+	# firefox-esr appid changed in 102.2.0-r1
+	echo 2>&1 <<-EOF
+	* firefox-esr 102.2.0-r1 changed its' appid to firefox-esr, allowing it to
+	* be installed alongside regular firefox. to migrate your profile for this
+	* change, you have to move ~/.mozilla/firefox to ~/.mozilla/firefox-esr, and
+	* ensure ~/.mozilla/firefox-esr/profiles.ini contains one of the
+	* subdirectory folders (Path= is the subdir name, Default=1 is the one
+	* selected on startup).
+	EOF
+fi
+
+exit 0
-- 
GitLab