Difference between revisions of "X-Cart:To apply a patch by issuing the command 'patch'"

From X-Cart 4 Classic
Jump to: navigation, search
(Created page with '# Save the text of your patch to a file (e.g. patch.diff). # Copy this file (patch.diff) to the directory where X-Cart is installed. # Issue the command 'patch -c < patch.diff' t…')
 
 
Line 1: Line 1:
 
# Save the text of your patch to a file (e.g. patch.diff).
 
# Save the text of your patch to a file (e.g. patch.diff).
 
# Copy this file (patch.diff) to the directory where X-Cart is installed.
 
# Copy this file (patch.diff) to the directory where X-Cart is installed.
# Issue the command 'patch -c < patch.diff' to check the patch applicability.
+
# Issue the command 'patch --dry-run -p1 < patch.diff' to check the patch applicability.
# If there are no errors during the check-up, apply the patch by issuing the command 'patch < patch.diff'.
+
# If there are no errors during the check-up, apply the patch by issuing the command 'patch -p1 < patch.diff'.
  
 
You can read more about 'patch' command in the manual (man patch, info patch).
 
You can read more about 'patch' command in the manual (man patch, info patch).
 +
 +
{{Note1|If the text of the patch contains header lines like "Index: include/func/func.category.php", use -p0 option in the commands, i.e. 'patch --dry-run -p0 < patch.diff' and 'patch -p0 < patch.diff'.}}
 +
 +
'''See also''': [[X-Cart:To_apply_a_patch_manually | How to apply patches manually]].

Latest revision as of 21:25, 26 December 2013

  1. Save the text of your patch to a file (e.g. patch.diff).
  2. Copy this file (patch.diff) to the directory where X-Cart is installed.
  3. Issue the command 'patch --dry-run -p1 < patch.diff' to check the patch applicability.
  4. If there are no errors during the check-up, apply the patch by issuing the command 'patch -p1 < patch.diff'.

You can read more about 'patch' command in the manual (man patch, info patch).

If the text of the patch contains header lines like "Index: include/func/func.category.php", use -p0 option in the commands, i.e. 'patch --dry-run -p0 < patch.diff' and 'patch -p0 < patch.diff'.

See also: How to apply patches manually.