Patch automatic patching using the gun Win32 Tool

Source: Internet
Author: User
The version I tested is 2.5.9. However, you only need to use a few parameters:

Patch.exe-D work_dir-I patch_file-P 0-l-N

Work_dir directory to be patched
Patch_file patch file
-P 0 directly uses the directory in the patch file without any deletions
-L ignore Spaces
-N: ignore or not apply patches.

1> both work_dir and patch_file use absolute paths.

2> because all my patch files are made using Windows tortoise SVN shell, which contains path information
With the combination of-D and-P 0, you can directly hit each file. Because-D indicates that you must first enter this directory.

3>-N: If files controlled by SVN are well processed and files that have been patched are repeated, no errors will occur.
The controlled file will be typed again.

4> If the following error is reported, the line breaks in the patch file are messy, including CR/LF and LF.
Assertion failed: hunk, file ../patch-2.5.9-src/patch. C, line 354

No way, you can only unify the patch file into one style.

After I unified them into a Windows style, a miracle occurred:
It turns out to be a full-text Unix-style line break file. After being patched, all files become windows-style. The reason is that the patch file contains several windows-style patches. Patch makes all the remaining line breaks in the file the same as the patch. Powerful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.