xref: /openbsd-src/share/man/man1/update-patches.1 (revision a807f2159376516cfdae97d9a06cc741d9c5a9c7)
1.\"	$OpenBSD: update-patches.1,v 1.2 2018/06/26 06:56:07 jmc Exp $
2.\"
3.\" Copyright (c) 2010 Marc Espie <espie@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: June 26 2018 $
18.Dt UPDATE-PATCHES 1
19.Os
20.Sh NAME
21.Nm update-patches
22.Nd create or update patches for a given port
23.Sh SYNOPSIS
24.Nm update-patches
25.Sh DESCRIPTION
26.Nm
27is a helper script for the target
28.Ar update-patches
29in
30.Xr bsd.port.mk 5 .
31It takes no argument, but uses quite a few environment variables as
32implicit parameters.
33.Pp
34.Nm
35looks under
36.Ev WRKDIST
37for patched files.
38Those are files with extension
39.Ev PATCHORIG ,
40except for those matching also
41.Ev DISTORIG .
42.Pp
43Once those files are found, they are matched against the contents of
44directory
45.Ev PATCHDIR ,
46most specifically files matching wildcard
47.Ev PATCH_LIST .
48Matching files are regenerated on the basis of
49.Pp
50.Dl $ diff -u -p -a ${DIFF_ARGS} $file$PATCHORIG $file
51.Pp
52and compared.
53Modified patches are updated and reported, new patches are generated,
54and old patches that no longer seem to exist are also reported.
55.Pp
56As an exception, if a
57.Pa $file.beforesubst
58original file is found, it is used instead of $file in the diff line:
59.Pp
60.Dl $ diff -u -p -a ${DIFF_ARGS} $file$PATCHORIG $file.beforesubst
61.Pp
62The patch header is normalized to always be:
63.Bd -literal -offset indent
64Index: $file
65--- $file.orig
66+++ $file
67.Ed
68.Pp
69Patches with problematic
70.Xr cvs 1
71keywords may be fixed if possible, and reported if not.
72.Pp
73.Nm
74prints the list of changed patches for further study.
75.Sh ENVIRONMENT
76.Bl -tag -width FORCE_REGEN
77.It Ev DIFF_ARGS
78Extra parameters to insert into
79.Xr diff 1 .
80.It Ev DISTORIG
81Extension to original files to ignore entirely.
82.It Ev FORCE_REGEN
83Force patches to be regenerated even if they didn't change.
84.It Ev PATCHDIR
85Path to existing and generated patches.
86.It Ev PATCHORIG
87Extension to match for finding original files.
88.It Ev PATCH_LIST
89Only compare new patches to existing patches matching that pattern.
90.It Ev PATCH_VERBOSE
91Force
92.Nm
93to tell about everything it does.
94.It Ev WRKDIST
95Directory to scan for files to compare.
96.El
97.Sh SEE ALSO
98.Xr cvs 1 ,
99.Xr diff 1 ,
100.Xr patch 1
101