Add postinst/postrm action to store package versions.
commit58583f95f7d1bd9cfc9d9ede7db45ad2fb9cee23
authorPawel Stolowski <pawel.stolowski@canonical.com>
dateFri 25 Sep 2015, 16:10 (11 years ago)
parentea79f9f
debian/postinstnew file+16
@@ -0,0 +1,16 @@
1+#!/bin/sh
2+
3+set -e
4+
5+#
6+# store package version in a text file for quick retrieval from the plugin
7+# for sending to smart scopes server.
8+if [ "$1" = "configure" ]; then
9+ DIR=/var/lib/$DPKG_MAINTSCRIPT_PACKAGE
10+ if ! test -e $DIR
11+ then
12+ mkdir $DIR
13+ fi
14+ dpkg-query -W -f'${Version}' $DPKG_MAINTSCRIPT_PACKAGE \
15+ > $DIR/version
16+fi
debian/postrmnew file+7
@@ -0,0 +1,7 @@
1+#!/bin/sh
2+
3+set -e
4+
5+DIR=/var/lib/$DPKG_MAINTSCRIPT_PACKAGE
6+rm -f $DIR/version
7+rmdir $DIR