Clarify my license.diff -r1.4 -r1.5 pkgsrc/pkgtools/pkgdiff/files/mkpatches.1
(wiz)
@@ -1,60 +1,81 @@ | @@ -1,60 +1,81 @@ | |||
1 | .\" $NetBSD: mkpatches.1,v 1.4 2011/02/02 10:23:02 wiz Exp $ | 1 | .\" $NetBSD: mkpatches.1,v 1.5 2011/02/02 10:36:20 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2000-2011 by Thomas Klausner <wiz@NetBSD.org> | 3 | .\" Copyright (c) 2000-2011 by Thomas Klausner <wiz@NetBSD.org> | |
4 | .\" All Rights Reserved. Absolutely no warranty. | 4 | .\" All rights reserved. | |
5 | .\" | |||
6 | .\" Redistribution and use in source and binary forms, with or without | |||
7 | .\" modification, are permitted provided that the following conditions | |||
8 | .\" are met: | |||
9 | .\" 1. Redistributions of source code must retain the above copyright | |||
10 | .\" notice, this list of conditions and the following disclaimer. | |||
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |||
12 | .\" notice, this list of conditions and the following disclaimer in the | |||
13 | .\" documentation and/or other materials provided with the distribution. | |||
14 | .\" | |||
15 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |||
16 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |||
17 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||
18 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |||
19 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |||
20 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |||
21 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |||
22 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |||
23 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||
24 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
25 | .\" POSSIBILITY OF SUCH DAMAGE. | |||
5 | .\" | 26 | .\" | |
6 | .Dd January 31, 2011 | 27 | .Dd January 31, 2011 | |
7 | .Dt MKPATCHES 1 | 28 | .Dt MKPATCHES 1 | |
8 | .Os | 29 | .Os | |
9 | .Sh NAME | 30 | .Sh NAME | |
10 | .Nm mkpatches | 31 | .Nm mkpatches | |
11 | .Nd create patch files appropriate for pkgsrc | 32 | .Nd create patch files appropriate for pkgsrc | |
12 | .Sh SYNOPSIS | 33 | .Sh SYNOPSIS | |
13 | .Nm | 34 | .Nm | |
14 | .Oo Fl c | Fl r Oc | 35 | .Oo Fl c | Fl r Oc | |
15 | .Op Fl hv | 36 | .Op Fl hv | |
16 | .Sh DESCRIPTION | 37 | .Sh DESCRIPTION | |
17 | .Nm | 38 | .Nm | |
18 | is a perl script that simplifies creating patches from a changed work | 39 | is a perl script that simplifies creating patches from a changed work | |
19 | tree if for each changed file the original was kept with an added | 40 | tree if for each changed file the original was kept with an added | |
20 | extension | 41 | extension | |
21 | .Dq .orig . | 42 | .Dq .orig . | |
22 | .Pp | 43 | .Pp | |
23 | .Nm | 44 | .Nm | |
24 | must be called from the package's main directory, that is | 45 | must be called from the package's main directory, that is | |
25 | .Pa ${PKGSRC}/category/program . | 46 | .Pa ${PKGSRC}/category/program . | |
26 | It then proceeds to find all files that | 47 | It then proceeds to find all files that | |
27 | match the pattern | 48 | match the pattern | |
28 | .Dq *.orig . | 49 | .Dq *.orig . | |
29 | Each of these is then compared to the | 50 | Each of these is then compared to the | |
30 | changed file of the same name (with no | 51 | changed file of the same name (with no | |
31 | .Dq .orig | 52 | .Dq .orig | |
32 | extension) using | 53 | extension) using | |
33 | .Xr pkgdiff 1 . | 54 | .Xr pkgdiff 1 . | |
34 | .Pp | 55 | .Pp | |
35 | The resulting patches are saved in the package's patches directory | 56 | The resulting patches are saved in the package's patches directory | |
36 | (usually | 57 | (usually | |
37 | .Pa patches/ ) | 58 | .Pa patches/ ) | |
38 | and can be easily compared to the currently existing set using | 59 | and can be easily compared to the currently existing set using | |
39 | .Xr patchdiff 1 | 60 | .Xr patchdiff 1 | |
40 | or | 61 | or | |
41 | .Ic "cvs diff" . | 62 | .Ic "cvs diff" . | |
42 | .Pp | 63 | .Pp | |
43 | Supported options are: | 64 | Supported options are: | |
44 | .Bl -tag -width 3n | 65 | .Bl -tag -width 3n | |
45 | .It Fl c | 66 | .It Fl c | |
46 | Clean up backup patches of previous runs. | 67 | Clean up backup patches of previous runs. | |
47 | Use this after you're finished working on the patch set and committed | 68 | Use this after you're finished working on the patch set and committed | |
48 | it. | 69 | it. | |
49 | .It Fl h | 70 | .It Fl h | |
50 | Show a short usage. | 71 | Show a short usage. | |
51 | .It Fl r | 72 | .It Fl r | |
52 | Revert the changes. | 73 | Revert the changes. | |
53 | Removes the new patches and puts the original patches back. | 74 | Removes the new patches and puts the original patches back. | |
54 | .It Fl v | 75 | .It Fl v | |
55 | More verbose output. | 76 | More verbose output. | |
56 | .El | 77 | .El | |
57 | .Sh SEE ALSO | 78 | .Sh SEE ALSO | |
58 | .Xr cvs 1 , | 79 | .Xr cvs 1 , | |
59 | .Xr patchdiff 1 , | 80 | .Xr patchdiff 1 , | |
60 | .Xr pkgdiff 1 | 81 | .Xr pkgdiff 1 |
@@ -1,33 +1,54 @@ | @@ -1,33 +1,54 @@ | |||
1 | .\" $NetBSD: patchdiff.1,v 1.4 2011/02/02 10:23:02 wiz Exp $ | 1 | .\" $NetBSD: patchdiff.1,v 1.5 2011/02/02 10:36:20 wiz Exp $ | |
2 | .\" | 2 | .\" | |
3 | .\" Copyright (c) 2000-2011 by Thomas Klausner <wiz@NetBSD.org> | 3 | .\" Copyright (c) 2000-2011 by Thomas Klausner <wiz@NetBSD.org> | |
4 | .\" All Rights Reserved. Absolutely no warranty. | 4 | .\" All rights reserved. | |
5 | .\" | |||
6 | .\" Redistribution and use in source and binary forms, with or without | |||
7 | .\" modification, are permitted provided that the following conditions | |||
8 | .\" are met: | |||
9 | .\" 1. Redistributions of source code must retain the above copyright | |||
10 | .\" notice, this list of conditions and the following disclaimer. | |||
11 | .\" 2. Redistributions in binary form must reproduce the above copyright | |||
12 | .\" notice, this list of conditions and the following disclaimer in the | |||
13 | .\" documentation and/or other materials provided with the distribution. | |||
14 | .\" | |||
15 | .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |||
16 | .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |||
17 | .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||
18 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |||
19 | .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |||
20 | .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |||
21 | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |||
22 | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |||
23 | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||
24 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
25 | .\" POSSIBILITY OF SUCH DAMAGE. | |||
5 | .\" | 26 | .\" | |
6 | .Dd January 31, 2011 | 27 | .Dd January 31, 2011 | |
7 | .Dt PATCHDIFF 1 | 28 | .Dt PATCHDIFF 1 | |
8 | .Os | 29 | .Os | |
9 | .Sh NAME | 30 | .Sh NAME | |
10 | .Nm patchdiff | 31 | .Nm patchdiff | |
11 | .Nd compare sets of patches | 32 | .Nd compare sets of patches | |
12 | .Sh SYNOPSIS | 33 | .Sh SYNOPSIS | |
13 | .Nm | 34 | .Nm | |
14 | .Sh DESCRIPTION | 35 | .Sh DESCRIPTION | |
15 | .Nm | 36 | .Nm | |
16 | is a perl script that simplifies comparing a set of previously | 37 | is a perl script that simplifies comparing a set of previously | |
17 | existing patches with a new one created with | 38 | existing patches with a new one created with | |
18 | .Xr mkpatches 1 . | 39 | .Xr mkpatches 1 . | |
19 | .Pp | 40 | .Pp | |
20 | .Nm | 41 | .Nm | |
21 | must be called from the package's main directory, that is | 42 | must be called from the package's main directory, that is | |
22 | .Pa ${PKGSRC}/category/program . | 43 | .Pa ${PKGSRC}/category/program . | |
23 | For each patch existing in either the | 44 | For each patch existing in either the | |
24 | .Pa patches | 45 | .Pa patches | |
25 | directory, it is compared with its backup file | 46 | directory, it is compared with its backup file | |
26 | .Pq Pa patch-foo.orig | 47 | .Pq Pa patch-foo.orig | |
27 | using | 48 | using | |
28 | .Xr diff 1 . | 49 | .Xr diff 1 . | |
29 | If no relevant differences are found, the original patch is restored. | 50 | If no relevant differences are found, the original patch is restored. | |
30 | .Sh SEE ALSO | 51 | .Sh SEE ALSO | |
31 | .Xr diff 1 , | 52 | .Xr diff 1 , | |
32 | .Xr patchdiff 1 , | 53 | .Xr patchdiff 1 , | |
33 | .Xr pkgdiff 1 | 54 | .Xr pkgdiff 1 |
@@ -1,72 +1,95 @@ | @@ -1,72 +1,95 @@ | |||
1 | #!@SH@ | 1 | #!@SH@ | |
2 | # | 2 | # | |
3 | # $NetBSD: pkgdiff,v 1.18 2011/02/02 10:23:02 wiz Exp $ | 3 | # $NetBSD: pkgdiff,v 1.19 2011/02/02 10:36:20 wiz Exp $ | |
4 | # | 4 | # | |
5 | # Usage: pkgdiff newfile | 5 | # Usage: pkgdiff newfile | |
6 | # pkgdiff oldfile newfile | 6 | # pkgdiff oldfile newfile | |
7 | # | 7 | # | |
8 | # Will output a patch ready for the NetBSD Pkgs Collection (unified | 8 | # Will output a patch ready for the NetBSD Pkgs Collection (unified | |
9 | # diff, plus no RCS IDs if possible). If only newfile is given, | 9 | # diff, plus no RCS IDs if possible). If only newfile is given, | |
10 | # oldfile is assumed as newfile.orig. | 10 | # oldfile is assumed as newfile.orig. | |
11 | # | 11 | # | |
12 | # Copyright (c) 2000 by Hubert Feyrer <hubertf@netbsd.org> | |||
13 | # Copyright (c) 2011 by Thomas Klausner <wiz@NetBSD.org> | 12 | # Copyright (c) 2011 by Thomas Klausner <wiz@NetBSD.org> | |
13 | # All rights reserved. | |||
14 | # | |||
15 | # Redistribution and use in source and binary forms, with or without | |||
16 | # modification, are permitted provided that the following conditions | |||
17 | # are met: | |||
18 | # 1. Redistributions of source code must retain the above copyright | |||
19 | # notice, this list of conditions and the following disclaimer. | |||
20 | # 2. Redistributions in binary form must reproduce the above copyright | |||
21 | # notice, this list of conditions and the following disclaimer in the | |||
22 | # documentation and/or other materials provided with the distribution. | |||
23 | # | |||
24 | # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | |||
25 | # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |||
26 | # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |||
27 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |||
28 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |||
29 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |||
30 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |||
31 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |||
32 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |||
33 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |||
34 | # POSSIBILITY OF SUCH DAMAGE. | |||
35 | # | |||
36 | # Copyright (c) 2000 by Hubert Feyrer <hubertf@netbsd.org> | |||
14 | # All Rights Reserved. Absolutely no warranty. | 37 | # All Rights Reserved. Absolutely no warranty. | |
15 | # | 38 | # | |
16 | 39 | |||
17 | # Ensure we always use the same timezone to avoid spurious metadata diffs | 40 | # Ensure we always use the same timezone to avoid spurious metadata diffs | |
18 | export TZ=UTC | 41 | export TZ=UTC | |
19 | 42 | |||
20 | if [ $# -le 1 ] | 43 | if [ $# -le 1 ] | |
21 | then | 44 | then | |
22 | if [ -f "$1.orig" ]; then | 45 | if [ -f "$1.orig" ]; then | |
23 | old="$1.orig" | 46 | old="$1.orig" | |
24 | new="$1" | 47 | new="$1" | |
25 | else | 48 | else | |
26 | echo $0: need at least one argument >&2 | 49 | echo $0: need at least one argument >&2 | |
27 | exit 1; | 50 | exit 1; | |
28 | fi | 51 | fi | |
29 | else | 52 | else | |
30 | old="$1" | 53 | old="$1" | |
31 | new="$2" | 54 | new="$2" | |
32 | fi | 55 | fi | |
33 | basename_new="`basename $new`" | 56 | basename_new="`basename $new`" | |
34 | 57 | |||
35 | dodiff() { | 58 | dodiff() { | |
36 | case x"$basename_new" in | 59 | case x"$basename_new" in | |
37 | xconfigure) | 60 | xconfigure) | |
38 | @DIFF@ -I '\(echo .*as_me:[0-9][0-9]*:\|echo .*configure:[0-9][0-9]*:\|line [0-9][0-9]* "configure\)' -I '\(Avoid regenerating within pkgsrc\|exit 0\)' $* | 61 | @DIFF@ -I '\(echo .*as_me:[0-9][0-9]*:\|echo .*configure:[0-9][0-9]*:\|line [0-9][0-9]* "configure\)' -I '\(Avoid regenerating within pkgsrc\|exit 0\)' $* | |
39 | ;; | 62 | ;; | |
40 | xMakefile*) | 63 | xMakefile*) | |
41 | @DIFF@ -I '\(localedir.*=.*localedir\|localedir.*=.*share/locale\)' $* | 64 | @DIFF@ -I '\(localedir.*=.*localedir\|localedir.*=.*share/locale\)' $* | |
42 | ;; | 65 | ;; | |
43 | *) | 66 | *) | |
44 | @DIFF@ $* | 67 | @DIFF@ $* | |
45 | esac | 68 | esac | |
46 | } | 69 | } | |
47 | 70 | |||
48 | case x"$PKGDIFF_FMT" in x) | 71 | case x"$PKGDIFF_FMT" in x) | |
49 | lines=3 | 72 | lines=3 | |
50 | PKGDIFF_FMT="-p" | 73 | PKGDIFF_FMT="-p" | |
51 | while [ `dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'` != 0 ] | 74 | while [ `dodiff "$PKGDIFF_FMT" -U $lines "$old" "$new" | egrep -c '\\$(NetBSD|Author|Date|Header|Id|Locker|Log|Name|RCSfile|Revision|Source|State)(:.*)?\\$'` != 0 ] | |
52 | do | 75 | do | |
53 | lines=`expr $lines - 1` | 76 | lines=`expr $lines - 1` | |
54 | if [ $lines = 0 ]; then | 77 | if [ $lines = 0 ]; then | |
55 | echo "Cannot strip away RCS IDs, please handle manually!" >&2 | 78 | echo "Cannot strip away RCS IDs, please handle manually!" >&2 | |
56 | exit 1 | 79 | exit 1 | |
57 | fi | 80 | fi | |
58 | done | 81 | done | |
59 | PKGDIFF_FMT="${PKGDIFF_FMT} -U $lines" | 82 | PKGDIFF_FMT="${PKGDIFF_FMT} -U $lines" | |
60 | ;; | 83 | ;; | |
61 | esac # PKGDIFF_FMT unset or null | 84 | esac # PKGDIFF_FMT unset or null | |
62 | 85 | |||
63 | if dodiff -q "$PKGDIFF_FMT" "$old" "$new" > /dev/null | 86 | if dodiff -q "$PKGDIFF_FMT" "$old" "$new" > /dev/null | |
64 | then | 87 | then | |
65 | : | 88 | : | |
66 | else | 89 | else | |
67 | echo '$'NetBSD'$' | 90 | echo '$'NetBSD'$' | |
68 | echo '' | 91 | echo '' | |
69 | # Strip out the date on the +++ line to reduce needless | 92 | # Strip out the date on the +++ line to reduce needless | |
70 | # differences in regenerated patches | 93 | # differences in regenerated patches | |
71 | dodiff "$PKGDIFF_FMT" "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:' | 94 | dodiff "$PKGDIFF_FMT" "$old" "$new" | sed -e 's:^\(+++ [^ ]*\) .*:\1:' | |
72 | fi | 95 | fi |