Development:How to apply a patch: Difference between revisions
From MoodleDocs
Dan Marsden (talk | contribs) mNo edit summary |
Dan Marsden (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
==Introduction== | ==Introduction== | ||
This page explains how you can apply a patch file. Patch is a standard format, and there are many options for how to apply one. Pick the one that is easiest for you. | |||
==Apply a Patch in Windows using [http://gnuwin32.sourceforge.net/packages/patch.htm gnuwin32]== | ==Apply a Patch in Windows using [http://gnuwin32.sourceforge.net/packages/patch.htm gnuwin32]== |
Revision as of 21:41, 2 July 2008
Introduction
This page explains how you can apply a patch file. Patch is a standard format, and there are many options for how to apply one. Pick the one that is easiest for you.
Apply a Patch in Windows using gnuwin32
- Download and extract patch for windows from sourceforge I placed the patch.exe binary in C:\bin
- Download and extract Moodle somewhere. eg: C:\moodle
- Download the patch file and place it in the same directory you put Moodle (C:\moodle\password-policy-17.diff)
- Open the patch file with Wordpad, and click 'File' >> 'Save as...', choose a different name for the file eg ('mynewpatch.diff') and "Save as type" >> 'Text Document - MS-DOS Format'
- Open up a command text window, and type:
cd \moodle c:\bin\patch.exe -p1 < mynewpatch.diff
- You should get an output similar to this:
patching file admin/settings/security.php patching file lang/en_utf8/admin.php patching file lib/moodlelib.php patching file login/change_password.php patching file login/signup.php patching file user/edit.php Hunk #1 succeeded at 430 (offset 2 lines).
Apply a Patch in Linux using "patch"
use something like: patch -p1 < patchfile.diff