[maemo-commits] [maemo-commits] r15693 - projects/haf/trunk/dbus/debian

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Sat Jun 28 00:10:26 EEST 2008
Author: guillem
Date: 2008-06-28 00:10:23 +0300 (Sat, 28 Jun 2008)
New Revision: 15693

Modified:
   projects/haf/trunk/dbus/debian/dbus.postinst
Log:
Sync with Debian


Modified: projects/haf/trunk/dbus/debian/dbus.postinst
===================================================================
--- projects/haf/trunk/dbus/debian/dbus.postinst	2008-06-27 21:09:51 UTC (rev 15692)
+++ projects/haf/trunk/dbus/debian/dbus.postinst	2008-06-27 21:10:23 UTC (rev 15693)
@@ -7,12 +7,41 @@
 
 MESSAGEUSER=messagebus
 MESSAGEHOME=/var/run/dbus
+LAUNCHER=/usr/lib/dbus-1.0/dbus-daemon-launch-helper
 
-chgrp "$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || groupadd  "$MESSAGEUSER"
-chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME" 2>/dev/null || \
-useradd -d "$MESSAGEHOME" -g $MESSAGEUSER $MESSAGEUSER
-usermod -G dialout $MESSAGEUSER
+if [ "$1" = configure ]; then
+    # XXX (maemo divergenge)
+#    adduser --system \
+#            --home "$MESSAGEHOME" \
+#            --no-create-home \
+#            --disabled-password \
+#            --group "$MESSAGEUSER"
 
+    groupadd  "$MESSAGEUSER" 2>/dev/null
+    chgrp "$MESSAGEUSER" "$MESSAGEHOME"
+
+    useradd -d "$MESSAGEHOME" -g $MESSAGEUSER $MESSAGEUSER 2>/dev/null
+    chown "$MESSAGEUSER":"$MESSAGEUSER" "$MESSAGEHOME"
+
+    # XXX (maemo divergenge) why!
+    usermod -G dialout $MESSAGEUSER
+
+    if ! dpkg-statoverride --list "$LAUNCHER" >/dev/null 2>&1; then
+            chown root:"$MESSAGEUSER" "$LAUNCHER"
+            chmod 4754 "$LAUNCHER"
+    fi
+fi
+
+# update init script symlinks for new runlevels and priorities for upgrades
+# from older versions
+if [ "$1" = configure ] && dpkg --compare-versions "$2" lt-nl 1.1.20-1; then
+    echo "Reinstalling init script for new runlevels and priorities ..." >&2
+    # remove old init script symlinks; dh_installinit adds the proper
+    # update-rc.d snippet later on
+    update-rc.d -f dbus remove >/dev/null
+fi
+
+# XXX (maemo divergenge)
 # Do not restart dbus on upgrades, only on fresh installations
 #if [ "$1" = "configure" ]; then
 #    if [ -e /var/run/dbus/pid ] && 
@@ -24,7 +53,19 @@
 #    fi
 #fi
 
+if [ "$1" = configure ] && [ -n "$2" ] && [ -x "/etc/init.d/dbus" ]; then
+    # Restart dbus on upgrades.
+    # dh_installinit -r creates the necessary start action.
+# XXX (maemo divergenge)
+#    invoke-rc.d dbus stop || true
+    :
+fi
+
+# XXX (maemo divergenge)
 if [ -x "/etc/init.d/dbus" ]; then
-        update-rc.d dbus defaults >/dev/null
+    update-rc.d dbus defaults >/dev/null
 fi
 
+# XXX (maemo divergenge)
+# @DEBHELPER@
+


More information about the maemo-commits mailing list