Patch software projects¶
Under some circumstances it is necessary to modify software projects, e.g. to enable cross compilation.
It is possible to store these alterations in an reproducible manner by creating patch files. By doing this changes can be sent and applied by others.
Create patches¶
Download software project
Craft two copies, e.g.
sw-project-1.0.0
sw-project
Perform alterations in
sw-project
Create patch by running
command diff -Nru sw-project-1.0.0 sw-project > sw-project.patch
The file sw-project.patch
contains all the differences between the original project and the alteration.
Apply patches¶
Download software project
Apply patch
patch -p1 -i sw-project.patch