This quick start guide explains how to use the Mercurial patch queue to add patches on top of the OpenSAF source code.
First make sure you have configured [Mercurial] according to the instructions on the wiki.
If you don't yet have a clone of the OpenSAF Mercurial repository, you can create one using the following command:
hg clone http://hg.code.sf.net/p/opensaf/staging opensaf-staging
cd opensaf-staging
For each patch you wish to apply, import it using the following command (where patch-file.diff is the name of the file containing the patch):
hg qimport patch-file.diff
You can list the imported patches using the following command:
hg qseries
You can apply the patches one at a time using the following command:
hg qpush
You can apply all the patches in one go using the -a flag:
hg qpush -a
You can apply a specific patch by specifying the --move option and the name of the patch file:
hg qpush --move patch-file.diff
You can remove patches one at a time (or all using the -a flag) with the following command:
hg qpop
To check which patches you have currently applied, use this command:
hg qapplied
If the patch is old, it may not apply cleanly since the source code has changed. In this case you will get .rej files for each source code file that was not sucessfully patched automatically. You will need to manually perform the changes shown in each of these .rej file to the source code. Once you have done this, you can update the failed patch in the Mercurial with the following command:
hg qrefresh
Once you have applied all the patches you need, rebuild OpenSAF using the following commands:
./bootstrap.sh
./configure
make clean
make -j 4