Solved

How to make patch files

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

862 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

23 Experts available now in Live!

Get 1:1 Help Now