[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1003133: bullseye-pu: package glx-alternatives/1.2.1~deb11u1



Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian.org@packages.debian.org
Usertags: pu

Hi,

I'd like to update src:glx-alternatives in bullseye/contrib to the
version currently in sid. It contains one bugfix: There was a time
span between setting up the diversions (glx-diversions.postinst) and the
alternatives (glx-alternative-mesa.postinst) where libGL.so.1 and
friends would appear missing on initial install, causing unrelated
maintainer scripts to fail (e.g. liboctave*.so.* is (indirectly) linked
againt libGL.so.1). So create a preliminary alternative already in
glx-diversions.postinst to unbreak the diverted libraries and extend
this alternative later in glx-alternative-mesa.postinst.


Andreas
diff --git a/debian/changelog b/debian/changelog
index 29d1b77..c6e2207 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,18 @@
+glx-alternatives (1.2.1~deb11u1) bullseye; urgency=medium
+
+  * Rebuild for bullseye.
+
+ -- Andreas Beckmann <anbe@debian.org>  Tue, 04 Jan 2022 18:00:43 +0100
+
+glx-alternatives (1.2.1) unstable; urgency=medium
+
+  * glx-diversions: After initial setup of the diversions, install a minimal
+    alternative to the diverted files s.t. libGL.so.1 etc. are not missing
+    until glx-alternative-mesa processes its triggers.  (Closes: #993338)
+  * Bump Standards-Version to 4.6.0. No changes needed.
+
+ -- Andreas Beckmann <anbe@debian.org>  Fri, 01 Oct 2021 23:06:54 +0200
+
 glx-alternatives (1.2.0) unstable; urgency=medium
 
   * Build for arm64.
diff --git a/debian/control b/debian/control
index af4ce31..d779d39 100644
--- a/debian/control
+++ b/debian/control
@@ -7,7 +7,7 @@ Uploaders:
 Build-Depends:
  debhelper-compat (= 13),
 Rules-Requires-Root: no
-Standards-Version: 4.5.0
+Standards-Version: 4.6.0
 Vcs-Browser: https://salsa.debian.org/nvidia-team/glx-alternatives
 Vcs-Git: https://salsa.debian.org/nvidia-team/glx-alternatives.git
 
diff --git a/debian/copyright b/debian/copyright
index 37df60b..c3ee339 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -6,7 +6,7 @@ Disclaimer:
  GNU GPL version 2 or later.
 
 Files: *
-Copyright: © 2010-2019 Andreas Beckmann <anbe@debian.org>
+Copyright: © 2010-2021 Andreas Beckmann <anbe@debian.org>
 License: GPL-2.0+
  This package is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
diff --git a/debian/glx-diversions.postinst b/debian/glx-diversions.postinst
index 39fb430..58e5917 100644
--- a/debian/glx-diversions.postinst
+++ b/debian/glx-diversions.postinst
@@ -102,6 +102,62 @@ if [ "$1" = "configure" ]; then
 fi
 
 
+add_slave()
+{
+	local target_link name source_path prefix
+	target_link="$1"
+	name="$2"
+	source_path="$3"
+	prefix="glx--"
+
+	if [ -f "${source_path}" ] && [ -d "$(dirname "${target_link}")" ]; then
+		echo --slave "${target_link}" "${prefix}${name}" "${source_path}"
+	fi
+}
+
+add_multiarch_slave()
+{
+	local target_dir target_sub_dir file source_dir source_sub_dir prefix suffix triplet
+	target_dir="$1"
+	target_sub_dir="$2"
+	file="$3"
+	source_dir="$4"
+	source_sub_dir="$5"
+	prefix="$6"
+	srcfile="${7:-$file}"
+
+	for triplet in $TRIPLETS ; do
+		# s|/$||; s|^/|-|;
+		suffix="${triplet%/}"
+		suffix="${suffix:+-${suffix#/}}"
+		add_slave \
+			"${target_dir}${triplet}${target_sub_dir}${file}" \
+			"${prefix}${file}${suffix}" \
+			"${source_dir}${triplet}${source_sub_dir}${srcfile}"
+	done
+}
+
+if [ "$1" = "configure" ]; then
+
+	# after initial diversion setup add a minimal glx alternative
+	# s.t. libGL.so.1 etc. are not missing until glx-alternative-mesa
+	# processed the triggers to properly create the alternative
+	if [ -z "$2" ]; then
+
+		# libGL.so.1 (from /usr/lib/mesa-diverted/)
+		slaves="$(add_multiarch_slave /usr/lib "" libGL.so.1 /usr/lib/mesa-diverted)
+			$(add_multiarch_slave /usr/lib "" libEGL.so.1 /usr/lib/mesa-diverted)
+			$(add_multiarch_slave /usr/lib "" libGLESv1_CM.so.1 /usr/lib/mesa-diverted)
+			$(add_multiarch_slave /usr/lib "" libGLESv2.so.2 /usr/lib/mesa-diverted)
+	"
+		if echo "$slaves" | grep -q "slave" ; then
+			update-alternatives --install /usr/lib/glx glx /usr/lib/mesa-diverted 5 $slaves
+		fi
+	fi
+
+fi
+
+
 if [ "$1" = "configure" ]; then
 
 	# activate triggers

Reply to: