Get rid of our custom dbus config, simplify stuff

This commit is contained in:
Marco Pesenti Gritti 2006-12-01 21:24:24 +01:00
parent 0e2d9b496a
commit cf156fac07
7 changed files with 10 additions and 83 deletions

View File

@ -2,23 +2,10 @@ SUBDIRS = lib po shell sugar services tools
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
dbusconfdir = $(pkgdatadir)
dbusconf_DATA = dbus-installed.conf
bin_SCRIPTS = \ bin_SCRIPTS = \
sugar-emulator \ sugar-emulator \
sugar-emulator-shutdown sugar-emulator-shutdown
install-data-local:
$(top_srcdir)/sugar/setup.py \
$(top_srcdir)/activities \
$(DESTDIR)$(pkgdatadir)/activities \
$(bindir)/sugar-activity-factory
uninstall-local:
rm -rf $(DESTDIR)$(pkgdatadir)/activities/*.activity
rm -rf $(DESTDIR)$(pkgdatadir)/activities/*.service
DISTCLEANFILES = \ DISTCLEANFILES = \
intltool-extract \ intltool-extract \
intltool-merge \ intltool-merge \

View File

@ -50,7 +50,6 @@ AM_GLIB_GNU_GETTEXT
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
dbus-installed.conf
lib/Makefile lib/Makefile
lib/data/Makefile lib/data/Makefile
lib/src/Makefile lib/src/Makefile

View File

@ -1,27 +0,0 @@
<!-- This configuration file controls the per-user-login-session message bus.
Add a session-local.conf and edit that rather than changing this
file directly. -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Our well-known bus type, don't change this -->
<type>session</type>
<listen>unix:tmpdir=/tmp</listen>
<standard_session_servicedirs />
<servicedir>@prefix@/share/sugar/activities</servicedir>
<servicedir>@prefix@/share/sugar/services</servicedir>
<servicedir>/tmp/sugar-services</servicedir>
<policy context="default">
<!-- Allow everything to be sent -->
<allow send_destination="*"/>
<!-- Allow everything to be received -->
<allow eavesdrop="true"/>
<!-- Allow anyone to own anything -->
<allow own="*"/>
</policy>
</busconfig>

View File

@ -1,26 +0,0 @@
<!-- This configuration file controls the per-user-login-session message bus.
Add a session-local.conf and edit that rather than changing this
file directly. -->
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<!-- Our well-known bus type, don't change this -->
<type>session</type>
<listen>unix:tmpdir=/tmp</listen>
<standard_session_servicedirs />
<servicedir>/tmp/sugar</servicedir>
<servicedir>/tmp/sugar-services</servicedir>
<policy context="default">
<!-- Allow everything to be sent -->
<allow send_destination="*"/>
<!-- Allow everything to be received -->
<allow eavesdrop="true"/>
<!-- Allow anyone to own anything -->
<allow own="*"/>
</policy>
</busconfig>

View File

@ -48,19 +48,15 @@ if sourcedir:
else: else:
os.environ['PATH'] = bin_path os.environ['PATH'] = bin_path
source = os.path.join(sourcedir, 'activities')
runner = os.path.join(sourcedir, 'shell/sugar-activity-factory')
setup.setup_activities(source, env.get_activity_info_dir(), runner)
bin = os.path.join(sourcedir, bin = os.path.join(sourcedir,
'services/presence/sugar-presence-service') 'services/presence/sugar-presence-service')
setup.write_service('org.laptop.Presence', bin, setup.write_service('org.laptop.Presence', bin,
env.get_activity_info_dir()) env.get_user_service_dir())
bin = os.path.join(sourcedir, bin = os.path.join(sourcedir,
'services/clipboard/sugar-clipboard') 'services/clipboard/sugar-clipboard')
setup.write_service('org.laptop.Clipboard', bin, setup.write_service('org.laptop.Clipboard', bin,
env.get_activity_info_dir()) env.get_user_service_dir())
from sugar.emulator import Emulator from sugar.emulator import Emulator
@ -76,7 +72,4 @@ for i in range(1, len(sys.argv)):
emulator = Emulator(fullscreen) emulator = Emulator(fullscreen)
emulator.start() emulator.start()
dbus_config = env.get_dbus_config() os.execlp('dbus-launch', 'dbus-launch', '--exit-with-session', program)
os.execlp('dbus-launch', 'dbus-launch', '--exit-with-session',
'--config-file=%s' % dbus_config, program)

View File

@ -10,9 +10,7 @@ class _ServiceParser(ConfigParser):
class _ServiceManager(object): class _ServiceManager(object):
def __init__(self): def __init__(self):
self._path = os.path.expanduser('~/.local/share/dbus-1/services') self._path = env.get_user_service_dir()
if not os.path.isdir(self._path):
os.makedirs(self._path)
def add(self, bundle): def add(self, bundle):
name = bundle.get_service_name() name = bundle.get_service_name()

View File

@ -51,9 +51,6 @@ def get_activity_info_dir():
def get_services_dir(): def get_services_dir():
return sugar_services_dir return sugar_services_dir
def get_dbus_config():
return sugar_dbus_config
def get_shell_bin_dir(): def get_shell_bin_dir():
return sugar_shell_bin_dir return sugar_shell_bin_dir
@ -63,3 +60,9 @@ def get_data_dirs():
return os.environ['XDG_DATA_DIRS'].split(':') return os.environ['XDG_DATA_DIRS'].split(':')
else: else:
return [ '/usr/local/share/', '/usr/share/' ] return [ '/usr/local/share/', '/usr/share/' ]
def get_user_service_dir():
service_dir = os.path.expanduser('~/.local/share/dbus-1/services')
if not os.path.isdir(service_dir):
os.makedirs(service_dir)
return service_dir