Jonathan Nieder wrote:
> Adam D. Barratt wrote:

>> * the preinst isn't idempotent
>> - from a few quick tests, it looks like this could be resolved by changing
>> the execution order to "cp, ln, divert" rather than "divert, cp, ln"; I
>> may have missed something, however
>
> Technically one would need
> 
>       # nothing except dash prerm seems to care about the .distrib
>       # file, so this is relatively safe.
>       cp -dp $dfile $distrib
> 
>       # ln -sf is not idempotent, though ln -s to temporary + mv is.
>       ln -sf $ltarget $tmpfile
>       mv -f $tmpfile $dfile
> 
>       dpkg-divert --package dash --divert $distrib --add $dfile
> 
> The window when this can happen is very short, and the failure modes
> are not so bad (except if ln -sf is interrupted in the middle.  That
> one would mean no /bin/sh).

To be precise, of course "ln -sf dash /bin/sh" is idempotent; it's just that
it's not safe to interrupt it because it works by calling unlink() followed
by symlink().  Sorry for the lack of clarify.



-- 
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