<div dir="ltr"><span>Hello again,<br><br>So I have another question now. In reference to the example at hand, the FAQ mentions:<br><br>"<br></span><p>
The methods available on this interface are:
</p>
<ul><li><code>InstallPackageName("openoffice-clipart")</code></li><li><code>InstallProvideFile("/usr/share/fonts/sarai/Sarai_07.ttf")</code></li><li><code>InstallLocalFile("/home/dave/Desktop/lirc-0.6.6-4.rhfc1.dag.i686.rpm")</code></li>
<li><code>InstallMimeType("application/x-rpm")</code></li><li><code>InstallFont("lang(en_GB)")</code></li></ul>"<br><br>However, I'd like to do other tasks such as EnableRepo() and GetRepoList(), etc. How can I do this? Am I approaching this the wrong way?<br>
<br>Any help is appreciated!<br><br>Thanks,<br>Dorian <br><br><br><div class="gmail_quote">On Wed, Aug 6, 2008 at 10:38 AM, Dorian Perkins <span dir="ltr"><<a href="mailto:dperkins@google.com">dperkins@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">Hi Richard,<br><br>I actually did have the main braces. Sorry for not mentioning that. I did say I was using "exactly" the code from the FAQ, which was inaccurate.<br>
<br>I was still experiencing the following error which caused a SegFault:<br>
<br>** (process:12751): CRITICAL **: dbus_g_proxy_call: assertion `DBUS_IS_G_PROXY (proxy)' failed<br>Segmentation Fault<br><br>After reading over some DBUS help docs, I found the following function fixed that problem:<br>
<br>g_type_init ();<br><br>I added that after the variable declarations and now the code works. I am assuming you may need to add that to your FAQ example.<br><br>Good day,<br><font color="#888888">Dorian</font><div><div>
</div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Tue, Aug 5, 2008 at 11:23 PM, Richard Hughes <span dir="ltr"><<a href="mailto:hughsient@gmail.com" target="_blank">hughsient@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>On Tue, 2008-08-05 at 15:57 -0700, Dorian Perkins wrote:<br>
> Hello Again,<br>
><br>
> After some help in #packagekit (thanks to james_w), I am currently<br>
> using the following compile command:<br>
><br>
> gcc $(pkg-config --cflags dbus-glib-1) installer.c<br>
<br>
</div>Sure, I would use something similar:<br>
<br>
gcc -o installer -Wall installer.c `pkg-config --cflags --libs dbus-glib-1`<br>
<div><br>
> I am currently getting the following compile time errors:<br>
<br>
</div>Right, the code I put up on the FAQ was meant to be copied and pasted<br>
into a program (a snippet), rather than compiled ready to run demo. If<br>
you want a demo, just surround it with some main braces like this:<br>
<div><br>
#include <dbus/dbus-glib.h><br>
<br>
</div>/**<br>
* main:<br>
**/<br>
int<br>
main (int argc, char *argv[])<br>
{<br>
<div> DBusGConnection *connection;<br>
DBusGProxy *proxy;<br>
GError *error = NULL;<br>
gboolean ret;<br>
<br>
connection = dbus_g_bus_get (DBUS_BUS_SESSION, NULL);<br>
proxy = dbus_g_proxy_new_for_name (connection,<br>
"org.freedesktop.PackageKit",<br>
"/org/freedesktop/PackageKit",<br>
"org.freedesktop.PackageKit");<br>
<br>
/* execute sync method */<br>
ret = dbus_g_proxy_call (proxy, "InstallPackageName", &error,<br>
G_TYPE_STRING, "openoffice-clipart",<br>
G_TYPE_INVALID, G_TYPE_INVALID);<br>
if (!ret) {<br>
g_warning ("failed: %s", error->message);<br>
g_error_free (error);<br>
}<br>
</div> return 0;<br>
<div>}<br>
<br>
> P.S. On a side note, the python example at<br>
> <a href="http://www.packagekit.org/pk-faq.html#session-methods" target="_blank">http://www.packagekit.org/pk-faq.html#session-methods</a> works just fine.<br>
> Not sure why I am having so much trouble getting the C example to<br>
> work.<br>
<br>
</div>I'll make the FAQ clearer, and add the compile line. Apologies for the<br>
confusion.<br>
<br>
Richard.<br>
<br>
<br>
<br>
_______________________________________________<br>
PackageKit mailing list<br>
<a href="mailto:PackageKit@lists.freedesktop.org" target="_blank">PackageKit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/packagekit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/packagekit</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>