[SCM] libdvdcss-pkg/master: compare versions of bundled guest and installed packages
onlyjob at users.alioth.debian.org
onlyjob at users.alioth.debian.org
Sun May 19 13:00:17 UTC 2013
The following commit has been merged in the master branch:
commit bc0b7d1992fd7d1abcb975cfdef4f8b182d551a0
Author: Dmitry Smirnov <onlyjob at member.fsf.org>
Date: Sun May 19 20:23:54 2013 +1000
compare versions of bundled guest and installed packages
diff --git a/debian/b-i_libdvdcss.sh b/debian/b-i_libdvdcss.sh
index e9e0843..0f1b282 100755
--- a/debian/b-i_libdvdcss.sh
+++ b/debian/b-i_libdvdcss.sh
@@ -13,26 +13,25 @@ PKGG_ALL="libdvdcss2 libdvdcss-dev"
## $RET contains "true" if build is allowed in debconf.
[ "$RET" = "true" ] || exit 0
-## get installed installer-package version
-VER="$(dpkg --status ${PKGI} 2>/dev/null | perl -0ne 'print $1 if m{Version:\s+([0-9.-]+)}sm;')"
-
## 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;')"
-## check if our version of guest package is installed.
-## installer and guest packages versions are expected to match so
-## installer-package version is mangled to append '~local' to debian revision number
-dpkg --compare-versions "${VER}~local" gt "${VERG}"
+## get version of bundled "guest" package
+VERGG=$(dpkg-parsechangelog -l/usr/share/${PKGI}/debian/changelog | sed -n 's/^Version: *//p')
+
+## check if we have a newer version of guest package to install.
+## package version is mangled to append '~local' to debian revision number
+dpkg --compare-versions "${VERGG}~local" gt "${VERG}"
[ $? = 0 ] || exit 0
## we have newer package to build/install
## Check if this very version of guest package was previously installed.
## self-disable in debconf settings, if user manually removed it.
-if [ -f "${DIR}/${PKGG}-${VER}.is-installed" ]; then
- rm "${DIR}/${PKGG}-${VER}.is-installed"
+if [ -f "${DIR}/${PKGG}-${VERGG}.is-installed" ]; then
+ rm "${DIR}/${PKGG}-${VERGG}.is-installed"
db_set ${PKGI}/build false
- echo "${PKGI}: Package ${PKGG}-${VER} was removed, stop processing..."
+ echo "${PKGI}: Package ${PKGG}-${VERGG} was removed, stop processing..."
exit 0
fi
@@ -53,9 +52,9 @@ echo "${PKGI}: Downloading orig source..."
cd ${DIR} \
&& /usr/share/${PKGI}/debian/rules get-orig-source
echo "${PKGI}: Checking integrity..."
-md5sum --check --strict --quiet /usr/share/${PKGI}/*_${VER%%-*}.orig.tar.*.md5 \
+md5sum --check --strict --quiet /usr/share/${PKGI}/*_${VERGG%%-*}.orig.tar.*.md5 \
|| (
- rm -fv ${DIR}/*_${VER%%-*}.orig.tar.*
+ rm -fv ${DIR}/*_${VERGG%%-*}.orig.tar.*
echo "Source archive failed integrity check so it was deleted. Please try again."
false
)
@@ -65,7 +64,7 @@ echo "${PKGI}: Unpacking and configuring..."
[ -d "${DIR}/build" ] && rm -rf ${DIR}/build
mkdir ${DIR}/build
cd ${DIR}/build
-tar xf ../*_${VER%%-*}.orig.tar.* --strip-components 1
+tar xf ../*_${VERGG%%-*}.orig.tar.* --strip-components 1
cp -r /usr/share/${PKGI}/debian .
## append '~local' to debian revision
perl -pi -e "s{[\d.]+-\d+\K}{~local}" debian/changelog
@@ -78,7 +77,7 @@ dpkg-buildpackage -b -uc
## installing
echo "${PKGI}: Installing..."
-dpkg --install /usr/src/${PKGI}/*_${VER}~local_*.deb \
-&& touch "${DIR}/${PKGG}-${VER}.is-installed" \
+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."
--
libdvdcss-pkg packaging
More information about the pkg-multimedia-commits
mailing list