[SCM] Phonon Multimedia Framework packaging branch, master, updated. debian/4.6.0really4.4.3-1-27-gcdc8ae0

Modestas Vainius modax at alioth.debian.org
Sun Feb 27 00:08:37 UTC 2011


The following commit has been merged in the master branch:
commit 6e0f61fdf5d899746f07befc7f9ab4b6ef267835
Author: Modestas Vainius <modestas at vainius.eu>
Date:   Mon Feb 21 01:09:05 2011 +0200

    Show a debconf warning to users who end up installing phonon-backend-null.
    
    It is very likely that such a (mis)configuration is unintentionally. The
    warning is displayed only if both phonon and phonon-backend-null packages end
    up being installed.
---
 debian/changelog                          |    3 +
 debian/expand_vars.awk                    |   23 ++++++++++
 debian/phonon-backend-null.dc-postinst.in |   67 +++++++++++++++++++++++++++++
 debian/phonon-backend-null.postinst       |    7 +++
 debian/phonon-backend-null.postrm         |   17 +++++++
 debian/phonon-backend-null.templates      |   17 +++++++
 debian/phonon.postinst                    |    7 +++
 debian/phonon.templates                   |    1 +
 debian/po/POTFILES.in                     |    1 +
 debian/rules                              |   11 +++++
 10 files changed, 154 insertions(+), 0 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index a7911b8..4d47ac3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,9 @@ phonon (4:4.6.0really4.4.4-0r1) UNRELEASED; urgency=low
   * Reshuffle backends in the Suggests of the phonon metapackage in the order of
     preferrence.
   * Drop README.source, no longer needed since switch to 3.0 (quilt).
+  * Show a debconf warning to users who end up installing phonon-backend-null
+    (probably unintentionally). The warning is displayed only if both phonon
+    and phonon-backend-null packages end up being installed.
 
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sun, 05 Dec 2010 16:01:39 +0100
 
