[pkg-nvidia-devel] r1421 - /packages/nvidia-graphics-drivers/trunk/debian/
anbe-guest at users.alioth.debian.org
anbe-guest at users.alioth.debian.org
Tue Aug 24 21:25:15 UTC 2010
Author: anbe-guest
Date: Tue Aug 24 21:25:13 2010
New Revision: 1421
URL: http://svn.debian.org/wsvn/pkg-nvidia/?sc=1&rev=1421
Log:
Change handling of Xorg module libglx.so to use alternatives, too. Move
the diversion of libglx.so to new package libglx-nvidia-alternatives and
use a trigger there to create the alternatives.
Added:
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.dirs
- copied unchanged from r1420, packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.lintian-overrides
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postinst
- copied, changed from r1420, packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postrm
- copied, changed from r1420, packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.prerm
packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.triggers
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.prerm
Modified:
packages/nvidia-graphics-drivers/trunk/debian/changelog
packages/nvidia-graphics-drivers/trunk/debian/control
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.install.in
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.lintian-overrides.in
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm
packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst
Modified: packages/nvidia-graphics-drivers/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/changelog?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/changelog (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/changelog Tue Aug 24 21:25:13 2010
@@ -2,6 +2,9 @@
[ Andreas Beckmann ]
* Remove workaround for dpkg-divert bug #581544, fixed in dpkg 1.15.8.
+ * Change handling of Xorg module libglx.so to use alternatives, too. Move
+ the diversion of libglx.so to new package libglx-nvidia-alternatives and
+ use a trigger there to create the alternatives.
-- Andreas Beckmann <debian at abeckmann.de> Tue, 24 Aug 2010 19:27:52 +0200
Modified: packages/nvidia-graphics-drivers/trunk/debian/control
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/control?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/control (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/control Tue Aug 24 21:25:13 2010
@@ -22,6 +22,7 @@
Pre-Depends: dpkg (>= 1.15.7.2)
Depends:
libgl1-nvidia${nvidia:Legacy}-glx (= ${binary:Version}),
+ libglx-nvidia-alternatives,
nvidia-kernel-${nvidia:Version}${nvidia:Perfkit},
${shlibs:Depends}, ${misc:Depends}
Recommends: nvidia-vdpau-driver (>= ${nvidia:Version})
@@ -583,3 +584,16 @@
alternatives to simplify plugging in accelerated implementations from GPU
vendors. Handles both libGL.so.1 and libGL.so.
+Package: libglx-nvidia-alternatives
+Section: non-free/libs
+Architecture: i386 amd64
+Depends: ${misc:Depends}
+Breaks:
+ nvidia-glx (<< 195.36.31-3),
+ nvidia-glx-legacy-71xx (<< 71.86.13-2),
+ nvidia-glx-legacy-96xx (<< 96.43.17),
+ nvidia-glx-legacy-173xx (<< 173.14.25-3),
+Description: simplifies replacing Xorg module libglx.so with GPU vendor library
+ Diverts the free Xorg module libglx.so (Xorg) and introduces alternatives
+ to simplify plugging in accelerated implementations from GPU vendors.
+
Added: packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.lintian-overrides
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.lintian-overrides?rev=1421&op=file
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.lintian-overrides (added)
+++ packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.lintian-overrides Tue Aug 24 21:25:13 2010
@@ -1,0 +1,2 @@
+# The diversions are placed here.
+libglx-nvidia-alternatives: package-contains-empty-directory usr/lib/nvidia/diversions/
Copied: packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postinst (from r1420, packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst)
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postinst?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postinst Tue Aug 24 21:25:13 2010
@@ -2,52 +2,65 @@
set -e
+# A trigger that handles the alternatives for /usr/lib/xorg/modules/extensions/libglx.so
+if [ "$1" = "triggered" ]; then
+
+ if [ -e /usr/lib/nvidia/diversions/libglx.so ]; then
+ update-alternatives --install /usr/lib/xorg/modules/extensions/libglx.so libglx.so /usr/lib/nvidia/diversions/libglx.so 5
+ else
+ update-alternatives --remove libglx.so /usr/lib/nvidia/diversions/libglx.so
+ fi
+
+fi
+
+
#DIVERT_QUIET="--quiet"
+# <target: squeeze>
exists()
{
test -e "$1" || test -L "$1"
}
-# <target: squeeze>
-dpkg-maintscript-helper rm_conffile /etc/default/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-1~ -- "$@"
-dpkg-maintscript-helper rm_conffile /etc/init.d/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-3~ -- "$@"
-# </target: squeeze>
-
-
-case "$1" in
- install|upgrade)
+if [ "$1" = "configure" ]
+then
# the destination directory for the diversions
test -d /usr/lib/nvidia/diversions || \
mkdir -p /usr/lib/nvidia/diversions || true
# <target: squeeze>
- # update the diversion
- if dpkg --compare-versions "$2" lt-nl 195.36.31
+ # take over diversion from nvidia-glx*
+ if true
then
file_orig="/usr/lib/xorg/modules/extensions/libglx.so"
file_old_divert="/usr/lib/nvidia/libglx.so.xlibmesa"
file_new_divert="/usr/lib/nvidia/diversions/libglx.so"
old_diverter="`dpkg-divert --listpackage $file_orig`"
- if [ -n "$old_diverter" ]
+ if [ -n "$old_diverter" ] \
+ && [ "$old_diverter" != "$DPKG_MAINTSCRIPT_PACKAGE" ]
+ then
+ if exists "$file_orig"
then
- # avoid dpkg-divert --add --rename in upgrade scenarios,
- # it might rename *our* existing file -- see dpkg bug #588077
+ # we have Breaks: with all old versions of nvidia-glx* that
+ # shipped $file_orig, so if the file is still there while being
+ # diverted by some other package we don't know where it came from
+ echo "ERROR: $file_orig does exist even if it is diverted. Aborting."
+ exit 1
+ fi
- dpkg-divert --remove --package $old_diverter --divert \
+ if [ -z "$(dpkg-query -S "$file_new_divert" 2>/dev/null || true)" ]
+ then
+ dpkg-divert --remove --rename --package $old_diverter --divert \
"$file_old_divert" \
"$file_orig"
- if exists "$file_old_divert"
- then
- echo "Moving $file_old_divert to $file_new_divert"
- mv "$file_old_divert" "$file_new_divert"
- fi
- dpkg-divert --add --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
+ else
+ dpkg-divert --remove --rename --package $old_diverter --divert \
"$file_new_divert" \
"$file_orig"
fi
+ fi
if exists "$file_old_divert"
then
echo "ERROR: $file_old_divert does still exist. Aborting."
@@ -56,13 +69,32 @@
fi
# </target: squeeze>
+fi
+# </target: squeeze>
+
+if [ "$1" = "configure" ]
+then
+
+ # <target: squeeze>
+ # The old nvidia-glx postrm would delete /usr/lib/nvidia/diversions
+ # out from under us, so create it if it doesn't exist.
+ test -d /usr/lib/nvidia/diversions || \
+ mkdir -p /usr/lib/nvidia/diversions
+ # </target: squeeze>
+
# make new diversions
dpkg-divert $DIVERT_QUIET --add --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
/usr/lib/nvidia/diversions/libglx.so \
/usr/lib/xorg/modules/extensions/libglx.so
- ;;
-esac
+fi
+
+if [ "$1" = "configure" ]; then
+
+ # activate our trigger
+ dpkg-trigger /usr/lib/xorg/modules/extensions/libglx.so
+
+fi
#DEBHELPER#
Copied: packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postrm (from r1420, packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm)
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postrm?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.postrm Tue Aug 24 21:25:13 2010
@@ -3,11 +3,6 @@
#DIVERT_QUIET="--quiet"
-
-# <target: squeeze>
-dpkg-maintscript-helper rm_conffile /etc/default/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-1~ -- "$@"
-dpkg-maintscript-helper rm_conffile /etc/init.d/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-3~ -- "$@"
-# </target: squeeze>
# Rationale:
@@ -15,12 +10,6 @@
# Remove our diversions at the remove stage, since even if we have
# configuration files left, we want to put back everything we moved. Do not
# try to do this again on purge since remove will have already been called.
-#
-# In the abort-install case, we may have gotten far enough to create our
-# diversions in our preinst, so back out of them.
-#
-# Remove /usr/lib/libGL.so only if we still own a diversion of it, since the
-# link may have been created by our trigger in postinst or later.
#
# Leave all of our diversions alone during upgrades or aborted upgrades, since
# we're staying installed in all cases and the diversions are still correct.
@@ -31,7 +20,7 @@
case "$1" in
- remove|abort-install)
+ remove)
dpkg-divert $DIVERT_QUIET --remove --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
/usr/lib/nvidia/diversions/libglx.so \
Added: packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.prerm
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.prerm?rev=1421&op=file
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.prerm (added)
+++ packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.prerm Tue Aug 24 21:25:13 2010
@@ -1,0 +1,14 @@
+#!/bin/sh
+set -e
+
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+
+ update-alternatives --remove libglx.so /usr/lib/nvidia/diversions/libglx.so
+
+fi
+
+
+#DEBHELPER#
+
+exit 0
Added: packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.triggers
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.triggers?rev=1421&op=file
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.triggers (added)
+++ packages/nvidia-graphics-drivers/trunk/debian/libglx-nvidia-alternatives.triggers Tue Aug 24 21:25:13 2010
@@ -1,0 +1,2 @@
+interest /usr/lib/xorg/modules/extensions/libglx.so
+interest /usr/lib/nvidia/diversions/libglx.so
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.dirs Tue Aug 24 21:25:13 2010
@@ -1,1 +1,1 @@
-usr/lib/nvidia/diversions
+usr/lib/xorg/modules/extensions
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.install.in
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.install.in?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.install.in (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.install.in Tue Aug 24 21:25:13 2010
@@ -1,4 +1,4 @@
usr/bin/nvidia-bug-report.sh
usr/X11R6/lib/modules/drivers/nvidia_drv.so usr/lib/xorg/modules/drivers/
-usr/X11R6/lib/modules/extensions/libglx.so.#VERSION# usr/lib/xorg/modules/extensions/
+usr/X11R6/lib/modules/extensions/libglx.so.#VERSION# usr/lib/nvidia/
nvidia.ids usr/share/xserver-xorg/pci/
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.links.in Tue Aug 24 21:25:13 2010
@@ -1,1 +1,1 @@
-usr/lib/xorg/modules/extensions/libglx.so.#VERSION# usr/lib/xorg/modules/extensions/libglx.so
+usr/lib/nvidia/libglx.so.#VERSION# usr/lib/nvidia/libglx.so
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.lintian-overrides.in
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.lintian-overrides.in?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.lintian-overrides.in (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.lintian-overrides.in Tue Aug 24 21:25:13 2010
@@ -5,8 +5,8 @@
#!amd64#nvidia-glx#LEGACY#: shlib-with-non-pic-code
#!amd64#nvidia-glx#LEGACY#: shlib-without-PT_GNU_STACK-section
-# The diversions are placed here.
-nvidia-glx#LEGACY#: package-contains-empty-directory usr/lib/nvidia/diversions/
+# The alternatives are placed here.
+nvidia-glx#LEGACY#: package-contains-empty-directory usr/lib/xorg/modules/extensions/
# Referenced by upstream documentation.
nvidia-glx#LEGACY#: script-with-language-extension usr/bin/nvidia-bug-report.sh
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postinst Tue Aug 24 21:25:13 2010
@@ -45,6 +45,8 @@
dpkg-trigger /usr/lib/libGL.so
# </target: squeeze>
+ update-alternatives --install /usr/lib/xorg/modules/extensions/libglx.so libglx.so /usr/lib/nvidia/libglx.so 42
+
;;
esac
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.postrm Tue Aug 24 21:25:13 2010
@@ -1,8 +1,6 @@
#!/bin/sh
set -e
-
-#DIVERT_QUIET="--quiet"
# <target: squeeze>
dpkg-maintscript-helper rm_conffile /etc/default/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-1~ -- "$@"
@@ -10,39 +8,6 @@
# </target: squeeze>
-# Rationale:
-#
-# Remove our diversions at the remove stage, since even if we have
-# configuration files left, we want to put back everything we moved. Do not
-# try to do this again on purge since remove will have already been called.
-#
-# In the abort-install case, we may have gotten far enough to create our
-# diversions in our preinst, so back out of them.
-#
-# Remove /usr/lib/libGL.so only if we still own a diversion of it, since the
-# link may have been created by our trigger in postinst or later.
-#
-# Leave all of our diversions alone during upgrades or aborted upgrades, since
-# we're staying installed in all cases and the diversions are still correct.
-#
-# It's not clear what to do on disappear, but for now leave everything alone
-# and assume that our overwriting package will have logic to take over the
-# diversions and doesn't want us messing with them.
-
-
-case "$1" in
- remove|abort-install)
-
- dpkg-divert $DIVERT_QUIET --remove --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
- /usr/lib/nvidia/diversions/libglx.so \
- /usr/lib/xorg/modules/extensions/libglx.so
-
- rmdir /usr/lib/nvidia/diversions /usr/lib/nvidia 2>/dev/null || true
-
- ;;
-esac
-
-
#DEBHELPER#
exit 0
Modified: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst?rev=1421&op=diff
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst (original)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.preinst Tue Aug 24 21:25:13 2010
@@ -1,13 +1,6 @@
#!/bin/sh
set -e
-
-#DIVERT_QUIET="--quiet"
-
-exists()
-{
- test -e "$1" || test -L "$1"
-}
# <target: squeeze>
dpkg-maintscript-helper rm_conffile /etc/default/$DPKG_MAINTSCRIPT_PACKAGE 195.36.24-1~ -- "$@"
@@ -15,56 +8,6 @@
# </target: squeeze>
-case "$1" in
- install|upgrade)
-
- # the destination directory for the diversions
- test -d /usr/lib/nvidia/diversions || \
- mkdir -p /usr/lib/nvidia/diversions || true
-
- # <target: squeeze>
- # update the diversion
- if dpkg --compare-versions "$2" lt-nl 195.36.31
- then
- file_orig="/usr/lib/xorg/modules/extensions/libglx.so"
- file_old_divert="/usr/lib/nvidia/libglx.so.xlibmesa"
- file_new_divert="/usr/lib/nvidia/diversions/libglx.so"
- old_diverter="`dpkg-divert --listpackage $file_orig`"
-
- if [ -n "$old_diverter" ]
- then
- # avoid dpkg-divert --add --rename in upgrade scenarios,
- # it might rename *our* existing file -- see dpkg bug #588077
-
- dpkg-divert --remove --package $old_diverter --divert \
- "$file_old_divert" \
- "$file_orig"
- if exists "$file_old_divert"
- then
- echo "Moving $file_old_divert to $file_new_divert"
- mv "$file_old_divert" "$file_new_divert"
- fi
- dpkg-divert --add --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
- "$file_new_divert" \
- "$file_orig"
- fi
- if exists "$file_old_divert"
- then
- echo "ERROR: $file_old_divert does still exist. Aborting."
- exit 1
- fi
- fi
- # </target: squeeze>
-
- # make new diversions
- dpkg-divert $DIVERT_QUIET --add --rename --package $DPKG_MAINTSCRIPT_PACKAGE --divert \
- /usr/lib/nvidia/diversions/libglx.so \
- /usr/lib/xorg/modules/extensions/libglx.so
-
- ;;
-esac
-
-
#DEBHELPER#
exit 0
Added: packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.prerm
URL: http://svn.debian.org/wsvn/pkg-nvidia/packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.prerm?rev=1421&op=file
==============================================================================
--- packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.prerm (added)
+++ packages/nvidia-graphics-drivers/trunk/debian/nvidia-glx.prerm Tue Aug 24 21:25:13 2010
@@ -1,0 +1,14 @@
+#!/bin/sh
+set -e
+
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+
+ update-alternatives --remove libglx.so /usr/lib/nvidia/libglx.so
+
+fi
+
+
+#DEBHELPER#
+
+exit 0
More information about the Pkg-nvidia-devel
mailing list