View | Details | Raw Unified | Return to bug 174860 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-cmd_diff.in (-5 / +6 lines)
Lines 1-10 Link Here
1
--- cmd_diff.in.orig	2009-09-09 21:59:59.000000000 +0200
1
--- cmd_diff.in.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ cmd_diff.in	2009-10-25 16:28:14.000000000 +0100
2
+++ cmd_diff.in	2012-12-27 20:13:30.000000000 +0900
3
@@ -21,6 +21,7 @@
3
@@ -20,7 +20,7 @@
4
 Usage: port diff [-h] [-d <diff mode>]
4
 	-h	- Display this usage summary
5
 	-h	- Display this usage summary
5
 	-d <diff mode> - Select diff generation mode:
6
 	-d <diff mode> - Select diff generation mode:
6
 		CVS - against CVS
7
-		CVS - against CVS
7
+		CVSauto - against CVS, no cvs add/delete required
8
+		SVN - against SVN
8
 		<dir> - against Ports tree in <dir>
9
 		<dir> - against Ports tree in <dir>
9
 		<pattern> - against original port in <pwd><pattern>
10
 		<pattern> - against original port in <pwd><pattern>
10
 EOF
11
 EOF
(-)files/patch-cmd_submit.in (-49 / +33 lines)
Lines 1-10 Link Here
1
--- cmd_submit.in.orig	2009-09-09 20:59:59.000000000 +0100
1
--- cmd_submit.in.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ cmd_submit.in	2012-03-04 12:02:36.697273154 +0000
2
+++ cmd_submit.in	2012-12-31 23:10:59.000000000 +0900
3
@@ -26,10 +26,12 @@
3
@@ -25,11 +25,12 @@
4
 		change - changing a port 
4
 		update - updating a port to newer version
5
 		update - updating a port to newer version
5
 	-d <diff mode> - Select diff generation mode:
6
 	-d <diff mode> - Select diff generation mode:
6
 		CVS - against CVS
7
-		CVS - against CVS
7
+		CVSauto - against CVS, no cvs add/delete required
8
+		SVN - against SVN
8
 		<dir> - against Ports tree in <dir>
9
 		<dir> - against Ports tree in <dir>
9
 		<pattern> - against original port in <pwd><pattern>
10
 		<pattern> - against original port in <pwd><pattern>
10
 	-s <severity> - Set PR's severity to <severity>
11
 	-s <severity> - Set PR's severity to <severity>
Lines 13-19 Link Here
13
 	-c	- committer mode: more portlint(1) checks
14
 	-c	- committer mode: more portlint(1) checks
14
 	-L	- Skip running portlint(1)
15
 	-L	- Skip running portlint(1)
15
 EOF
16
 EOF
16
@@ -41,9 +43,10 @@
17
@@ -41,9 +42,10 @@
17
 PRIORITY="low"
18
 PRIORITY="low"
18
 COMMITTER="no"
19
 COMMITTER="no"
19
 RUN_PORTLINT="yes"
20
 RUN_PORTLINT="yes"
Lines 25-31 Link Here
25
 if [ $? != 0 ]
26
 if [ $? != 0 ]
26
 then
27
 then
27
 	echo "Error: invalid arguments"
28
 	echo "Error: invalid arguments"
28
@@ -116,6 +119,10 @@
29
@@ -116,6 +118,10 @@
29
 	-L)
30
 	-L)
30
 		RUN_PORTLINT="no"
31
 		RUN_PORTLINT="no"
31
 		;;
32
 		;;
Lines 36-48 Link Here
36
 	esac
37
 	esac
37
 	shift
38
 	shift
38
 done
39
 done
