Rob Hudson wrote:

> If there is a piece of software that I want to make a patch on, how
> does one do this?  Do you need 2 trees - the original and the changed
> one?

Yes, you need two trees.  If you started from a tarball, you can
create the second tree by untarring it into another directory.

First, get the two trees sitting side by side.  For example,

        $ cd /usr/src
        $ mkdir tmp
        $ cd tmp
        $ tar xfz /path/to/linux-2.5.2.tar.gz
        $ mv linux ../linux.orig
        $ cd ..
        $ rmdir tmp
        $ ls
        linux  linux.orig

Completely clean the tree you've been working in of any files that are
not part of the distribution.  "make clobber", "make distclean", or
"make mrproper" might do this, depending on the project.  Read the
Makefile.

Then, cd to the common parent, and run diff with the args "-ruaN".
(recursive, unified, all-text, New-files).  Diff the unmodified
directory against the modified one.

        $ cd /usr/src
        $ diff -ruaN linux.orig linux > /tmp/hyperspace-bypass.patch

Read the patch.  Fix any errors, either by editing the patch or by
modifying the new tree and re-running the patch.

Eventually, you'll write a dozen lines of shell script to mostly
automate this for your projects.

Whatcha patchin'?

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     [EMAIL PROTECTED]

Reply via email to