[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#682347: resurrect editor virtual package name



Hi!

On Thu, Apr 01, 2021 at 01:59:11PM -0700, Russ Allbery wrote:
> Russ Allbery <rra@debian.org> writes:
> 
> > 2. Document editor and recommend everyone implement it properly.  Since
> >    we're going to allow packages to depend on editor, I think providing
> >    it would need to be a should, so that's going to be a lot of buggy
> >    (but not RC-buggy) editor packages.  But it would get us to a clean
> >    dependency system.  (I will leave it to someone else to tackle this
> >    for pager if someone really wants to.)
> 
> When I let the ball drop on this three years ago, there was a consensus
> that this option was the way to go.  Picking this up again, here is a
> proposed Policy change to document the editor and default-editor virtual
> packages.

I also agree that this is the way to go.

> Note that this would make quite a few packages buggy (but not RC-buggy)
> since they don't Provide: editor although they participate in the
> /usr/bin/editor alternative.  This was considered reasonable since it
> would be cleaning up the dependency structure and the bug is fairly minor
> and can be dealt with when those maintainers have a chance.

I'm not completely clear on the specific Policy nuances of some words.
Is your choice to use "should" instead of "must" when talking about
dependencies exactly to avoid creating RC bugs, or is it there any other
reason for using such weak language?

If it's the former, then fine, but I'd like to already consider turning
a few of them as "must" some years down the road, as leaving this as a
"should" will not change much from the status quo: i.e. things still
won't be able to assume that the system is in a status as described by
Policy.

Inline the "should"s that I believe should be "must"s.

> diff --git a/policy/ch-customized-programs.rst b/policy/ch-customized-programs.rst
> index 747df56..27abebd 100644
> --- a/policy/ch-customized-programs.rst
> +++ b/policy/ch-customized-programs.rst
> @@ -93,21 +93,30 @@ alternative should have a slave alternative for
>  ``/usr/share/man/man1/pager.1.gz`` pointing to the corresponding manual
>  page.
>  
> -If it is very hard to adapt a program to make use of the EDITOR or PAGER
> -variables, that program may be configured to use
> -``/usr/bin/sensible-editor`` and ``/usr/bin/sensible-pager`` as the
> -editor or pager program respectively. These are two scripts provided in
> -the sensible-utils package that check the EDITOR and PAGER variables and
> +Packages that register as an alternative for ``/usr/bin/editor`` should
                                                                    ↑↑↑↑↑↑
> +also provide the virtual package ``editor`` by including it in the
> +``Provides`` control field. The package providing the current default
> +editor for the Debian base system, and only that package, should also
                                                             ↑↑↑↑↑↑

(incidentally, what's the procedure to decide on what is the "default
editor"?)

> +provide the ``default-editor`` virtual package. Packages that call
> +``editor`` directly (not via ``sensible-editor`` or the EDITOR environment
> +variable) should depend on ``default-editor | editor``.
             ↑↑↑↑↑↑
> +
> +Programs may assume that ``/usr/bin/pager`` is available as a fallback
> +without adding an explicit package dependency. There is no ``pager``
> +virtual package.
> +
> +If it is difficult to adapt a program to use the EDITOR or PAGER
> +variables, that program may instead be configured to use
> +``/usr/bin/sensible-editor`` and ``/usr/bin/sensible-pager`` as the editor
> +or pager program respectively. These are scripts provided by the
> +``sensible-utils`` package that check the EDITOR and PAGER variables and
>  launch the appropriate program, and fall back to ``/usr/bin/editor`` and
> -``/usr/bin/pager`` if the variable is not set.
> +``/usr/bin/pager`` if the variable is not set. Packages using these
> +scripts should declare an appropriate dependency on ``sensible-utils``.
           ↑↑↑↑↑↑
(really, sensible-utils has been around for ages already.  I also seem
to remember some kind of MBF to add missing dependencies.  Aren't we
ready to make this a "must" already?)
>  
>  A program may also use the VISUAL environment variable to determine the
>  user's choice of editor. If it exists, it should take precedence over
> -EDITOR. This is in fact what ``/usr/bin/sensible-editor`` does.
> -
> -It is not required for a package to depend on ``editor`` and ``pager``,
> -nor is it required for a package to provide such virtual
> -packages. [#]_
> +EDITOR. This is also what ``/usr/bin/sensible-editor`` does.
>  
>  .. _s-web-appl:
>  
> @@ -573,10 +582,6 @@ installed in ``/usr/share/man/man6``.
>     portion is handled internally by the package system based on the os
>     and cpu.
>  
> -.. [#]
> -   The Debian base system already provides an editor and a pager
> -   program.
> -

Can't this note be attached to "Programs may assume that
``/usr/bin/pager`` is available" above, to make clear that the base
already has a `pager`?  (which is… `more`, right?  what can we do to
change that again? :P)

>  .. [#]
>     If it is not possible to establish both locks, the system shouldn't
>     wait for the second lock to be established, but remove the first
> diff --git a/virtual-package-names-list.yaml b/virtual-package-names-list.yaml
> index 2a9857a..6c0b59e 100644
> --- a/virtual-package-names-list.yaml
> +++ b/virtual-package-names-list.yaml
> @@ -100,6 +100,14 @@ virtualPackages:
>  
>  # System
>  
> + - name: default-editor
> +   description: default base system /usr/bin/editor
> +   alternatives:
> +     - /usr/bin/editor
> + - name: editor
> +   description: suitable /usr/bin/editor
> +   alternatives:
> +     - /usr/bin/editor
>   - name: flexmem
>     description: anything that can access flexible memory via the OBEX Protocol
>   - name: foomatic-data
> @@ -457,3 +465,7 @@ virtualPackages:
>  #               Added default-dbus-session-bus
>  #   15 Feb 2019 Added logind
>  #               Added default-logind
> +#
> +# Russ Allbery:
> +#   01 Apr 2021 Added editor
> +#               Added default-editor


-- 
regards,
                        Mattia Rizzolo

GPG Key: 66AE 2B4A FCCF 3F52 DA18  4D18 4B04 3FCD B944 4540      .''`.
More about me:  https://mapreri.org                             : :'  :
Launchpad user: https://launchpad.net/~mapreri                  `. `'`
Debian QA page: https://qa.debian.org/developer.php?login=mattia  `-

Attachment: signature.asc
Description: PGP signature


Reply to: