[SCM] libdvd-pkg/master: shared variables for all scripts

onlyjob at users.alioth.debian.org onlyjob at users.alioth.debian.org
Sun Jun 30 17:16:00 UTC 2013


The following commit has been merged in the master branch:
commit 067a37615a984ea7e0d48cac03580d1f60216e51
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date:   Mon Jul 1 00:55:58 2013 +1000

    shared variables for all scripts
    
    Rename "postrm" --> "prerm" as the latter can source variables.

diff --git a/debian/VARS b/debian/VARS
new file mode 100644
index 0000000..0c73916
--- /dev/null
+++ b/debian/VARS
@@ -0,0 +1,11 @@
+PKGI="libdvd-pkg"
+DIR="/usr/src/${PKGI}"
+PKGG="libdvdcss2"
+PKGG_ALL="libdvdcss2 libdvdcss-dev"
+P88="88libdvdcss-pkg"
+
+## get version of bundled "guest" package
+VERGG=$(dpkg-parsechangelog -l/usr/share/${PKGI}/debian/changelog | sed -n 's/^Version: *//p')
+
+## get installed guest-package version
+VERG="$(dpkg --status ${PKGG} 2>/dev/null | perl -0ne 'print $1 if m{^Status:\s+install\s+ok\s+installed}sm and m{^Version:\s+(\S+)}sm;')"
diff --git a/debian/b-i_libdvdcss.sh b/debian/b-i_libdvdcss.sh
index cdf866c..f44445a 100755
--- a/debian/b-i_libdvdcss.sh
+++ b/debian/b-i_libdvdcss.sh
@@ -1,16 +1,6 @@
 #!/bin/sh
 
-PKGI="libdvd-pkg"
-DIR="/usr/src/${PKGI}"
-PKGG="libdvdcss2"
-PKGG_ALL="libdvdcss2 libdvdcss-dev"
-P88="88libdvdcss-pkg"
-
-## get installed guest-package version
-VERG="$(dpkg --status ${PKGG} 2>/dev/null | perl -0ne 'print $1 if m{^Status:\s+install\s+ok\s+installed}sm and m{^Version:\s+([0-9.-]+)}sm;')"
-
-## get version of bundled "guest" package
-VERGG=$(dpkg-parsechangelog -l/usr/share/${PKGI}/debian/changelog | sed -n 's/^Version: *//p')
+. /usr/lib/libdvd-pkg/VARS
 
 ## check if we have a newer version of guest package to install.
 ## package version is mangled to append '~local' to debian revision number
diff --git a/debian/config b/debian/config
index 7cf4884..9e65383 100644
--- a/debian/config
+++ b/debian/config
@@ -1,6 +1,8 @@
 #!/bin/sh
 set -e
 
+. /usr/lib/libdvd-pkg/VARS
+
 # Source debconf library.
 . /usr/share/debconf/confmodule
 
diff --git a/debian/install b/debian/install
index 88886e1..df06c30 100644
--- a/debian/install
+++ b/debian/install
@@ -2,3 +2,4 @@ libdvdcss/debian        /usr/share/libdvd-pkg
 libdvdcss/*.sha1        /usr/share/libdvd-pkg
 debian/*.sh             /usr/lib/libdvd-pkg
 debian/88libdvdcss-pkg  /usr/lib/libdvd-pkg
+debian/VARS             /usr/lib/libdvd-pkg
diff --git a/debian/postinst b/debian/postinst
index 7748705..0000683 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -2,6 +2,8 @@
 
 set -e
 
+. /usr/lib/libdvd-pkg/VARS
+
 # Source debconf library.
 . /usr/share/debconf/confmodule
 db_version 2.0
diff --git a/debian/postrm b/debian/prerm
similarity index 62%
rename from debian/postrm
rename to debian/prerm
index e4f9a35..d5f34cd 100644
--- a/debian/postrm
+++ b/debian/prerm
@@ -2,16 +2,15 @@
 
 set -e
 
-PKG=libdvd-pkg
-P88=88libdvdcss-pkg
+. /usr/lib/libdvd-pkg/VARS
 
 case "$1" in
     purge|abort-install)
-        rm -rf /usr/src/${PKG} || true
+        rm -rf /usr/src/${PKGI} || true
         rm -f  /etc/apt/apt.conf.d/${P88} || true
     ;;
     remove)
-        rm -rf /usr/src/${PKG}/build || true
+        rm -rf /usr/src/${PKGI}/build || true
         rm -f  /etc/apt/apt.conf.d/${P88} || true
     ;;
 esac

-- 
libdvdcss-pkg packaging



More information about the pkg-multimedia-commits mailing list