Cygwin

Last modified: April 23, 2009 - 04:45

Here are some steps to use Cygwin for patching in Windows. There is a videocast on Installing Cygwin on Windows XP that covers installing Cygwin but not actually using it. For applying patches from command line there is another videocast Applying Patches to Drupal Core.

Assumptions

  • cygwin is installed at c:\cygwin
  • the patch is at c:\mypatch.patch
  • The drupal installation is at c:\drupal
  1. Start a cmd window
  2. cd c:\drupal
  3. c:\cygwin\bin\patch.exe -p0 < c:\mypatch.patch

After the patch is applied check for it saying that hunks failed. If it does it will create a reject(.rej) file where you can look at what has failed.

If there are no errors or it only states there are offsets then your patch has been applied successfully.

File permissions after patch in Cygwin

okaalto - October 20, 2009 - 10:17

When applying Drupal core patches under Cygwin the file permissions of patched files may get broken causing "failed to open stream: Permission denied" errors on require_once() etc. calls, which ends up with WSOD.

When checking the 'ls' output from Cygwin, there's an extra + sign missing in file permissions for the patched files, when compared to other files. This indicates that there are extra permissions (from Windows ACLs) applying, which do not fit to traditional user/group/other categories.

The ACLs can be checked and restored by using commands 'getfacl' and 'setfacl' under Cygwin. Just check what ACLs any other file, which was not patched, has, and then apply the same to the patched files.

 
 

Drupal is a registered trademark of Dries Buytaert.