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

Re: Merging three direcories in postinst

Joachim Breitner writes ("Re: Merging three direcories in postinst"):
> I am a bit worried about getting the removal part right, and of course
> there are so many possible failures.

It is somewhat tricky, yes.  The best thing to do is to try to write
idempotent scripts that always move "bad" states to "better" ones.
And get review :-).

> Maybe it is cleaner to just dpkg-divert the .haddock files to the
> location in /usr/lib/haddock? I thought I need to access them in the old
> locations as well, but the path mentioned is in an arch:any, so it will
> be correct (/usr/lib/haddock) after the obligatory round of binNMUs when
> the next ghc version is installed.

No, I would strongly recommend against attempting to do this with
dpkg-divert.  The results will be very unpleasant and the number of
semi-broken corner cases will be enormous.

> But since dpkg-divert cannot divert directories, I?d either have to
> collect the full list of broken files from the Contents files and
> hard-code them, or do it via a trigger, which also seems to be overkill
> for a work-around.

I don't think you need a trigger for this.  The code you write should
be fast and can run in the single core package postinst.

> I guess I?ll give the postinst-symlink-approach a shot.

Do come back when you have more final-looking code and I'll see if I
can find bugs in it :-).


Reply to: