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