Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 497656

Summary: sys-apps/portage: etc-update should fall back to app-misc/editor-wrapper when user has not set $EDITOR
Product: Portage Development Reporter: Arthur D. <spinal.by>
Component: Core - External InteractionAssignee: Portage team <dev-portage>
Status: UNCONFIRMED ---    
Severity: normal CC: alex_y_xu
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Proposed patch to fix the problem

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.