Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to make patch files

Posted on 2000-05-11
1
Medium Priority
?
232 Views
Last Modified: 2010-04-21
This must be an FAQ, but I cannot find it anyway. The linux guys produces patches for their source tree when moving from one version ot another
and I can do a

patch -p0 < patch

to upgrade the src tree.

So how are these patches made?

Suppose I have two versions of something

./thing-version-0.1

and

./thing-version-0.1.65

each source tree has a bunch of subdirectories in, containing any files which might change. How do I make a patch file so that someone has their source code in

./thing

can patch from one version to another.

Thanks in advance,
Nicholas Waltham
0
Comment
Question by:nwaltham
1 Comment
 
LVL 40

Accepted Solution

by:
jlevie earned 200 total points
ID: 2807046
You use diff with the recursive option (-r) to compare both directory trees. The recommended way (from the patch man page) is to use "diff -Naur old new", where "old" is the orginal and "new" is the modified directory trees. It's best if the timestamps are in UTC and this can be accomplished by:

>LC_ALL=C TZ=UTC0 diff -Naur old-dir new-dir

All of this and more is in the "NOTES FOR PATCH SENDERS" at the end of the man page for patch.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question