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

Re: /bin/sh (was Re: jessie release goals)



On Sat, May 11, 2013 at 05:29:45PM +0200, Sven Joachim wrote:
> On 2013-05-11 11:22 +0200, Goswin von Brederlow wrote:
> 
> > While that might be of some interest the real goal of the change was
> > to be able to have more than *2* packages provide /bin/sh.
> >
> > Currently, due to the totaly screwed up way this is done, only dash or
> > bash can be /bin/sh.
> 
> I think that dash could probably stop diverting /bin/sh, now that bash
> no longer ships it (as of version 4.2-1).  That would make it possible
> to locally divert /bin/sh for those who want it (#538822, #540512).
> 
> > Double that for multiarch on amd64/i386 because there is bash:i386 and
> > bash:amd64 that both work just fine as /bin/sh. Trying to install a
> > foreign bash or dash fails horribly though with the current diversion
> > hack.
> 
> Huh? No it doesn't, dpkg handles this just fine (apt doesn't because it
> does not support crossgrades, but that is another story).  Make sure you
> have dpkg >= 1.16.2, though.

When I checked that last the mainatienr scripts would fail horribly
because you can't have a thrid package doing a diversion. Dpkg never
was a problem in itself.
 
> > Proposed solution:
> >
> > - New virtual package system-shell with something essential
> >   depending on it (base-files?)
> 
> Would probably need pre-depends so that system-shell cannot be removed
> temporarily (similar situation as with awk).

Yes, verry similar. I actualy would like the same solution for awk to
fix the problem that during bootstrap there is no awk link.
 
> > - bash, dash pre-depend on system-shell for the transition
> >
> > - new packages system-shell-<name>
> >   Provides, Replaces, Conflicts: system-shell
> >   contains /bin/sh -> /bin/<name> symlink
> >
> > None of system-shell-* would be essential but through the dependency
> > of something essential at least one would always be installed
> > (pseudo-essential). One of them (system-shell-dash) should have a
> > higher priority than the rest to be singled out as the default and
> > the essential package would depend system-shell-dash | system-shell.
> >
> > Choosing /bin/sh is then simply done by installing the right package
> > and dpkg does the change atomically.
> 
> Only if the packages declare Conflicts/Replaces on every real provider
> of system-shell, and with apt you lose outright because it insists on
> removing the conflicting package(s) first.

We worked out the system during the second last Debconf, so nearly two
years ago. I would have to look up my notes at home but that wasn't a
problem. The virtual package works just fine as placeholder for all
real packages since they all provide it.

And about the "removing the conflicting package(s) first" I'm not sure
if that wasn't an issue because system-shell is a virtual package or
if the solution was to use Break/Replaces. But it worked in the right
order with a set of dummy packages we made to test the solution.

> > No messing around in
> > pre/postinst/rm scripts or race conditions where the link might
> > disapear for a while. No artificial limit on how many system-shell-*
> > packages there could be. 
> 
> I'm afraid your plan as outlined is not going to work.
> 
> Cheers,
>        Sven

This was just a loose summary of the general idea from memory. I might
not have expressed all the finer details (correctly) but the solution
we came up with worked. The details also include a bunch of tricky
hacks to reassign the diversion during the initial upgrade so that at
no time the /bin/sh link disapears. That was actualy the hardest part
to figure out.

MfG
	Goswin


Reply to: