aboutsummaryrefslogtreecommitdiff
path: root/usr/pkgsrc/pkgtools/pkgdiff/files/patch-t
blob: c91c10691a40c30e46eb19f08d02dfa9eeef8452 (plain)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
$NetBSD$

Use .~1~ extension instead of .orig (like patch -Vt).

--- feedback-patches.orig	2011-02-02 21:44:13.000000000 +0000
+++ feedback-patches
@@ -51,7 +51,7 @@ fi
 pkg=`echo $pkg_f | sed -e 's,.*/pkgsrc/,,' -e 's,/$,,'`
 cd $PKGSRCBASE/$pkg
 
-if [ ! -d patches -o `ls patches 2>/dev/null | grep -v orig | grep -v BAK | wc -l` -eq 0 ]
+if [ ! -d patches -o `ls patches 2>/dev/null | grep -v ~1~ | grep -v BAK | wc -l` -eq 0 ]
 then
 	echo '***' Package $pkg has no patches, exiting.
 	exit 0

--- mkpatches.pl.orig	2019-08-21 13:00:06.000000000 +0000
+++ mkpatches.pl
@@ -4,5 +4,5 @@
 #
 # mkpatches: creates a set of patches patch-aa, patch-ab, ...
-#   in work/.newpatches by looking for *.orig files in and below
+#   in work/.newpatches by looking for *.~1~ files in and below
 #   WRKDIR and comparing them to the corresponding changed file. All
 #   files are then referrenced relative to WRKSRC.
@@ -100,5 +100,5 @@ usage: $prog [-hvw] [-c | -r] [-D | -d d
     -h   	show this help
     -r   	revert -- remove new patches, put old patches back
-    -v   	verbose - list .orig files as processed
+    -v   	verbose - list .~1~ files as processed
     -w   	look for changes in \$WRKDIR instead of \$WRKSRC
 EOF
@@ -133,5 +133,5 @@ if ($opt_D) {
 
 if ($opt_c) {
-    open(HANDLE, "find ${patchdir} -type f -name \\\*.orig |");
+    open(HANDLE, "find ${patchdir} -type f -name \\\*.~1~ |");
     foreach (<HANDLE>) {
 	chomp;
@@ -142,10 +142,10 @@ if ($opt_c) {
 
 if ($opt_r) {
-    open(HANDLE, "find ${patchdir} -type f -name \\\*.orig |");
+    open(HANDLE, "find ${patchdir} -type f -name \\\*.~1~ |");
     foreach (<HANDLE>) {
 	chomp;
 	my $orig = $_;
 	my $new = $_;
-	$new =~ s/.orig$//;
+	$new =~ s/.~1~$//;
 	rename $orig, $new;
 	if (! -s $new) {
@@ -167,7 +167,7 @@ chdir $wrksrc or die ("can't cd to WRKSR
 
 if ($opt_w) {
-    open(HANDLE, "find ${wrkdir} -type f -name \\\*.orig |");
+    open(HANDLE, "find ${wrkdir} -type f -name \\\*.~1~ |");
 } else {
-    open(HANDLE, "find ${wrksrc} -type f -name \\\*.orig |");
+    open(HANDLE, "find ${wrksrc} -type f -name \\\*.~1~ |");
 }
 
@@ -181,5 +181,5 @@ foreach (sort <HANDLE>) {
     $path = $_;
     $complete = $path;
-    $complete =~ s/.orig$//;
+    $complete =~ s/.~1~$//;
     $new = File::Spec->abs2rel($complete, $wrksrc);
     $old = File::Spec->abs2rel($path, $wrksrc);
@@ -214,7 +214,7 @@ sub analyze_old_patches 
     while ($origfilename = <HANDLE>) {
 	chomp $origfilename;
-	next if not $origfilename =~ m/.orig$/;
+	next if not $origfilename =~ m/.~1~$/;
 	$filename = $origfilename;
-	$filename =~ s/.orig$//;
+	$filename =~ s/.~1~$//;
 	$checkname = $origfilename;
 	if (! -s $checkname) {
@@ -245,7 +245,7 @@ sub move_away_old_patches
     while ($filename = <HANDLE>) {
 	chomp $filename;
-	next if $filename =~ m/.orig$/;
-	if (-f "$filename" and not -f "$filename.orig") {
-	    rename "$filename", "$filename.orig";
+	next if $filename =~ m/.~1~$/;
+	if (-f "$filename" and not -f "$filename.~1~") {
+	    rename "$filename", "$filename.~1~";
 	}
     }
@@ -276,10 +276,10 @@ sub make_patch # new old patchfile diff
     if ("$diff" eq "") {
 	print "$old and $new don't differ\n";
-	if (-f "$patchdir/$patchfile.orig") {
-	    rename "$patchdir/$patchfile.orig", "$patchdir/$patchfile";
+	if (-f "$patchdir/$patchfile.~1~") {
+	    rename "$patchdir/$patchfile.~1~", "$patchdir/$patchfile";
 	}
     }
-    if (not -f "$patchdir/$patchfile.orig") {
-	system("touch", "$patchdir/$patchfile.orig");
+    if (not -f "$patchdir/$patchfile.~1~") {
+	system("touch", "$patchdir/$patchfile.~1~");
     }
     if (defined($old_header{$new})) {
@@ -294,12 +294,12 @@ sub make_patch # new old patchfile diff
     # check if the new patch is basically the same as the old one
 
-    $diff=`diff $patchdir/$patchfile.orig $patchdir/$patchfile`;
+    $diff=`diff $patchdir/$patchfile.~1~ $patchdir/$patchfile`;
 
     # the following regex try to eliminate uninteresting differences
     # The general structure of the diffs-to-be-removed is:
     # 25c25
-    # < --- something.orig 2008-08-08 08:08
+    # < --- something.~1~ 2008-08-08 08:08
     # ---
-    # > --- something.orig 2008-08-08 18:08
+    # > --- something.~1~ 2008-08-08 18:08
     #
     # In particular, remove hunks with:
@@ -320,5 +320,5 @@ sub make_patch # new old patchfile diff
     } else {
 	# restore previous version to get rid of uninteresting diffs
-	rename "$patchdir/$patchfile.orig", "$patchdir/$patchfile";
+	rename "$patchdir/$patchfile.~1~", "$patchdir/$patchfile";
     }
 

--- patchdiff.pl.orig	2016-02-10 16:00:10.000000000 +0000
+++ patchdiff.pl
@@ -110,13 +110,13 @@ if ( ! -d $patchdir) {
     exit(0);
 }
 
-open(HANDLE, "find ${patchdir} -type f -name \\\*.orig |");
+open(HANDLE, "find ${patchdir} -type f -name \\\*.~1~ |");
 
 foreach (sort <HANDLE>) {
     $orig = $_;
     chomp($orig);
     $new = $orig;
-    $new =~ s/.orig$//;
+    $new =~ s/.~1~$//;
 
     if (! -f "$new") {
 	print "File $new removed\n";

--- pkgdiff.orig	2015-02-03 22:50:27.000000000 +0000
+++ pkgdiff
@@ -7,7 +7,7 @@
 #
 # Will output a patch ready for the NetBSD Pkgs Collection (unified
 # diff, plus no RCS IDs if possible). If only newfile is given,
-# oldfile is assumed as newfile.orig.
+# oldfile is assumed as newfile.~1~.
 #
 
 #
@@ -70,8 +70,8 @@ export TZ=UTC
 
 if [ $# -le 1 ]
 then
-	if [ -f "$1.orig" ]; then 
-		old="$1.orig"
+	if [ -f "$1.~1~" ]; then 
+		old="$1.~1~"
 		new="$1"
 	else
 		echo $0: need at least one argument >&2

--- pkgvi.orig	2011-08-23 21:47:18.000000000 +0000
+++ pkgvi
@@ -59,7 +59,7 @@ then
 	exit 2
 fi
 
-if [ -f "$file.orig" ]
+if [ -f "$file.~1~" ]
 then
 	chmod u+w "$file"
 	$editor $cmd "$file"
@@ -93,7 +93,7 @@ if cmp "$file" "$tmp" >/dev/null 2>&1
 then
 	echo "$progname: File unchanged."
 else
-	mv "$file" "$file.orig"
+	mv "$file" "$file.~1~"
 	mv "$tmp" "$file"
 	echo "$progname: File was modified. For a diff, type:"
 	echo "pkgdiff \"$file\""