packaging: remove character class negation for sed 66/38866/1
authorJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 29 Apr 2015 13:58:13 +0000 (15:58 +0200)
committerJosé Bollo <jose.bollo@open.eurogiciel.org>
Wed, 29 Apr 2015 13:58:13 +0000 (15:58 +0200)
When running the command sed provided by toybox, the expression
[^[:cntrl:]] is not understood, what forbids to detect DBUS and
cause further errors.

This patch removes this expression.

Change-Id: If30543fadddf8b6811e14b548a747be99612894b
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
packaging/dbus.sh

index 7d600c1..d9b0a5d 100644 (file)
@@ -5,7 +5,7 @@
 if [[ -z "$DBUS_SESSION_BUS_ADDRESS" ]]; then
    systemd_pid=$(pgrep -U $UID systemd | head -1)
    if [[ -n "$systemd_pid" ]]; then
-      val=$(sed  '/\<DBUS_SESSION_BUS_ADDRESS=/!d ; s/.*\<DBUS_SESSION_BUS_ADDRESS=\([^[:cntrl:]]*\).*/\1/' /proc/${systemd_pid}/environ)
+      val=$(tr '\0' '\n' < /proc/${systemd_pid}/environ | sed  '/^DBUS_SESSION_BUS_ADDRESS=/!d ; s/[^=]*=//')
       [[ -n "$val" ]] && export DBUS_SESSION_BUS_ADDRESS=$val
    fi
 fi