With an Unpacked Source Package You have run
apt source pyrit
and you have a
pyrit-0.
4.0
directory. You can apply your patch directly with
patch -p1 < patch-file :
$ apt source pyrit [...]
$ cd pyrit-0.4.0 $ wget https://github.com/JPaulMora/Pyrit/commit/14 å
ec997174b8e8fd20d22b6a97c57e19633f12a0.patch -O /tmp/pyrit-patch [...]
$ patch -p1
patching file cpyrit/pckttools.py
Hunk #1 succeeded at 53 (offset -1 lines).
$ dch --local buxy ”Apply patch to work with scapy 2.3” At this point, you have manually patched the source code and you can already build binary pack-
ages of your modified version (see section
9.1.4
, “
Starting the Build
” [page 236]). But if you
try to build an updated source package, it will fail, complaining about “unexpected upstream
changes.” This is because pyrit (like a majority of the source packages) uses the source format (see
debian/source/format
file) known as 3.0 (quilt), where changes to the upstream code must be
recorded in separate patches stored in
debian/patches/
and where the
debian/patches/series
file indicates the order in which patches must be applied. You can register your changes in a new
patch by running
dpkg-source --commit
:
$ dpkg-source --commit dpkg-source: info: local changes detected, the modified files are:
pyrit-0.4.0/cpyrit/pckttools.py
Enter the desired patch name: fix-for-scapy-2.3.patch 233
Chapter 9 — Advanced Usage
dpkg-source: info: local changes have been recorded in a new patch: pyrit-0.4.0/debian/
å
patches/fix-for-scapy-2.3.patch
$ tail -n 1 debian/patches/series fix-for-scapy-2.3.patch