How to create a patch to update one of your projects its external vendor code.
I use this way to upgrade projects such as DokuWiki and CakePHP.
The advantage of this method is you will keep modifications you have made in the code of that vendor.
In my description I use FreeBSD and Mac OS X so you might need to adjust the commands for a different Operating System.
Create the patch file
First download the old and the new version code from your vendor site. In this example this is the website of CakePHP.
You need this that you can match the old version to the new version you want to upgrade to.
Create a temp directory to work in.
mkdir myUpgrade cd myUpgrade
Download the two versions of CakePHP, your current and the version you desire to upgrade to
- http://github.com/cakephp/cakephp1x/tarball/1.3.0-RC3
- http://github.com/cakephp/cakephp1x/tarball/1.3.0-RC4
Unpack tarballs:
tar -xzvf cakephp-cakephp1x-348e5f0.tar.gz tar -xzvf cakephp-cakephp1x-f63ab48.tar.gz
Now create the aptch width using the diff utility:
diff -Naur -x '.svn' -x '._*' cakephp-cakephp1x-348e5f0 cakephp-cakephp1x-f63ab48 > cakephp.diff
Applying the patch
To apply the patch file you created in the previous step, change into your real vendor directory and run the patch tool.
You may first want to do a test run to see if any conflicts may happen and what files are affected:
cd myUpgrade patch -E -p1 < ../cakephp.diff --dry-run
The output should be something like this:
patching file cake/VERSION.txt patching file cake/basics.php patching file cake/config/config.php *etc*
When you're happy, apply the patch:
patch -E -p1 < ../cakephp.diff
Once patch is applied you're done
Fix write access problem for Mac OS X 10.6.x to Samba share on FreeBSD or Linux
Nothing is more irritating than not being able to copy the files you want to a share.
This problem has been bugging me since the release of Mac OS X 10.6.
The fix seems to be quite simple, I added the following to my global block in smb.conf:
[global] dos charset = UTF8 unix charset = UTF8 display charset = UTF8 unix extensions = no
Now we can work without errors again.
Ps. Don't forget to unmount and re-mount your share before the changes take effect.