39
@@ -126,6 +133,15 @@
40
@@ -123,9 +129,19 @@
40
 	[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
41
 # Determine if this is a new port
42
 if [ "${MODE}" = "" ]
43
 then
44
-	[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
45
+	svn status Makefile 2>&1 1>/dev/null | grep -qs 'svn: warning: W155007:'
46
+	[ $? -eq 0 ] || [ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
41
 fi
47
 fi
42
 
48
 
43
+# util_diff will set
49
+# util_diff will set
44
+# - PORTBASENAME if PORTNAME != port's directory name
50
+# - PORTBASENAME if PORTNAME != port's directory name
45
+# - DIFF_TYPE to CVS, CVSauto, ports, or suffix
51
+# - DIFF_TYPE to SVN, ports, or suffix
46
+PORTBASENAME=""
52
+PORTBASENAME=""
47
+DIFF_TYPE=""
53
+DIFF_TYPE=""
48
+
54
+
Lines 52-58 Link Here
52
 # Run portlint(1) to validate port's sanity
58
 # Run portlint(1) to validate port's sanity
53
 if [ "${RUN_PORTLINT}" = "yes" ]
59
 if [ "${RUN_PORTLINT}" = "yes" ]
54
 then
60
 then
55
@@ -133,10 +149,24 @@
61
@@ -133,10 +149,13 @@
56
 	FLAGS="-${PORTLINT_FLAGS:-abt}"
62
 	FLAGS="-${PORTLINT_FLAGS:-abt}"
57
 	[ "${COMMITTER}" = "yes" ] && FLAGS="${FLAGS} -c"
63
 	[ "${COMMITTER}" = "yes" ] && FLAGS="${FLAGS} -c"
58
 	[ "${MODE}" = "new" ] && FLAGS="${FLAGS} -N"
64
 	[ "${MODE}" = "new" ] && FLAGS="${FLAGS} -N"
Lines 64-85 Link Here
64
+	else
70
+	else
65
+		cat ${TEMPROOT}/.portlint.out
71
+		cat ${TEMPROOT}/.portlint.out
66
 		echo "Error validating port"
72
 		echo "Error validating port"
67
+		if [ "$DIFF_MODE" = "CVSauto" ]
68
+		then
69
+			grep "^FATAL:" ${TEMPROOT}/.portlint.out > ${TEMPROOT}/.portlint.fatal
70
+			if ! egrep -qv '^FATAL:[[:space:]]+(file .+ not in CVS|CVS file .+ missing)' ${TEMPROOT}/.portlint.fatal
71
+			then
72
+				echo "All fatal portlint errors are CVS errors,"
73
+				echo "consider using portlint without the -c flag or"
74
+				echo "use 'port submit -L' if all portlint messages are"
75
+				echo "caused by your intentional addition/deletion of files"
76
+			fi
77
+		fi
78
+		rm -rf ${TEMPROOT}
73
+		rm -rf ${TEMPROOT}
79
 		exit 1
74
 		exit 1
80
 	fi
75
 	fi
81
 else
76
 else
82
@@ -146,6 +176,12 @@
77
@@ -146,6 +165,12 @@
83
 # Collect information about the port
78
 # Collect information about the port
84
 PORTNAME="`make -V PKGNAMEPREFIX``make -V PORTNAME``make -V PKGNAMESUFFIX`"
79
 PORTNAME="`make -V PKGNAMEPREFIX``make -V PORTNAME``make -V PKGNAMESUFFIX`"
85
 PORTVERSION="`make -V PORTVERSION`"
80
 PORTVERSION="`make -V PORTVERSION`"
Lines 92-98 Link Here
92
 PKGNAME="`make -V PKGNAME`"
87
 PKGNAME="`make -V PKGNAME`"
93
 CATEGORY="`make -V CATEGORIES | sed -E 's/^([^ ]+).*$/\1/'`"
88
 CATEGORY="`make -V CATEGORIES | sed -E 's/^([^ ]+).*$/\1/'`"
94
 MAINTAINER="`make -V MAINTAINER`"
89
 MAINTAINER="`make -V MAINTAINER`"
95
@@ -155,9 +191,6 @@
90
@@ -155,9 +180,6 @@
96
 RELEASE="`uname -srp`"
91
 RELEASE="`uname -srp`"
97
 SYSTEM="`uname -a | cut -d ' ' -f 1-12`"
92
 SYSTEM="`uname -a | cut -d ' ' -f 1-12`"
98
 
93
 
Lines 102-108 Link Here
102
 CC=""
97
 CC=""
103
 if [ "${MODE}" = "new" ]
98
 if [ "${MODE}" = "new" ]
104
 then
99
 then
105
@@ -194,10 +227,10 @@
100
@@ -194,10 +216,10 @@
106
 		# Override some parameters if submitting an update to a newer
101
 		# Override some parameters if submitting an update to a newer
107
 		# version of an existing port
102
 		# version of an existing port
108
 		CLASS="update"
103
 		CLASS="update"
Lines 116-122 Link Here
116
 	# Check to see if maintainership was requested
111
 	# Check to see if maintainership was requested
117
 	MAINT_CHANGE="`grep '^[+-]MAINTAINER' ${PATCH} | wc -l`"
112
 	MAINT_CHANGE="`grep '^[+-]MAINTAINER' ${PATCH} | wc -l`"
118
 	if [ ${MAINT_CHANGE} -eq 2 ]
113
 	if [ ${MAINT_CHANGE} -eq 2 ]
119
@@ -242,7 +275,12 @@
114
@@ -242,7 +264,12 @@
120
 fi
115
 fi
121
 
116
 
122
 # Generate Synopsis line
117
 # Generate Synopsis line
Lines 130-136 Link Here
130
 
125
 
131
 echo "===> Generating PR form"
126
 echo "===> Generating PR form"
132
 PR_FORM="${TEMPROOT}/PR"
127
 PR_FORM="${TEMPROOT}/PR"
133
@@ -266,9 +304,10 @@
128
@@ -266,9 +293,10 @@
134
 	SEND-PR: 	[ low | medium | high ]
129
 	SEND-PR: 	[ low | medium | high ]
135
 	>Category:	ports 
130
 	>Category:	ports 
136
 	SEND-PR: <choose from the list of categories below (one line)>
131
 	SEND-PR: <choose from the list of categories below (one line)>
Lines 144-150 Link Here
144
 	>Class:		${CLASS}
139
 	>Class:		${CLASS}
145
 	SEND-PR: [ sw-bug | doc-bug | change-request | update | maintainer-update ]
140
 	SEND-PR: [ sw-bug | doc-bug | change-request | update | maintainer-update ]
146
 	>Release:	${RELEASE}
141
 	>Release:	${RELEASE}
147
@@ -277,24 +316,33 @@
142
@@ -277,25 +305,15 @@
148
 	>Description:
143
 	>Description:
149
 EOF
144
 EOF
150
 
145
 
Lines 156-190 Link Here
156
 else
151
 else
157
 	echo -e ${DESCRIPTION} >> ${PR_FORM}
152
 	echo -e ${DESCRIPTION} >> ${PR_FORM}
158
 
153
 
159
+	MODESTRING="${MODESTRING}, diff: ${DIFF_TYPE}"
154
-	# Get list of added/removed files
160
 	# Get list of added/removed files
155
-	if [ "${DIFF_MODE}" = "CVS" ]
161
 	if [ "${DIFF_MODE}" = "CVS" ]
156
-	then
162
 	then
157
-		FILES_ADD=`grep --after-context=1 "^--- /dev/null" ${PATCH} | grep "^+++ " | awk '{print $2;}'`
163
 		FILES_ADD=`grep --after-context=1 "^--- /dev/null" ${PATCH} | grep "^+++ " | awk '{print $2;}'`
158
-		FILES_DEL=`grep --before-context=1 "^+++ /dev/null" ${PATCH} | grep "^--- " | awk '{print $2;}'`
164
 		FILES_DEL=`grep --before-context=1 "^+++ /dev/null" ${PATCH} | grep "^--- " | awk '{print $2;}'`
159
-	else
165
+	elif [ "${DIFF_MODE}" = "CVSauto" ]
166
+	then
167
+		FILES_ADD=`sed -n -e '/^diff -uN / { N;N;N;N;s/^diff -uN \(.*\)\.orig \1\n--- \1\.orig	[-+:.[:digit:] ]\{19,\}\n+++ \1	[-+:.[:digit:] ]\{19,\}\n@@ [-+,[:digit:] ]\{9,\} @@\n+.*$/\1/p; }' ${PATCH}`
168
+		FILES_DEL=`sed -n -e '/^diff -uN / { N;N;N;N;s/^diff -uN \(.*\)\.orig \1\n--- \1\.orig	[-+:.[:digit:] ]\{19,\}\n+++ \1	[-+:.[:digit:] ]\{19,\}\n@@ [-+,[:digit:] ]\{9,\} @@\n-.*$/\1/p; }' ${PATCH}`
169
 	else
170
-		TEMP=`mktemp -t porttools` || exit 1
160
-		TEMP=`mktemp -t porttools` || exit 1
171
-		find -s ${ORIG_DIR} -type f | sed -e "s#${ORIG_DIR}/##" > ${TEMP}
161
-		find -s ${ORIG_DIR} -type f | sed -e "s#${ORIG_DIR}/##" > ${TEMP}
172
-		CURR_DIR=`pwd`
162
-		CURR_DIR=`pwd`
173
-		FILES_ADD=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -23 - ${TEMP}`
163
-		FILES_ADD=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -23 - ${TEMP}`
174
-		FILES_DEL=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -13 - ${TEMP}`
164
-		FILES_DEL=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -13 - ${TEMP}`
175
-		rm -f ${TEMP}
165
-		rm -f ${TEMP}
176
+		TEMPORIG=`mktemp -t porttools` || exit 1
166
-	fi
177
+		TEMPNEW=`mktemp -t porttools` || exit 1
167
+	MODESTRING="${MODESTRING}, diff: ${DIFF_TYPE}"
178
+		CVS_FILTER="egrep -v /CVS/[^/]*$"
179
+		find -s ${ORIG_DIR} -type f | ${CVS_FILTER} | sed -e "s#^${ORIG_DIR}/##" > ${TEMPORIG}
180
+		find -s . -type f | ${CVS_FILTER} | sed -e "s#^\./##" > ${TEMPNEW}
181
+		FILES_ADD=`comm -13 ${TEMPORIG} ${TEMPNEW}`
182
+		FILES_DEL=`comm -23 ${TEMPORIG} ${TEMPNEW}`
183
+		rm -f ${TEMPORIG} ${TEMPNEW}
184
 	fi
185
 
168
 
186
 	if [ -n "${FILES_ADD}" ]
169
 	if [ -n "${FILES_ADD}" ]
187
@@ -326,14 +374,14 @@
170
 	then
171
@@ -326,14 +344,14 @@
188
 
172
 
189
 cat >> ${PR_FORM} <<- EOF
173
 cat >> ${PR_FORM} <<- EOF
190
 
174
 
(-)files/patch-port.1 (-10 / +33 lines)
Lines 1-16 Link Here
1
--- port.1.orig	2009-09-09 20:59:59.000000000 +0100
1
--- port.1.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ port.1	2012-03-04 12:04:12.799204352 +0000
2
+++ port.1	2012-12-27 19:26:53.000000000 +0900
3
@@ -125,6 +125,9 @@
3
@@ -123,8 +123,8 @@
4
 .It Fl d Ar mode
5
 select diff generation mode:
4
 .Bl -tag -width ".Pa suffix"
6
 .Bl -tag -width ".Pa suffix"
5
 .It CVS
7
-.It CVS
6
 diff against CVS repository (default).
8
-diff against CVS repository (default).
7
+.It CVSauto
9
+.It SVN
8
+diff against CVS repository, no cvs add/delete required.
10
+diff against SVN repository (default).
9
+Useful with read-only CVS servers that don't support add/delete.
10
 .It Pa dir
11
 .It Pa dir
11
 diff against original version of the port in the Ports tree with root at
12
 diff against original version of the port in the Ports tree with root at
12
 .Pa dir
13
 .Pa dir
13
@@ -215,6 +218,8 @@
14
@@ -141,10 +141,10 @@
15
 .Pp
16
 Example:
17
 .Pp
18
-.Dl % port diff -d CVS
19
+.Dl % port diff -d SVN
20
 .Pp
21
 This would generate unified diff of modified checked-out working copy 
22
-of the port against local or remote CVS repo.
23
+of the port against SVN repo.
24
 .It Ar fetch
25
 Fetch one or more distfiles of new or updated port version 
26
 and updates checksums.
27
@@ -215,6 +215,8 @@
14
 .Bl -tag -width ".Fl s Ar severity"
28
 .Bl -tag -width ".Fl s Ar severity"
15
 .It Fl h
29
 .It Fl h
16
 display usage summary for this command.
30
 display usage summary for this command.
Lines 19-25 Link Here
19
 .It Fl m Ar mode
33
 .It Fl m Ar mode
20
 Overrides automatic detection of operation mode:
34
 Overrides automatic detection of operation mode:
21
 .Bl -tag -width update
35
 .Bl -tag -width update
22
@@ -245,6 +250,10 @@
36
@@ -245,6 +247,10 @@
23
 Skips running
37
 Skips running
24
 .Xr portlint 1 .
38
 .Xr portlint 1 .
25
 Using this option will generate a warning and it strongly discouraged.
39
 Using this option will generate a warning and it strongly discouraged.
Lines 30-32 Link Here
30
 .El
44
 .El
31
 .It Ar test
45
 .It Ar test
32
 Automates the process of testing a new port (or a port update) 
46
 Automates the process of testing a new port (or a port update) 
47
@@ -347,7 +353,7 @@
48
 for detailed description of the format.
49
 .El
50
 .Sh SEE ALSO
51
-.Xr cvs 1 ,
52
+.Xr svn 1 ,
53
 .Xr cdiff 1 ,
54
 .Xr diff 1 ,
55
 .Xr more 1 ,
(-)files/patch-port.in (+11 lines)
Line 0 Link Here
1
--- port.in.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ port.in	2012-12-27 19:30:02.000000000 +0900
3
@@ -19,7 +19,7 @@
4
 	ORGANIZATION=""
5
 	BUILDROOT="/tmp"
6
 	ARCHIVE_DIR=""
7
-	DIFF_MODE="CVS"
8
+	DIFF_MODE="SVN"
9
 	DIFF_VIEWER="more"
10
 	PORTLINT_FLAGS="abct"
11
 	EOF

Return to bug 174860