[news.software.anu-news] How to use patch?

sdroppers@pbs.uucp (12/21/89)

I have checked back, but I cannot find anything, is there a man page or such
that someone can post (or E-Mail) about how to use patch?  If patch is a *nix
tool then I am in the dark, we have no such docs available.
-- 
Seton Droppers  -- "Anything that I say is my opinion and not my employer's."
Public Broadcasting Service, 1320 Braddock Pl. Alexandria, VA 22314
(UUCP) ...{csed-1,ida.org,vrdxhq}!pbs!sdroppers
(VAX/VMS running DECUS UUCP 1.1, ANU News 5.9A)

tanner@cerritos.edu (12/22/89)

In article <4981.25908cae@pbs.uucp>, sdroppers@pbs.uucp writes:
> I have checked back, but I cannot find anything, is there a man page or such
> that someone can post (or E-Mail) about how to use patch?  If patch is a *nix
> tool then I am in the dark, we have no such docs available.

Here's a DCL file I used to patch 5.9C.  I copied the News 5.9 sources and the
5.9C .DIFF files to a directory (yes, on the same disk as sys$scratch) and
executed this file.  Everything seemed to update fine.  Beware the logical
UTL:, it's where we put our utilities.

$ set noon
$ patch := $utl:patch
$ rename newsmail.c newsvmsmail.c
$ context = 0
$loop:  ! loop for all .diff files
$ dif = f$search("*.diff",context)
$ if dif .eqs. "" then exit
$ name = f$parse(dif,,,"name") + f$parse(dif,,,"type")  ! make short filename
$ open file 'dif'
$ read/end_of_file=empty file line  ! read the diff file header
$ start = f$locate("]",line) + 1
$ dest = f$extract(start,f$length(line)-start,line)  ! extract filename
$ read/end_of_file=empty file line
$ read/end_of_file=empty file line  ! test for empty diff files
$ write sys$output "patching ''dest'"
$ patch 'dest' 'name''type'
$empty:  ! .diff file contains header only, skip patch
$ close file
$ goto loop

If you need patch.exe, it's on gray.cerritos.edu for anonymous ftp.

-Bruce
-- 
Bruce Tanner        (213) 860-2451 x 596    Tanner@Cerritos.EDU
Cerritos College    Norwalk, CA             cerritos!tanner