Re: Bug#13287: less uses /usr/bin/editor without it necessarily being there.
-----BEGIN PGP SIGNED MESSAGE-----
Christian Schwarz, in an immanent manifestation of deity, wrote:
>This discussion is getting too complicated for me :-) I don't know if
>things are clear now, or not. So let me try to summarize.
Sounds good.
>1. The policy manual 2.3.0.0 contains a section `4.3 Editors and pagers'
>which should explain everything.
Well, yes, but I've run into a snag in the very clear instructions. If
someone installs less and they don't have envar EDITOR set, they will be
told '/usr/bin/editor: command not found' or something similar. This is
not clean behaviour. Users will look for an "editor" package,
especially since none of the editors provide /usr/bin/editor yet. There
is nothing in the dependencies of less that prevents this from
happening, hence this bug.
> Since the check for the env vars EDITOR/PAGER can be hard to implement
>in some upstream sources, the /usr/bin/sensible-{editor,pager} scripts
>have been created. They check for the env vars themselves and fall back to
>/usr/bin/{editor,pager}. Thus, you can specify
>/usr/bin/sensible-{editor,pager} as editor/pager in your program and the
>user always gets a good editor/pager.
But this isn't what the policy says. It says:
>4.3, 3rd P
>Thus, every program that launches an editor or pager has to use the
>EDITOR or PAGER environment variables to determine the editor/pager the
>user wants to get started. If these variables are not set, the programs
>`/usr/bin/editor' and `/usr/bin/pager' have to be used, respectively.
>3. Each application launching an editor or pager has to be fixed to check
>the env vars and fall back to /usr/bin/{editor,pager} _or_ use
>/usr/bin/sensible-*.
That's not what I read the policy manual to say. If there was a
sentence added to the paragraph above that said:
"/usr/bin/sensible-{editor,pager} may be used as well if the developer
(packager?) wishes."
Since it's not hard at all for less to use envar EDITOR (it comes that
way), I can't use /usr/bin/sensible-editor. Maybe I'm being too
nitpicky.
/usr/bin/sensible-editor works better since if envar EDITOR isn't set
and /usr/bin/editor hasn't been set with update-alternatives,
sensible-editor then tries ae(1) and vi(1). If neither of -those- work,
it then says "Couldn't find an editor!\n" "Set the $EDITOR environment
variable to your desired editor."
This is an acceptable error message.
Darren
- --
<torin@daft.com> <http://www.daft.com/~torin> <torin@debian.org> <torin@io.com>
Darren Stalder/2608 Second Ave, @282/Seattle, WA 98121-1212/USA/+1-800-921-4996
@ Sysadmin, webweaver, postmaster for hire. C/Perl/CGI programmer and tutor. @
@ Make a little hot-tub in your soul. @
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3
Charset: noconv
Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
iQCVAwUBNDNT2Y4wrq++1Ls5AQHQ+gQAoHCSPfzrZXqzsxcIsK/NZCU6O2HRjGGm
YNguU4Arpsv8Mj6oCISi0ioLBeurkS+5Bb8+lIKC5Rt+J7zQy2JMFvMZSTwDLrNy
XCozoHBdSSgJdMxKfvuFtvaOtHNFXVckUVvGhtxQbIycTUa8LxeivYynMKMY6+0x
y2tDh5JqsAk=
=VtWZ
-----END PGP SIGNATURE-----
Reply to: