[Pkg-freeipa-devel] dogtag-pki: Changes to 'master'

Timo Aaltonen tjaalton at moszumanska.debian.org
Fri Sep 18 13:19:19 UTC 2015


 debian/changelog           |    2 ++
 debian/pki-base.postinst   |   24 ++++++++++++++++++++++++
 debian/pki-base.postrm     |   10 ++++++++++
 debian/pki-server.postinst |    9 +++++++++
 4 files changed, 45 insertions(+)

New commits:
commit 7583eeaef94aad3b3d913348d138bed49e7ddafe
Author: Timo Aaltonen <tjaalton at debian.org>
Date:   Fri Sep 18 15:37:14 2015 +0300

    pki-server.postinst, pki-base.post{inst,rm}: Add pki-upgrade/pki- server-upgrade snippets.

diff --git a/debian/changelog b/debian/changelog
index 650665e..60d16ca 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,8 @@ dogtag-pki (10.2.6-1) UNRELEASED; urgency=medium
   * *.links: Link to tomcat8 policy.d.
   * debian-support.diff: Don't try to manage rc3.d/* symlinks.
   * rules: Symlink jars under subsystem WEB-INF.
+  * pki-server.postinst, pki-base.post{inst,rm}: Add pki-upgrade/pki-
+    server-upgrade snippets.
 
  -- Timo Aaltonen <tjaalton at debian.org>  Thu, 02 Apr 2015 15:45:06 +0300
 
diff --git a/debian/pki-base.postinst b/debian/pki-base.postinst
new file mode 100644
index 0000000..8c77d57
--- /dev/null
+++ b/debian/pki-base.postinst
@@ -0,0 +1,24 @@
+#!/bin/sh
+set -e
+
+OLD_VERSION=`echo $2 | sed 's/-.*//'`
+VERSION=`dpkg-query -W pki-base | sed 's/.*\t//;s/-.*//'`
+
+if [ "$1" = configure ]; then
+    # we've forgot to create pki.version before, do it here
+    if dpkg --compare-versions "$2" lt "10.2.6"; then
+        echo "Configuration-Version: $OLD_VERSION" > /etc/pki/pki.version
+    fi
+
+    if [ ! -n "$2" ]; then
+        # On installation create system upgrade tracker
+        echo "Configuration-Version: $VERSION" > /etc/pki/pki.version
+    else
+        # On upgrade run system upgrade
+        echo "Upgrading system at `/bin/date`." >> /var/log/pki/pki-upgrade-$VERSION.log 2>&1
+        /usr/sbin/pki-upgrade --silent >> /var/log/pki/pki-upgrade-$VERSION.log 2>&1
+        echo >> /var/log/pki/pki-upgrade-$VERSION.log 2>&1
+    fi
+fi
+
+#DEBHELPER#
diff --git a/debian/pki-base.postrm b/debian/pki-base.postrm
new file mode 100644
index 0000000..53092ff
--- /dev/null
+++ b/debian/pki-base.postrm
@@ -0,0 +1,10 @@
+#!/bin/sh
+set -e
+
+if [ "$1" = purge ]; then
+    rm -f /etc/pki/pki.version
+    rmdir /etc/pki
+fi
+
+
+#DEBHELPER#
diff --git a/debian/pki-server.postinst b/debian/pki-server.postinst
index c156540..4785194 100644
--- a/debian/pki-server.postinst
+++ b/debian/pki-server.postinst
@@ -2,6 +2,7 @@
 set -e
 
 OUT=/dev/null
+VERSION=`dpkg-query -W pki-server | sed 's/.*\t//;s/-.*//'`
 
 if [ "$1" = configure ]; then
     # lets give them a user/group in all cases.
@@ -11,6 +12,12 @@ if [ "$1" = configure ]; then
             --no-create-home --gecos "CA System User" \
            pkiuser > $OUT
     fi
+
+    if [ -n "$2" ]; then
+        echo "Upgrading server at `/bin/date`." >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
+        /usr/sbin/pki-server-upgrade --silent >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
+        echo >> /var/log/pki/pki-server-upgrade-$VERSION.log 2>&1
+    fi
 fi
 
 invoke_failure() {
@@ -23,4 +30,6 @@ invoke_failure() {
     fi
 }
 
+
+
 #DEBHELPER#



More information about the Pkg-freeipa-devel mailing list