doc:hacks: add a way to patch crates using quilt in build dir

This commit is contained in:
Blair Noctis 2023-01-28 23:30:10 +08:00
parent 22726a7a9b
commit 72463ab8ef
No known key found for this signature in database
GPG Key ID: 2C89AF5FFD1C767C

View File

@ -27,6 +27,23 @@ Since the source is pulled from crates.io and not from github/lab, patching requ
2) `wget http://crates.io/api/v1/crates/foocrate/version/download -O foocrate-version.tar.gz`
Then follow 1.1)
Alternatively you can do it directly in the build directory with
[quilt](https://wiki.debian.org/UsingQuilt):
1. In the root directory of `debcargo-conf`, `cd build/foo`
2. `quilt series` to check existing patches, `quilt push -a` to test apply all
of them, and `quilt pop -a` to unapply them
3. `quilt new patch-name.patch` to create a new patch, `quilt edit
path/to/file` to edit a file with changes saved in current patch, `quilt
header -e --dep3` to add a DEP-3 patch header
4. `quilt refresh` to update current patch and prevent fuzz (we don't allow
fuzzes when building)
5. `cp -r debian/patches ../../src/foo/debian/` to copy updated patches over
6. In root directory, run `./update.sh foo` to update the build directory
Note that `update.sh` deletes and re-creates `build/foo`, so an open terminal
in it needs to go up and down into the new directory.
capitol did a nice writeup which can be read here:
https://blog.hackeriet.no/packaging-rust-part-II/