Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 497656 - sys-apps/portage: etc-update should fall back to app-misc/editor-wrapper when user has not set $EDITOR
Summary: sys-apps/portage: etc-update should fall back to app-misc/editor-wrapper when...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core - External Interaction (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-10 01:55 UTC by Arthur D.
Modified: 2022-10-20 02:43 UTC (History)
1 user (show)

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


Attachments
Proposed patch to fix the problem (etc-update.patch,304 bytes, patch)
2014-01-10 01:55 UTC, Arthur D.
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arthur D. 2014-01-10 01:55:54 UTC
Created attachment 367534 [details, diff]
Proposed patch to fix the problem

I recently ran "sudo etc-update" and found this bug.

Example output:
...
1) Replace /etc/conf.d/splash with merged file
2) Show differences between merged file and original
3) Remerge original with update
4) Edit merged file
5) Return to the previous menu
Please select from the menu above (-1 to exit, losing this merge): 4
/usr/sbin/etc-update: line 506: nano: command not found
...

I uninstalled nano few years ago and this package (sys-apps/portage) doesn't have nano in its dependencies. I suggest relying on /usr/libexec/editor instead of nano.
Comment 1 Alex Xu (Hello71) 2014-01-10 03:40:18 UTC
etc-update uses whatever is set as $EDITOR or $VISUAL. sudo clears these by default.

consider "Defaults env_keep += EDITOR" or some other solution in /etc/sudoers.
Comment 2 Alec Warner (RETIRED) archtester gentoo-dev Security 2014-01-10 04:00:47 UTC
(In reply to Alex Xu (Hello71) from comment #1)
> etc-update uses whatever is set as $EDITOR or $VISUAL. sudo clears these by
> default.
> 
> consider "Defaults env_keep += EDITOR" or some other solution in
> /etc/sudoers.

Regardless, the patch looks fine?

-A
Comment 3 Alex Xu (Hello71) 2014-01-10 12:56:37 UTC
(In reply to Alec Warner from comment #2)
> (In reply to Alex Xu (Hello71) from comment #1)
> > etc-update uses whatever is set as $EDITOR or $VISUAL. sudo clears these by
> > default.
> > 
> > consider "Defaults env_keep += EDITOR" or some other solution in
> > /etc/sudoers.
> 
> Regardless, the patch looks fine?
> 
> -A

No objections.
Comment 4 SpanKY gentoo-dev 2014-01-10 17:04:01 UTC
(In reply to Alec Warner from comment #2)

it is not.  it doesn't support EPREFIX.
Comment 5 Fabian Groffen gentoo-dev 2014-01-11 09:24:16 UTC
(at least in prefix branch)

portage_vars are retrieved through portageq, and EROOT is already in there, so we could just add EPREFIX, and use that I suppose.