#956925 dpkg: dpkg-source: should fail before-build if patches can't be applied fully in v3-quilt

Package:
dpkg
Source:
dpkg
Description:
Debian package management system
Submitter:
Jiri Palecek
Date:
2025-03-20 16:00:02 UTC
Severity:
normal
Tags:
#956925#5
Date:
2020-04-16 19:31:21 UTC
From:
To:
Dear Maintainer,

while building some of my packages, I noticed they were built without
patches applied. Further investigation in the code showed that it was
caused by dpkg-source --before-build carrying on silently if the first
patch could't be applied, eg. when the series was partially applied, or
the patch itself was somehow defective. It seems this behaviour was a
legacy from package format 2 and IMHO is totally unneeded with quilt. I
therefore suggest to apply this patch, which I've used for several
months now without problems. It relegates the issue of deciding when to
apply patches to quilt.

Regards
    Jiri Palecek

#956925#12
Date:
2020-04-19 21:30:56 UTC
From:
To:
Control: ressign -1 libdpkg-perl
Control: merge 950142 -1

Unfortunately that's not possible, as people expect to be able to
build packages w/o having used quilt to apply them, for example when
they store a source with patches applied in a VCS.

Thanks,
Guillem

#956925#17
Date:
2020-04-20 20:39:14 UTC
From:
To:
Hi,

Without a .pc directory, I see. But then it could be special cased based
on the existence of the .pc directory - if it doesn't exist, try the
first patch, if it does, use quilt metadata, right?


Regards

     Jiri Palecek

#956925#22
Date:
2020-05-10 23:40:42 UTC
From:
To:
Hello,

OK. I have thought about those other workflows and it should be possible
to support it while maintaining a sane function for people using quilt.
My assumption is that when you have the whole tree in git and do not
store .pc, as is discussed in bug 680155, dpkg should not apply the
patches, therefore never create the .pc directory. This can be used to
distinguish these users to users with .pc metadata tracking applied
patches. Of course the first patch heuristic is imprecise (as 680155
shows), but it's been good enough till now so we can go along with that.

The attached patch just checks that the .pc directory exists and if it
doesn't, applies the heuristic. If it exist, I assume the info in the
.pc directory should be good enough to get applied patches list from.
The patch contains a test that checks if it works under both scenarios
(you need to have quilt installed to test it fully).

Please have a look at it. I have another patch that would make workflow
with quilt a lot easier, this one is merely about not building crippled
packages.

Regards

     Jiri Palecek

#956925#39
Date:
2025-03-20 15:47:39 UTC
From:
To:
Hello,

Is there going to be any .pc directory when you (or buildd) build the
package from scratch for the first time? I suspect not, so there's still
the possiblity that patches will be silently skipped whenever the first
one no longer applies cleanly (such as when you update to a new upstream
version).

Or am I missing something?