automating patch4

Phil Howard phil-bind at
Fri Nov 12 06:06:42 UTC 1999

Daniel Serna wrote:

> In looking at the patch file I noticed that there is only a slight change
> in the source code:

[actualy patch file snipped]

> So, the only difference is that you need to append a "=" to the right
> of the ">" in the following line:
> if ((methode == ISIXFR) || (soa_cnt >= 2)) {

Yes I saw that.  I could have done it with emacs/vi/pico.

> All I did was append that to the named-xfer.c code and then followed the
> instructions to install bind. I would think that is all one has to do. I
> don't think that the patch is a patch in the traditional sense, i.e. you
> can install it using patchadd. It seems to be patch that is of the "This
> is the only change you have to make to make it work" variety, unless I
> missed something.
> Hope that helps

I succesfully installed it.  My question is how to automate it given that
the patch file apparently wants the user to figure out where to apply it.
How do I make a script that will know how to apply it, given the directory
where the tarballs were extracted into?

The usual way to do a patch for a package extracted from a tar.gz or zip or
whatever would be to apply the patch from the same directory.  A script that
should work for any package would have to do this, or would have to find some
information in the patch file or the previously extracted data, to determine
what directory (perhaps relative to the extract directory) to patch from.

A patch file can be made recursively.  Supposedly a "patch" to a new version
could affect any or even all files anywhere in the whole directory tree that
was extracted.  Such a patch file would have to be applied from there.  If
it was applied within any subdirectory, it would be ambiguous.

What I'd seeking is to be able to automate this.  I want to know if there
is some standard here.  For example, I could code my script to handle bind
as a special case and cd to some subdirectory ... but which one?

Phil Howard | stop5809 at a3b3c3d3 at stop7914 at
  phil      | ads3suck at a8b2c8d8 at no21ads2 at
      at    | eat84me3 at end0ads6 at suck2it3 at
  ipal      | eat8this at w7x5y8z9 at eat6this at
     dot    | end2ads1 at stop3it7 at w3x3y7z9 at
  net       | end1ads3 at ads5suck at eat83me2 at

More information about the bind-users mailing list