This program is used for detecting patches that do not apply cleanly to source and attempting to apply them, taking into account changes in the patch context and lines being added/removed by the patch.
As part of the background research, a collection of patches of the Linux Kernel was examined. For patches that did not apply cleanly, the reason for the failure was documented in a Kernel Patch Classification Spreadsheet, with a Kernel Patch Classification Write up
- Run
make build
. This will create a python virtualenv environment so that the packages we need don't pollute the system wide python namespace. Within the virtualenv, it'll download the needed packages.
In order to run the patch script, you need to:
-
Initialize the virtualenv created during the build
. ./env/bin/activate
-
Change into the directory of the source that you want to run the patch script against.
-
Run the script
scripts/patch_appy/apply.py <name of patch file>
The script can be run with the
--help
command line option to show other available options.
-
Initialize the virtualenv created during the build
. ./env/bin/activate
-
Run the script you want:
./tests/test_basic.py
Alternatively, all tests can be run by using pytest
and coverage data can be generated as well by using pytest --cov=scripts
. Note that you need to install the pytest-cov module in order for coverage data to work.