diff --git a/debian/expand_vars.awk b/debian/expand_vars.awk
new file mode 100644
index 0000000..e4a1f3d
--- /dev/null
+++ b/debian/expand_vars.awk
@@ -0,0 +1,23 @@
+function readfile(file)
+{
+    while (getline < file) {
+        process()
+    }
+}
+
+function process()
+{
+    gsub(/#RECOMMENDED_BACKEND#/,recommended_backend);
+    if (/^#INCLUDE [^#]+#$/) {
+        readfile(substr($0,10,length($0)-9-1));
+        return
+    } else if (/^INCLUDE#: .+/) {
+        readfile(substr($0,11,length($0)-10));
+        return
+    }
+    print
+}
+
+{
+    process()
+}
diff --git a/debian/phonon-backend-null.dc-postinst.in b/debian/phonon-backend-null.dc-postinst.in
new file mode 100644
index 0000000..dcfa1fc
--- /dev/null
+++ b/debian/phonon-backend-null.dc-postinst.in
@@ -0,0 +1,67 @@
+# START POSTINST[phonon-null-backend/isnt_functional]
+
+. /usr/share/debconf/confmodule
+
+query_package_status()
+{
+    dpkg-query -W -f'${Status}\n' "$1" | cut -d' ' -f3
+}
+
+# This function will show a warning about phonon-backend-null whenever phonon
+# metapackage or phonon-backend-null is being installed
+warn_about_phonon_backend_null()
+{
+    local package=`basename "$0" .postinst`
+    local show_warning=0
+    local recommended_backend="#RECOMMENDED_BACKEND#"
+    local other_backends
+
+    # Do not show the note when reconfiguring
+    if [ "$1" = "reconfigure" ] || [ "DEBCONF_RECONFIGURE" = "1" ]; then
+        return 0
+    fi
+
+    if [ "$1" = "configure" ]; then
+        case "$package" in
+            # In case the phonon metapackage is being installed, display the
+            # warning only if phonon-backend-null is already installed.
+            phonon)
+                if [ "`query_package_status phonon-backend-null`" = "installed" ]; then
+                    show_warning=1
+                fi
+            ;;
+            # If null backend is being installed, show the warning only if
+            # phonon metapackage is already installed
+            phonon-backend-null)
+                if [ "`query_package_status phonon`" = "installed" ]; then
+                    show_warning=1
+                fi
+            ;;
+            *)
+                echo "warn_about_phonon_backend_null: unsupported package: $package" >&2
+                exit 10
+            ;;
+        esac
+
+        # Finally show the note if needed (and it wasn't seen already)
+        db_fget phonon-backend-null/isnt_functional seen || true
+        if [ "$RET" != "true" ] && [ "$show_warning" = "1" ]; then
+            other_backends="`LC_ALL=C apt-cache showpkg phonon-backend | \
+                            awk '/: *$/{go=0} {if (go==1) print $1;} /^Reverse Provides: *$/ {go=1}' | \
+                            sort -u | \
+                            grep -v -e phonon-backend-null -e "$recommended_backend" | \
+                            awk '{printf ", " $1}'`"
+            db_settitle phonon-backend-null/isnt_functional_title || true
+            db_subst phonon-backend-null/isnt_functional recommended_backend "$recommended_backend"
+            db_subst phonon-backend-null/isnt_functional other_backends "$other_backends"
+            db_input high phonon-backend-null/isnt_functional || true
+            db_go || true
+        fi
+    fi
+}
+
+warn_about_phonon_backend_null "$@"
+
+# vim: set syntax=sh
+
+# END POSTINST[phonon-null-backend/isnt_functional]
diff --git a/debian/phonon-backend-null.postinst b/debian/phonon-backend-null.postinst
new file mode 100644
index 0000000..b5c0bdd
--- /dev/null
+++ b/debian/phonon-backend-null.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+#INCLUDE debian/phonon-backend-null.dc-postinst.in#
+
+#DEBHELPER#
diff --git a/debian/phonon-backend-null.postrm b/debian/phonon-backend-null.postrm
new file mode 100644
index 0000000..b896593
--- /dev/null
+++ b/debian/phonon-backend-null.postrm
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+set -e
+
+case "$1" in
+    *upgrade)
+        # Do not touch phonon-backend-null/isnt_functional on upgrades
+    ;;
+    *)
+        if [ -e /usr/share/debconf/confmodule ]; then
+            . /usr/share/debconf/confmodule
+            db_fset phonon-backend-null/isnt_functional seen false || true
+        fi
+    ;;
+esac
+
+#DEBHELPER#
diff --git a/debian/phonon-backend-null.templates b/debian/phonon-backend-null.templates
new file mode 100644
index 0000000..cf7ff9b
--- /dev/null
+++ b/debian/phonon-backend-null.templates
@@ -0,0 +1,17 @@
+Template: phonon-backend-null/isnt_functional_title
+Type: title
+_Description: Warning: Phonon is not functional
+
+Template: phonon-backend-null/isnt_functional
+Type: note
+_Description: Phonon multimedia capabilities are disabled
+ Phonon based (i.e. most KDE and some Qt) applications will produce no audio or
+ video output because there is no real Phonon backend installed on your system.
+ Typically, this is an undesirable configuration which you might have gotten to
+ unintentionally.
+ .
+ If you wish to restore full Phonon multimedia capabilities, install a real
+ Phonon backend with your favourite package manager. The following Phonon
+ backend packages seem to be available for your system at the moment:
+ .
+ ${recommended_backend} (recommended)${other_backends}
diff --git a/debian/phonon.postinst b/debian/phonon.postinst
new file mode 100644
index 0000000..b5c0bdd
--- /dev/null
+++ b/debian/phonon.postinst
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+#INCLUDE debian/phonon-backend-null.dc-postinst.in#
+
+#DEBHELPER#
diff --git a/debian/phonon.templates b/debian/phonon.templates
new file mode 100644
index 0000000..1cf5cf7
--- /dev/null
+++ b/debian/phonon.templates
@@ -0,0 +1 @@
+INCLUDE#: debian/phonon-backend-null/DEBIAN/templates
diff --git a/debian/po/POTFILES.in b/debian/po/POTFILES.in
new file mode 100644
index 0000000..bf732bd
--- /dev/null
+++ b/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] phonon-backend-null.templates
diff --git a/debian/rules b/debian/rules
index ecbeee1..618b5cc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,6 +3,7 @@
 include /usr/share/pkg-kde-tools/qt-kde-team/1/debian-qt-kde.mk
 
 UPSTREAMVERSION ?= $(shell dpkg-parsechangelog | grep '^Version: ' | sed 's/^Version: \(.*\)-.*/\1/')
+DEB_RECOMMENDED_PHONON_BACKEND := phonon-backend-vlc
 
 DEB_DH_MAKESHLIBS_ARGS_libphonon4 = -V'libphonon4 (>= $(UPSTREAMVERSION)), phonon'
 
@@ -12,3 +13,13 @@ DEB_DH_SHLIBDEPS_ARGS_ALL := -- -xphonon
 # Strict interdependencies for backends
 DEB_STRICT_LOCAL_SHLIBS_PACKAGES = $(DEB_LIBRARY_PACKAGES)
 include /usr/share/pkg-kde-tools/qt-kde-team/1/library-packages.mk
+
+$(patsubst %,binary-predeb/%,$(DEB_ALL_PACKAGES)) :: binary-predeb/% :
+	@for f in debian/$(cdbs_curpkg)/DEBIAN/post* \
+	          debian/$(cdbs_curpkg)/DEBIAN/pre* \
+	          debian/$(cdbs_curpkg)/DEBIAN/templates; do \
+	    if [ -f "$$f" ]; then \
+	        cmd="awk -f debian/expand_vars.awk -v recommended_backend='$(DEB_RECOMMENDED_PHONON_BACKEND)' -- $$f > $$f.tmp && cat $$f.tmp >| $$f && rm -f $$f.tmp"; \
+	        echo "$$cmd"; eval "$$cmd"; \
+	    fi; \
+	done

-- 
Phonon Multimedia Framework packaging



More information about the pkg-kde-commits mailing list