Repository navigation
Apply patches: to packages built from a git source - #148
Conversation
|
Thanks, the staging order is the right fix. However, there is one problem on a reused checkout: git checkout -f doesn’t remove untracked files, so a patch that creates a file gets “Assuming -R” from patch --batch on the next build. The file is deleted, exit status 0, and on the build after that it is back. A file added by a patch later dropped from the recipe also lingers. Running clean -fdxq after the checkout, instead of deleting the two sentinels, fixes both. It should go through an scm method so Sapling checkouts work too. |
|
Thank you for the review. I’ve updated the code as suggested: on a reused checkout, |
|
Two things to settle before merge.
|
|
(a) The unconditional clean is on purpose, since a reused checkout should be the same as a fresh clone, because that’s what a first build of the package gets. This also covers the scenario when a recipe drops its patches. The files those patches created are removed too, not only their changes to existing files. I also added a comment line explaining this.
Also, none of the lcg.bits recipes write into $SOURCEDIR. I ran lint-out-of-source.sh from bits-recipe-tools on all lcg.bits recipes and it reports no recipe that builds from or writes to SOURCES. So for lcg.bits, the clean only removes bits’ own leftover files: the .patch files, .bits_patched and files from old patches. (b) Yes, I checked and |
|
Thanks, merged. |
patches:are not used for packages built from a gitsource:. Since a recipe can get its source in two ways: a tarball (sources:) or a git repository (source: + tag:), this feature can be used if a package needs a fix on top of an upstream version and is building from git. Examples:Without this change, the only workarounds are to find or create a tarball, or to apply the patch by hand in the recipe body.
Changes:
Reproducer (builds a test package from a git source with one patch to a txt file):