aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-08-18 00:57:50 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-08-18 00:57:50 +0100
commit57782e4ade94ee1e3a426f18b5e7ad9a9320fca2 (patch)
tree67f6ea4aa637837c1140343c3bbe430f01629525
parent5b94e9ecc30e9f3b96c083e41235e4df2d0d75c9 (diff)
Alternative way for detecting upgrades: This should make sure that bitlbee
gets restarted, even when upgrading from versions that don't have a separate -common package.
-rw-r--r--debian/bitlbee-common.postinst17
-rw-r--r--debian/changelog4
2 files changed, 17 insertions, 4 deletions
diff --git a/debian/bitlbee-common.postinst b/debian/bitlbee-common.postinst
index c91fa89f..c965e09c 100644
--- a/debian/bitlbee-common.postinst
+++ b/debian/bitlbee-common.postinst
@@ -63,8 +63,21 @@ if [ -e /usr/share/bitlbee/help.upgrading ]; then
fi
fi
-if [ -n "$2" -a "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
- invoke-rc.d bitlbee restart
+# The official way to check if we're upgrading is to check if $2 is
+# non-empty. However, previous versions of BitlBee didn't have a
+# bitlbee-common package so in that case the var will also be empty.
+# Instead, check if the port is in use (if netstat is available). This
+# works since the debconf code will pick a free port on new installs.
+if [ "$BITLBEE_UPGRADE_DONT_RESTART" != "1" ]; then
+ unset IS_UPGRADE
+ if type netstat > /dev/null 2> /dev/null; then
+ netstat -an | grep -q :$PORT\\b.*LISTEN && IS_UPGRADE=1
+ else
+ [ -n "$2" ] && IS_UPGRADE=1
+ fi
+ if [ -n "$IS_UPGRADE" ]; then
+ invoke-rc.d bitlbee restart
+ fi
fi
## If we're upgrading, we'll probably skip this next part
diff --git a/debian/changelog b/debian/changelog
index 9606800a..8e3cabcb 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,11 @@
-bitlbee (1.3-1) unstable; urgency=low
+bitlbee (1.3-0) unstable; urgency=low
* Setting some bogus version number, fix that later.
* Now using debhelper to improve maintainability.
* Added a bitlbee-libpurple package, and split off docs and stuff into
bitlbee-common.
- -- Wilmer van der Gaast <wilmer@gaast.net> Sat, 05 Jun 2010 15:16:38 +0100
+ -- Wilmer van der Gaast <wilmer@gaast.net> Wed, 18 Aug 2010 00:53:11 +0100
bitlbee (1.2.8-1) unstable; urgency=low