Gerrit Pape wrote:

> You know, I know how to do it.

Okay, I did some digging in the archives.  Sorry to those who
already went over this all.

  debian-package-dash-getv...@list.smarden.org
  debian-package-dash-getv...@list.smarden.org
  debian-package-dash-getv...@list.smarden.org

In April, Gerrit Pape wrote:

>                                            I was hoping there're other
> contributors appearing, so I can learn from their questions, and jump in
> when time permits.

Makes sense.

Previous proposals
~~~~~~~~~~~~~~~~~~
Thorsten's proposal [quoted in 13]:

    Concurrent upload of all shells, with Breaks: old versions of
    other shells.

    Shared debconf template and scripts to turn it into reality.

    The shared template would have permitted values: 'unchanged'
    'dash' 'bash' 'mksh' 'ksh93' 'posh'.

    Upgrade code works like this: drop all diversions.  Update
    symlink.  Add diversion if some package wants to ship /bin/sh.

Sounds good, but it does not address how bash can lose /bin/sh
without causing breakage during the upgrade.

Raphael's proposal [13]:

    bash loses /bin/sh!  Like so:

     - dash's preinst is rewritten in C, so it does not require
       /bin/sh initially.
     - bash's postinst removes any diversion from dash, if present,
       taking care to preserve /bin/sh.
     - dash's preinst still adds a diversion, to make room for its
       /bin/sh.
     - bash pre-depends on this version of dash.
     - Any shell except dash that wants to divert /bin/sh has to
       predepend on this bash version; doing so makes everything okay.
     - Any shell that wants to divert /bin/sh, including bash, does
       so with a debconf prompt after it is installed.

Presumably the idea is that before bash is updated, its /bin/sh is
always diverted, so the removal of bash's copy of /bin/sh causes
no harm.

I don't see why dash's preinst urgently has to be rewritten in C
(though I don't disagree that it's a good thing to do); if /bin/bash
is missing, aren't we in deep trouble anyway?

Where to go from here
~~~~~~~~~~~~~~~~~~~~~
Based on the above, a possible order of operations:

  I. Get rid of /bin/sh in bash.

     Preinst:
       1. Ensures some _other_ package (e.g., dash) diverts /bin/sh.
       2. Makes sure /bin/sh points to the same place at the
          beginning and end.
     Files list: removes /bin/sh

     The result is that /bin/sh is unchanged and that (if anything
     does) dash nominally provides /bin/sh.  The next time dash is
     unpacked, it would overwrite /bin/sh.

 II. Teach dash to cope with (I).

     Precondition: /bin/sh exists.

     Preinst:
       1. Reads /bin/sh to determine who should provide it.
       2. Set up the corresponding diversion.
     Files list: /bin/sh -> dash

     Rationale: Resetting the /bin/sh diversion before unpacking
     dash prevents the problem described in (I).

III. Teach bash to avoid the problem with (I).

     Pre-Depends: dash (>= the version from (II))

Thoughts?  Questions?  Advice?

Thanks,
Jonathan

A somewhat orthogonal task
~~~~~~~~~~~~~~~~~~~~~~~~~~
IV. Introduce a new package to take responsibility for the /bin/sh symlink.

    Preinst (not necessarily in this order):
      1. Removes all diversions
      2. Sets up a diversion
      3. Makes sure /bin/sh points to the same place at the
         beginning and end.
    Debconf prompt lets a person choose what shell to use.
    Postinst makes sure /bin/sh points to the configured place.

    It is be hard to get this right while avoiding file conflicts
    until only one package provides /bin/sh, but it should be possible
    to experiment on lenny.

 V. Teach shells to rely on the package from (IV) for configuration.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to