public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Francesco R <vivo75@gmail.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] showing file diffs as root
Date: Mon, 31 May 2010 14:21:52 +0200	[thread overview]
Message-ID: <AANLkTileUGq2ODN_NFMw-iqhxvOXnSnYEGukzNYmjVAz@mail.gmail.com> (raw)
In-Reply-To: <4C027D51.6010101@basementcode.com>

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

why not make a temporary copy of the files with appropriate permission,
send a message the application the user originally opened to diff the files,
then apply the user modified file and cleanup the $tmpdir?

This would leave the user the possibility to choose whatever application she
want to do the merge, which is a big plus.

2010/5/30 Christopher Harvey <chris@basementcode.com>

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello gentoo-dev,
>
> I'm working on an app for GSoC that needs to show a diff of two files
> to the user. Right now I've just been calling meld from the python
> os.system call. I tried running my application as root to show diffs
> of system files that belong to root. I got this error:
>
> Traceback (most recent call last):
>  File "/usr/bin/meld", line 90, in <module>
>    meldapp.main()
>  File "/usr/lib/meld/meldapp.py", line 982, in main
>    app = MeldApp()
>  File "/usr/lib/meld/meldapp.py", line 562, in __init__
>    self.prefs = MeldPreferences()
>  File "/usr/lib/meld/meldapp.py", line 435, in __init__
>    super(MeldPreferences, self).__init__("/apps/meld", self.defaults)
>  File "/usr/lib/meld/prefs.py", line 92, in __init__
>    self._gconf.add_dir(rootkey, gconf.CLIENT_PRELOAD_NONE)
> glib.GError: Failed to contact configuration server; some possible
> causes are that you need to enable TCP/IP networking for ORBit, or you
> have stale NFS locks due to a system crash. See
> http://projects.gnome.org/gconf/ for information. (Details -  1:
> Failed to get connection to session: Did not receive a reply. 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.)
>
> I haven't looked into why this is happening very much because calling
> os.system("meld file1 file2 &") in python is putting up so many red
> flags in my head it's not funny. If anybody could tell me the proper
> gentoo/linux/python way to present a root level diff to a user running
> a program through su or sudo I'd really appreciate the help.
>
> thanks,
> Chris
>
> - --
> My GnuPGP key at:
> www.basementcode.com/public_key.txt
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.14 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQEcBAEBAgAGBQJMAn1RAAoJEDqfZIFeqFH7brQH/RqeUmCHuopa+SufkzNNT4Ys
> 7IJArQCik3vBLJLpeTM3gf3NL3KMWjyzlxxQ8L74KAhItPuA3cVUQKQrSnOCBiDa
> y6yfDttBbOptOtcUYn7WkXQDm+BYEdpviMfjtym5ZF2nlGOMzZMxknP4ywXnhLZN
> q2169haoG0p1g0D11q2H9B4Vk++PUil7VLgzOfAOcLQ9YpFDkXIdxy5FRaRkx8K4
> lcPfmzFha8OkdBpsXPJdhtY5pmzOEf+ziprDlyD7eCkE1xAkRNhjsNtEz9CTXeLh
> l46/tUCZTx+aX9ABW0m13Ache8jGN36+TvsRzRKfzqaMJ0z/wEOeESooPFYHnl0=
> =FxxJ
> -----END PGP SIGNATURE-----
>
>
>

[-- Attachment #2: Type: text/html, Size: 3554 bytes --]

  parent reply	other threads:[~2010-05-31 12:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-30 14:59 [gentoo-dev] showing file diffs as root Christopher Harvey
2010-05-30 15:21 ` Domen Kožar
2010-05-30 15:27   ` Christopher Harvey
2010-05-30 15:34     ` Domen Kožar
2010-05-30 16:08     ` Michał Górny
2010-05-30 20:34 ` Sebastian Pipping
2010-05-31 12:21 ` Francesco R [this message]
2010-05-31 12:57 ` Gilles Dartiguelongue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTileUGq2ODN_NFMw-iqhxvOXnSnYEGukzNYmjVAz@mail.gmail.com \
    --to=vivo75@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox