Hi Roland,

On Wed, Aug 07, 2024 at 09:00:47AM +0200, Roland Clobus wrote:
> There is another bit of information that I didn't share yet: these
> diversions are only temporary. The diversions are made during the
> construction of the live image (when other packages are installed and the
> packages that have diversions will not upgrade), and reverted before the
> image is finalised. They are not present inside the live images. They 'only'
> serve the purpose of saving time by performing a no-op during the
> construction of the live image.

As far as I understand the code, your construction applies to multiple
releases at the same time and for each release I would agree that you
only need one diversion. The need for duplicating the diversions arises
from different releases requiring different diversions. In principle,
you could also carry forward a variable say USR_MOVED that you set to ""
for bookworm and earlier and to "/usr" for trixie and later and then
prepend this to your diversions.

If you were to use the /usr-moved
diversions on a bookworm or earlier tree, they have the same effect as
doing nothing. In particular, you are expecting the relevant file to be
renamed (via --rename). So your diversion would apparently work, but it
would not actually move the diverted file out of place. Then you
overwrite the diverted file and when you remove the diversion you expect
to get back the original file, but instead you keep your temporary
changes.

I note that if live-build in forky also wants to support bookworm, the
"begin-remove-after: trixie" I used in my patch should be bumped to
"begin-remove-after: forky". The main benefit I see in my approach is
that it becomes simpler to eventually remove this compatibility code as
it is clearly identified when to remove what code in a machine-readable
way and the Debian janitor will be able to create merge requests
cleaning up this code. That said, you may prefer another implementation
and that's fine.

> Ah, I (erroneously) thought that the whole purpose of moving the files to
> /usr was to (eventually) get rid of the symlinks (in forky+N).

It is difficult to strike a good balance on how much detail we give. Too
much text and people stop reading. Too little and misunderstandings
happen. The fundamental reason for the moves is that we experienced bugs
(file loss) as a result of exercising undefined behaviour in dpkg and in
moving files from / to /usr (in data.tar of binary .debs), we operate
dpkg within its specification again reducing the risk of unexpected file
loss. As mentioned in my previous reply, the referencing of files
remains unaffected - except when the references apply to the dpkg
database as diversions do.

Hope this clarifies. Thanks for bearing with this transition.

Helmut

Reply via email to