Solved

How to make patch files

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now