Solved

How to make patch files

Posted on 2000-05-11
1
218 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 50 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

839 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