Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409849 - etc-update does not work with Emacs
Summary: etc-update does not work with Emacs
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - Configuration (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-27 11:12 UTC by Clemens Kaposi
Modified: 2017-08-11 21:09 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Clemens Kaposi 2012-03-27 11:12:11 UTC
`etc-update` does not work any longer with the `diff_command` for Emacs:

    diff_command="eval emacs -nw …"

This was presumably introduced with commit 2bf62e023956a4ed1adf67d18152aa82b7aa7356 where the sanity check for `$diff_command` was changed (lines 680–681):

    -       if ! type ${diff_command%% *} >/dev/null; then
    -               die "'${diff_command}' does not seem to work, aborting" 1
    +       if ! cmd_var_is_valid "${diff_command}" ; then
    +               die "'${diff_command}' does not seem to work, aborting"

`cmd_var_is_valid` calls `type -P` to determine whether the given `diff_command` points to an executable, which is unsuccessful for the bash-builtin `eval`.
Comment 2 SpanKY gentoo-dev 2012-03-27 18:27:53 UTC
why exactly do you need `eval` ?  what you showed does not require evaling, and general diff_command expansion doesn't either.
Comment 3 Zac Medico gentoo-dev 2012-03-27 18:41:12 UTC
I assume that he got the eval from the the example in etc-update.conf, by I have no idea why or if it's necessary.
Comment 4 Zac Medico gentoo-dev 2012-03-28 01:18:11 UTC
This is fixed in 2.1.10.52 and 2.2.0_alpha96.
Comment 5 Clemens Kaposi 2012-03-28 05:42:27 UTC
Yes, I’ve got the `eval` from the `etc-update.conf` example.  I have never bothered to mess around with it since it just worked.
Comment 6 SpanKY gentoo-dev 2012-03-28 15:53:36 UTC
well, i'd like to move past this.  how about:
 - drop the eval from the config file
 - update etc-update to warn+ignore a single "eval" leading keyword

i can't think of any cases where the eval is necessary
Comment 7 Zac Medico gentoo-dev 2012-03-28 17:04:56 UTC
While we're at it, we should probably also look fixing the diff_command usage inside do_distconf. I suspect that it may not work correctly with using_editor=1, since emacs doesn't behave like a normal diff command.
Comment 8 Ulrich Müller gentoo-dev 2012-08-20 08:12:25 UTC
The command line in the etc-update.conf example is:
   diff_command="eval emacs -nw --eval=\'\(ediff\ \"%file1\"\ \"%file2\"\)\'"
and it does not work:

What should be passed as arguments to emacs is the following (for clarity, no shell quoting and each argument on its own line):

   -nw
   --eval
   (ediff "foo" "bar")

What gets passed instead is:

   -nw
   --eval='(ediff foo bar)'

Not the spurious single quotes and the missing double quotes around the filenames. (The = sign doesn't really matter, although the examples in Emacs' documentation don't have it.)

etc-update will work after changing the diff_command to:

   diff_command="eval emacs -nw --eval \\(ediff\\ \\\"%file1\\\"\\ \\\"%file2\\\"\\)"

However, this is somewhat ugly. I haven't found a solution without "eval".