diff -u libebox-0.11.99/debian/changelog libebox-0.11.99/debian/changelog --- libebox-0.11.99/debian/changelog +++ libebox-0.11.99/debian/changelog @@ -1,3 +1,11 @@ +libebox (0.11.99-0ubuntu4) intrepid; urgency=low + + * debian/patches/05_dbus_gconf.dpatch + - Patch to support the new gconf version using dbus. (LP: #314606) + - Adjust regex in Config.pm.in for new dbus configuration. + + -- Adam Sommer Sat, 20 Dec 2008 16:01:46 -0500 + libebox (0.11.99-0ubuntu3) hardy; urgency=low * debian/patches/04_disable_debug.dpatch diff -u libebox-0.11.99/debian/patches/00list libebox-0.11.99/debian/patches/00list --- libebox-0.11.99/debian/patches/00list +++ libebox-0.11.99/debian/patches/00list @@ -4,0 +5 @@ +05_dbus_gconf.dpatch only in patch2: unchanged: --- libebox-0.11.99.orig/debian/patches/05_dbus_gconf.dpatch +++ libebox-0.11.99/debian/patches/05_dbus_gconf.dpatch @@ -0,0 +1,76 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 01_dbus_gconf.dpatch by Javier Uruen Val +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch to support the new gconf version using dbus + +@DPATCH@ +diff -urNad libebox-0.11.99~/src/EBox/Config.pm.in libebox-0.11.99/src/EBox/Config.pm.in +--- libebox-0.11.99~/src/EBox/Config.pm.in 2008-12-20 16:02:09.000000000 -0500 ++++ libebox-0.11.99/src/EBox/Config.pm.in 2008-12-20 16:02:09.000000000 -0500 +@@ -57,7 +57,7 @@ + $_ =~ s/\s//g; + $_ =~ s/#.*//g; + ($_ eq '') and next; +- my ($nkey, $nvalue) = $_ =~ /(.*)=(.*)/; ++ my ($nkey, $nvalue) = $_ =~ /(.*?)=(.*)/; + if ($nkey eq $key) { + $value = $nvalue; + last; +diff -urNad libebox-0.11.99~/src/EBox.pm libebox-0.11.99/src/EBox.pm +--- libebox-0.11.99~/src/EBox.pm 2008-12-20 16:02:09.000000000 -0500 ++++ libebox-0.11.99/src/EBox.pm 2008-12-20 16:05:59.000000000 -0500 +@@ -20,8 +20,10 @@ + + use EBox::Config; + use EBox::Exceptions::DeprecatedMethod; +-use POSIX qw(setuid setgid setlocale LC_ALL); + use English; ++use POSIX qw(setuid setgid setlocale LC_ALL LC_NUMERIC); ++ ++use constant DBUS_CMD => 'ebox-dbus-launch'; + + my $loginit = 0; + +@@ -118,6 +120,41 @@ + my $user = EBox::Config::user(); + my $uid = getpwnam($user); + setuid($uid) or die "Cannot change user to $user"; ++ dbusInit(); + } ++ ++# Method: dbusInit ++# ++# Initialise a dbus daemon, if it's not already done. We store ++# one for root and one for eBox user. ++# ++# ++sub dbusInit ++{ ++ my $confFile; ++ if ( POSIX::getuid() == 0) { ++ $confFile = EBox::Config::conf() . 'dbus-root-session.conf'; ++ } else { ++ $confFile = EBox::Config::conf() . 'dbus-ebox-session.conf'; ++ } ++ my ($dbusAddress, $dbusDaemonPid, $launchNew) = (0, 0, 1); ++ ++ if ( -r $confFile ) { ++ $dbusAddress = EBox::Config::configkeyFromFile( ++ 'DBUS_SESSION_BUS_ADDRESS', $confFile); ++ $dbusDaemonPid = EBox::Config::configkeyFromFile( ++ 'DBUS_SESSION_BUS_PID', $confFile); ++ } ++ ++ # TODO: dbus-send would be cooler than kill ++ unless ( $dbusDaemonPid and (kill 0, $dbusDaemonPid) ) { ++ system( EBox::Config::pkgdata() . DBUS_CMD . " $confFile"); ++ chmod(0660, $confFile); ++ $dbusAddress = EBox::Config::configkeyFromFile('DBUS_SESSION_BUS_ADDRESS', $confFile); ++ } ++ ++ $ENV{DBUS_SESSION_BUS_ADDRESS} = $dbusAddress; ++} ++ + + 1;