Für die PackageKit Integration in mein Projekt würde ich gerne die DBus-Schnittstelle benutzen. Also erstmal PackageKit über Git geholt, kompiliert und installiert. Bevor ich den Code auf Pascal umschreibe wollte ich die API noch mit einem Python-Script, welches auch offiziell als Demo existiert, testen:
Code: Alles auswählen
import dbus
try:
bus = dbus.SessionBus()
except dbus.DBusException, e:
print 'Unable to connect to dbus: %s' % str(e)
sys.exit()
try:
proxy = bus.get_object('org.freedesktop.PackageKit', '/org/freedesktop/PackageKit')
iface = dbus.Interface(proxy, 'org.freedesktop.PackageKit')
iface.InstallPackageName('amor')
except dbus.DBusException, e:
print 'Unable to use PackageKit: %s' % str(e)
Code: Alles auswählen
Unable to use PackageKit: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PackageKit was not provided by any .service files
Code: Alles auswählen
[D-BUS Service]
Name=org.freedesktop.PackageKit
Exec=/usr/sbin/packagekitd --disable-timer
User=root
Code: Alles auswählen
Unable to use PackageKit: org.freedesktop.DBus.Error.Spawn.ChildExited: Launch helper exited with unknown return code 0
Code: Alles auswählen
Unable to use PackageKit: org.freedesktop.DBus.Error.NoReply: Did not receive areply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Ist rein zufällig ein PackageKit Entwickler da? Weiß jemand, wie man den Fehler beheben kann? Ich kenne mich mit DBus unter Linux noch nicht so supergut aus, vielleicht mache ich auch irgendwas falsch.
Getestetes Linuxsystem: K/Ubuntu 8.10