From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1366890-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 1BC4415808B
	for <garchives@archives.gentoo.org>; Sat, 12 Feb 2022 05:17:12 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 4CA3EE084A;
	Sat, 12 Feb 2022 05:17:11 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 0CCF2E084A
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Feb 2022 05:17:10 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 71DD93432E4
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Feb 2022 05:17:09 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 7FC9A1BD
	for <gentoo-commits@lists.gentoo.org>; Sat, 12 Feb 2022 05:17:07 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1644643012.786a2d71d3bd51fc39dc73c548b7c9d7fa45096e.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/wireplumber/files/, media-video/wireplumber/
X-VCS-Repository: repo/gentoo
X-VCS-Files: media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch media-video/wireplumber/wireplumber-0.4.7-r1.ebuild media-video/wireplumber/wireplumber-0.4.7-r2.ebuild media-video/wireplumber/wireplumber-0.4.8-r1.ebuild media-video/wireplumber/wireplumber-0.4.8.ebuild media-video/wireplumber/wireplumber-9999.ebuild
X-VCS-Directories: media-video/wireplumber/ media-video/wireplumber/files/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: 786a2d71d3bd51fc39dc73c548b7c9d7fa45096e
X-VCS-Branch: master
Date: Sat, 12 Feb 2022 05:17:07 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 0edc86f6-1139-4cb2-9c42-e525292e56bd
X-Archives-Hash: b13b4768e80ee5f836a6e32473a19bbc

commit:     786a2d71d3bd51fc39dc73c548b7c9d7fa45096e
Author:     Niklāvs Koļesņikovs <89q1r14hd <AT> relay <DOT> firefox <DOT> com>
AuthorDate: Fri Feb 11 19:41:30 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 12 05:16:52 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=786a2d71

media-video/wireplumber: backport a fix and enable config protection

WirePlumber 0.4.8 contains a config/script change that, if not present
in the user modified files, will cause startup failure. This commit
backports an upstream fix to prevent a crash in addition to also
implementing a solution to at least keep /etc/wireplumber up to date
though the usual config_protect mechanism. This is needed because while
the particular issue has been addressed, it does not solve the general
problem with there potentially being outdated files in /etc/wireplumber
directory. The same is true for $HOME/.config/wireplumber, too, however
there's no reasonable way to help users who decide to copy config files
to there and then never update them against newer versions.

Closes: https://bugs.gentoo.org/832952

Signed-off-by: Niklāvs Koļesņikovs <89q1r14hd <AT> relay.firefox.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...eam-do-not-crash-if-config.properties-is-.patch | 27 ++++++++++++++++++++++
 ...0.4.7-r1.ebuild => wireplumber-0.4.7-r2.ebuild} | 11 +++++++++
 ...er-0.4.8.ebuild => wireplumber-0.4.8-r1.ebuild} | 15 ++++++++++++
 media-video/wireplumber/wireplumber-9999.ebuild    | 11 +++++++++
 4 files changed, 64 insertions(+)

diff --git a/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch b/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
new file mode 100644
index 000000000000..5f4a838c36a6
--- /dev/null
+++ b/media-video/wireplumber/files/wireplumber-0.4.8-restore-stream-do-not-crash-if-config.properties-is-.patch
@@ -0,0 +1,27 @@
+https://gitlab.freedesktop.org/pipewire/wireplumber/-/commit/5f96f69218273573e625475846269b3914cfcecf
+
+From 5f96f69218273573e625475846269b3914cfcecf Mon Sep 17 00:00:00 2001
+From: George Kiagiadakis <george.kiagiadakis@collabora.com>
+Date: Wed, 9 Feb 2022 13:35:13 +0200
+Subject: [PATCH] restore-stream: do not crash if config.properties is nil
+
+Fixes #190
+---
+ src/scripts/restore-stream.lua | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/scripts/restore-stream.lua b/src/scripts/restore-stream.lua
+index 404eede5..0c17bdd7 100644
+--- a/src/scripts/restore-stream.lua
++++ b/src/scripts/restore-stream.lua
+@@ -10,6 +10,7 @@
+ 
+ -- Receive script arguments from config.lua
+ local config = ... or {}
++config.properties = config.properties or {}
+ config_restore_props = config.properties["restore-props"] or false
+ config_restore_target = config.properties["restore-target"] or false
+ 
+-- 
+GitLab
+

diff --git a/media-video/wireplumber/wireplumber-0.4.7-r1.ebuild b/media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
similarity index 90%
rename from media-video/wireplumber/wireplumber-0.4.7-r1.ebuild
rename to media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
index 6c3ec05b1b1c..03a62724a829 100644
--- a/media-video/wireplumber/wireplumber-0.4.7-r1.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.7-r2.ebuild
@@ -82,6 +82,17 @@ src_configure() {
 	meson_src_configure
 }
 
+src_install() {
+	meson_src_install
+
+	# We copy the default config, so that Gentoo tools can pick up on any
+	# updates and /etc does not end up with stale overrides.
+	# If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
+	# will not actually get stored twice until modified.
+	insinto /etc
+	doins -r ${ED}/usr/share/wireplumber
+}
+
 pkg_postinst() {
 	if systemd_is_booted ; then
 		ewarn "pipewire-media-session.service is no longer installed. You must switch"

diff --git a/media-video/wireplumber/wireplumber-0.4.8.ebuild b/media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
similarity index 87%
rename from media-video/wireplumber/wireplumber-0.4.8.ebuild
rename to media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
index e270841b0638..6348d11b2485 100644
--- a/media-video/wireplumber/wireplumber-0.4.8.ebuild
+++ b/media-video/wireplumber/wireplumber-0.4.8-r1.ebuild
@@ -60,6 +60,10 @@ RDEPEND="${DEPEND}
 
 DOCS=( {NEWS,README}.rst )
 
+PATCHES=(
+	"${FILESDIR}"/${P}-restore-stream-do-not-crash-if-config.properties-is-.patch
+)
+
 src_configure() {
 	local emesonargs=(
 		-Ddoc=disabled # Ebuild not wired up yet (Sphinx, Doxygen?)
@@ -78,6 +82,17 @@ src_configure() {
 	meson_src_configure
 }
 
+src_install() {
+	meson_src_install
+
+	# We copy the default config, so that Gentoo tools can pick up on any
+	# updates and /etc does not end up with stale overrides.
+	# If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
+	# will not actually get stored twice until modified.
+	insinto /etc
+	doins -r ${ED}/usr/share/wireplumber
+}
+
 pkg_postinst() {
 	if systemd_is_booted ; then
 		ewarn "pipewire-media-session.service is no longer installed. You must switch"

diff --git a/media-video/wireplumber/wireplumber-9999.ebuild b/media-video/wireplumber/wireplumber-9999.ebuild
index e270841b0638..2e425ab4a17e 100644
--- a/media-video/wireplumber/wireplumber-9999.ebuild
+++ b/media-video/wireplumber/wireplumber-9999.ebuild
@@ -78,6 +78,17 @@ src_configure() {
 	meson_src_configure
 }
 
+src_install() {
+	meson_src_install
+
+	# We copy the default config, so that Gentoo tools can pick up on any
+	# updates and /etc does not end up with stale overrides.
+	# If a reflinking CoW filesystem is used (e.g. Btrfs), then the files
+	# will not actually get stored twice until modified.
+	insinto /etc
+	doins -r ${ED}/usr/share/wireplumber
+}
+
 pkg_postinst() {
 	if systemd_is_booted ; then
 		ewarn "pipewire-media-session.service is no longer installed. You must switch"