Peter Green writes ("Bug#1024233: dgit: can't repack libreoffice"):
> Package: dgit
> Version: 10.1
> 
> commands (run in an empty directory)

Thanks.

I have diagnosed this and I think I can fix it.  It's nontrivial and I
want to write my findings down somewhere.  I think here will do.


dpkg-souerce "3.0 (quilt)" has the following feature which I found
surprising, despite (I think) having RTFM at some point in the past.

The .debian.tar.gz can contain arbitrary files outside debian/.  These
are simply overlaid on top of whatever the .origs produced.  These
changes are therefore not represented in debian/patches/.  This
mechanism cannot be used to delete files, only add/modify them.

Ordinarily dpkg-source won't produce a .debian.tar.gz like this.
However, if you create debian/source/include-binaries
then the files named there will be treated in this way: they will
simply be included in the .debian tarball.

In principle I think files like this could then be further modified by
debian/patches.  I don't know if it is possible to get dpkg-source to
do that, but I'm going to assume it can.


For dgit's purposes, I think it is right to treat these files as
somehow "part of the origs".  The parts of dgit that do nontrivial
source package manipulation are mostly trying cope with "3.0 (quilt)"
and its patch queues.  The changes made by "include-binaries" don't
appear in patch queues.

The reason for the symptoms reported in this bug is that dgit needs to
know what tree "the origs plus the current patches" is, so that it can
do quilt fixup.  For this purpose it creates a synthetic .dsc
referring to the .origs that are actually present, and containing the
existing patches, but without any of the local tree changes, and gets
gbp pq or dpkg-source to apply the patches.

dgit's fake dsc didn't contain the "include-binaries" option, nor the
files referred to.  So its idea of the "orig" was wrong.  Emprically,
including them in the fake dsc's .debian.tar.gz fixes this bug.


I haven't yet thought through all the other implications.  Tomorrow,
if I don't wake up realising that all of this is wrong, I will have a
go at writing some test cases.

(It is obvious that git-debrebase won't DTRT on packages which try to
use this feature, but the usual safety catches will prevent broken
packages escaping, and I think a gdr user who does this deserves to
keep all the pieces.  This is different to dgit, which is supposed to
be able to work on *any* source package accepted by Debian no matter
how insane.)


PS, some notes about this bug and its repro:

The provided repro involves libreoffice_7.4.2-3.dsc.

The origs for that are no longer available from the archive, only from
snapshot.d.o.  My attempts to download them from snapshot were
obviously not going to complete today, or even this week.

Luckily (?!), the current version in sid, libreoffice_7.4.3-2, is also
afflicted, so I was repro the problem in finite (merely
inconvenient[1]) time.


Ian.

[1] I ran out of disk space, and my stupendously fast nvme-based
ultrabook takes tens of seconds (or worse) to do anything with this
tree.  I pity anyone who has to work on this thing frequently!

-- 
Ian Jackson <ijack...@chiark.greenend.org.uk>   These opinions are my own.  

Pronouns: they/he.  If I emailed you from @fyvzl.net or @evade.org.uk,
that is a private address which bypasses my fierce spamfilter.

Reply via email to