On 1/21/07, Randy McMurchy <[EMAIL PROTECTED]> wrote:
>
> What about
>
> if test -f /etc/dbus-1/session-local.conf; then only add the line
> else create a new file with the right stuff
> fi

It's still kind of tricky because you're dealing with XML markup, so
it's not like the already existing case you just append one line.
Here's the best I could come up with. Gmail is going to screw this up
inlining, but hopefully you'll get the jist of it.

--
Dan

Index: gnome/add/epiphany.xml
===================================================================
--- gnome/add/epiphany.xml      (revision 6454)
+++ gnome/add/epiphany.xml      (working copy)
@@ -108,8 +108,26 @@
     <systemitem class="username">root</systemitem> user you should add the
     <filename class='directory'>$GNOME_PREFIX/share/dbus-1/services</filename>
     directory to the local session configuration as described in the
-    <xref linkend="dbus"/> configuration section.</para>
+    <xref linkend="dbus"/> configuration section:</para>

+<screen role="root"><userinput>if [ -f /etc/dbus-1/session-local.conf ]; then
+    sed -i "\%&lt;/busconfig&gt;%{
+        i\    
&lt;servicedir&gt;$GNOME_PREFIX/share/dbus-1/services&lt;/servicedir&gt;
+    }" /etc/dbus-1/session-local.conf
+else
+    cat &gt; /etc/dbus-1/session-local.conf &lt;&lt; EOF
+<literal>&lt;!DOCTYPE busconfig PUBLIC
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"&gt;
+&lt;busconfig&gt;
+
+  &lt;!-- Search for .service files in $GNOME_PREFIX --&gt;
+  &lt;servicedir&gt;$GNOME_PREFIX/share/dbus-1/services&lt;/servicedir&gt;
+
+&lt;/busconfig&gt;</literal>
+EOF
+fi</userinput></screen>
+
     <para>If you have <application>GNOME-Python</application> installed, the
     <application>Epiphany</application> <application>Python</application>
     extension is automatically built. If your $GNOME_PREFIX is anything but
-- 
http://linuxfromscratch.org/mailman/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to