Solved

How to make patch files

Posted on 2000-05-11
1
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…

739 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