[SCM] libdvdcss-pkg/master: don't install post-invoke handler by default; confirm with user

onlyjob at users.alioth.debian.org onlyjob at users.alioth.debian.org
Sat May 25 08:29:56 UTC 2013


The following commit has been merged in the master branch:
commit 2b0cff93b57d30ca60795366eb8d0d121d209aba
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date:   Sat May 25 17:33:42 2013 +1000

    don't install post-invoke handler by default; confirm with user

diff --git a/debian/b-i_libdvdcss.sh b/debian/b-i_libdvdcss.sh
index 495afb6..f617780 100755
--- a/debian/b-i_libdvdcss.sh
+++ b/debian/b-i_libdvdcss.sh
@@ -37,9 +37,12 @@ fi
 ## check if DPKG database is locked
 dpkg -i /dev/zero 2>/dev/null
 if [ "$?" -eq 2 ]; then
-    echo "${PKGI}: dpkg database is locked. Package(s) will be built and installed by dpkg post-invoke handler."
-    echo "${PKGI}: post-invoke handler will take control after next apt-get operation i.e. install/remove/upgrade etc."
-    echo "${PKGI}: Alternatively you may use command \"sudo dpkg-reconfigure ${PKGI}\"."
+    echo "${PKGI}: dpkg database is locked. You may need to use command \"sudo dpkg-reconfigure ${PKGI}\"."
+    db_get fheroes2-pkg/post-invoke_hook
+    if [ "$RET" = "true" ]; then
+        echo "${PKGI}: Building and installation of package(s) [${PKGG}] postponed till after next APT operation."
+    fi
+    exit 0
 fi
 
 apt-get check >/dev/null 2>&1
@@ -84,5 +87,5 @@ dpkg-buildpackage -b -uc
 echo "${PKGI}: Installing..."
 dpkg --install /usr/src/${PKGI}/*_${VERGG}~local_*.deb \
 && touch "${DIR}/${PKGG}-${VERGG}.is-installed" \
-|| echo "${PKGI}: dpkg database is probably locked. Installation will be performed later from dpkg post-invoke handler."
+|| echo "${PKGI}: dpkg database is probably locked. Please try \"sudo dpkg-reconfigure ${PKGI}\"."
 
diff --git a/debian/config b/debian/config
index e249618..7cf4884 100644
--- a/debian/config
+++ b/debian/config
@@ -11,6 +11,12 @@ db_settitle libdvd-pkg/title
 if [ "$1" = configure ] || [ "$1" = reconfigure ] ; then
     db_input high libdvd-pkg/build || true
     db_go || true
+
+    db_get libdvd-pkg/build
+    if [ "$RET" = "true" ]; then
+        db_input medium libdvd-pkg/post-invoke_hook || true
+        db_go || true
+    fi
 fi
 
 db_stop
diff --git a/debian/install b/debian/install
index 313f0a9..88886e1 100644
--- a/debian/install
+++ b/debian/install
@@ -1,4 +1,4 @@
 libdvdcss/debian        /usr/share/libdvd-pkg
 libdvdcss/*.sha1        /usr/share/libdvd-pkg
 debian/*.sh             /usr/lib/libdvd-pkg
-debian/88libdvdcss-pkg  /etc/apt/apt.conf.d
+debian/88libdvdcss-pkg  /usr/lib/libdvd-pkg
diff --git a/debian/postinst b/debian/postinst
index f8da684..224aa15 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -10,9 +10,16 @@ case "$1" in
     configure*)
         db_get libdvd-pkg/build
         if [ "$RET" = "true" ]; then
+            db_get libdvd-pkg/post-invoke_hook
+            if [ "$RET" = "true" ]; then
+                [ -h "/etc/apt/apt.conf.d/88fheroes2-pkg" ] \
+                || ln -s /usr/lib/fheroes2-pkg/88fheroes2-pkg /etc/apt/apt.conf.d/88fheroes2-pkg
+            else
+                rm -f /etc/apt/apt.conf.d/88fheroes2-pkg || true
+            fi
             /usr/lib/libdvd-pkg/b-i_libdvdcss.sh
         fi
-      ;;
+    ;;
 esac
 
 db_stop
diff --git a/debian/postrm b/debian/postrm
index 599c7d4..9311cdc 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -5,9 +5,11 @@ set -e
 case "$1" in
     purge|abort-install)
         rm -rf /usr/src/libdvd-pkg || true
+        rm -f  /etc/apt/apt.conf.d/88libdvdcss-pkg || true
     ;;
     remove)
         rm -rf /usr/src/libdvd-pkg/build || true
+        rm -f  /etc/apt/apt.conf.d/88libdvdcss-pkg || true
     ;;
 esac
 
diff --git a/debian/templates b/debian/templates
index 83af680..5c70a40 100644
--- a/debian/templates
+++ b/debian/templates
@@ -10,3 +10,18 @@ _Description: Continue?
  install libdvdcss library as Debian package.
  .
  Source files will be downloaded from videolan.org.
+
+Template: libdvd-pkg/post-invoke_hook
+Type: boolean
+Default: false
+_Description: Install APT post-invoke hook?
+ Optional experimental APT post-invoke hook may be installed to allow
+ automatic re-build/re-install of guest package(s) on host package
+ upgrade. After every APT operation hook will check whenever guest
+ package(s) can be updated. If upgrade detected it will attempt to build
+ and install package(s) using `dpkg -i`. Otherwise guest packages may be
+ rebuild on manual invocation of `dpkg-reconfigure`.
+ .
+ Although at the moment there are no known problems associated with APT
+ post-invoke hook it is considered unsafe due to its potential to
+ interfere with APT/dpkg operations. Use at your own risk.

-- 
libdvdcss-pkg packaging



More information about the pkg-multimedia-commits mailing list