]> git.decadent.org.uk Git - ion3.git/blobdiff - debian/ion3.postinst
Changed version check to accept failure of uscan.
[ion3.git] / debian / ion3.postinst
index 30850138ae4bbd45d87d3f1b49092e572e2932ae..9ec35675f488db5d7d7ceccd0ce3cd83c53adcf7 100644 (file)
@@ -3,17 +3,20 @@ set -e
 . /usr/share/debconf/confmodule
 
 UPSTREAM_VERSION=
+DEBIAN_VERSION=
 
-if [ "$1" = configure -a "$2" = "" ]; then
-    # Installing for the first time (or after a purge).
+if [ "$1" = configure ] \
+    && dpkg --compare-versions "$2" lt "$DEBIAN_VERSION"; then
+    # Installing for the first time or upgrading.
     # To comply with the Ion trademark licence terms, we must ensure
     # that this version is up-to-date or that the user acknowledges
     # it is not.  I freely admit that this is a horrible abuse of
     # debconf, but it seems slightly less unpleasant than maintaining
     # a renamed version. - benh
-    uscan_output=$(uscan 2>&1 --no-conf --report-status \
-                  --package ion3 --upstream-version "$UPSTREAM_VERSION" \
-                  --watchfile /usr/share/ion3/debian/watch)
+    uscan_output="$(uscan 2>&1 --no-conf --report-status \
+                   --package ion3 --upstream-version "$UPSTREAM_VERSION" \
+                   --watchfile /usr/share/ion3/debian/watch \
+                    || true)"
     case "$uscan_output" in
        *"up to date"*)
            question=''
@@ -65,6 +68,9 @@ if [ -f $inst ]; then
     chmod a+x $inst
 fi
 
+# Initialise extra configuration file list if missing
+[ -f /etc/X11/ion3/cfg_debian_ext.lua ] || >/etc/X11/ion3/cfg_debian_ext.lua
+
 #DEBHELPER#
 
 # Remove the old now-renamed generated Debian menu