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

Collapse All | Expand All

(-)files/patch-porttools.5 (-3 / +3 lines)
Lines 1-11 Link Here
1
--- porttools.5.orig	2009-09-09 21:59:59.000000000 +0200
1
--- porttools.5.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ porttools.5	2009-10-25 19:09:02.000000000 +0100
2
+++ porttools.5	2012-12-27 19:46:53.000000000 +0900
3
@@ -51,7 +51,7 @@
3
@@ -51,7 +51,7 @@
4
 Default to
4
 Default to
5
 .Pa /tmp .
5
 .Pa /tmp .
6
 .It Ev DIFF_MODE
6
 .It Ev DIFF_MODE
7
-Selects diff generation mode. Valid values are: CVS, directory
7
-Selects diff generation mode. Valid values are: CVS, directory
8
+Selects diff generation mode. Valid values are: CVS, CVSauto, directory
8
+Selects diff generation mode. Valid values are: SVN, directory
9
 .Pq e.g. Pa /usr/ports ,
9
 .Pq e.g. Pa /usr/ports ,
10
 or suffix
10
 or suffix
11
 .Pq e.g. Pa .orig .
11
 .Pq e.g. Pa .orig .
(-)files/patch-util_diff.in (-45 / +35 lines)
Lines 1-6 Link Here
1
--- ./util_diff.in.orig	2009-09-09 21:59:59.000000000 +0200
1
--- util_diff.in.orig	2009-09-10 04:59:59.000000000 +0900
2
+++ ./util_diff.in	2011-11-28 21:54:50.000000000 +0100
2
+++ util_diff.in	2012-12-31 21:44:44.000000000 +0900
3
@@ -37,49 +37,122 @@
3
@@ -14,7 +14,8 @@
4
 # Determine if this is a new port
5
 if [ "${MODE}" = "" ]
6
 then
7
-	[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
8
+	svn status Makefile 2>&1 1>/dev/null | grep -qs 'svn: warning: W155007:'
9
+	[ $? -eq 0 ] || [ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new"
10
 fi
11
 
12
 # Create a temporary dir for generated files (patch/shar, PR form)
13
@@ -37,49 +38,96 @@
4
 	fi
14
 	fi
5
 	cd ${SAVE_CWD}
15
 	cd ${SAVE_CWD}
6
 else
16
 else
Lines 14-38 Link Here
14
+	if [ "${DIFF_MODE}" = "" ]
24
+	if [ "${DIFF_MODE}" = "" ]
15
 	then
25
 	then
16
-		DIFF_MODE="/usr/ports"
26
-		DIFF_MODE="/usr/ports"
17
+		if [ -d CVS ]
27
+		if [ -d /usr/ports/.svn ]
18
+		then
28
+		then
19
+			if grep -iq ":pserver:anoncvs@anoncvs.fr.FreeBSD.org:" CVS/Root
29
+			DIFF_MODE="SVN"
20
+			then
21
+				DIFF_MODE="CVSauto"
22
+			else
23
+				DIFF_MODE="CVS"
24
+			fi
25
+		else
30
+		else
26
+			DIFF_MODE="/usr/ports"
31
+			DIFF_MODE="/usr/ports"
27
+		fi
32
+		fi
28
+		echo "Default diff mode is ${DIFF_MODE}"
33
+		echo "Default diff mode is ${DIFF_MODE}"
29
+	elif [ "${DIFF_MODE}" = "CVS" -o "${DIFF_MODE}" = "CVSauto" ]
34
+	elif [ "${DIFF_MODE}" = "SVN" ]
30
+	then
35
+	then
31
+		# If there is no CVS subdirectory then
36
+		# If there is no .svn directory then
32
+		# fallback to diffing against /usr/ports tree
37
+		# fallback to diffing against /usr/ports tree
33
+		if [ ! -d CVS ]
38
+		if [ ! -d /usr/ports/.svn ]
34
+		then
39
+		then
35
+			echo "Diff mode was set to ${DIFF_MODE}, but there's no CVS subdirectory"
40
+			echo "Diff mode was set to ${DIFF_MODE}, but there's no .svn directory"
36
+			echo -n "Trying /usr/ports ... "
41
+			echo -n "Trying /usr/ports ... "
37
+			if [ -d /usr/ports ]
42
+			if [ -d /usr/ports ]
38
+			then
43
+			then
Lines 47-94 Link Here
47
 	fi
52
 	fi
48
 
53
 
49
-	if [ "${DIFF_MODE}" = "CVS" ]
54
-	if [ "${DIFF_MODE}" = "CVS" ]
50
+	if [ "${DIFF_MODE}" = "CVS" -o "${DIFF_MODE}" = "CVSauto" ]
55
+	if [ "${DIFF_MODE}" = "SVN" ]
51
 	then
56
 	then
57
-		# Test for ~/.cvspass and create if necessary
58
-		test -f ${HOME}/.cvspass || touch ${HOME}/.cvspass
52
+		DIFF_TYPE=${DIFF_MODE}
59
+		DIFF_TYPE=${DIFF_MODE}
53
 		# Test for ~/.cvspass and create if necessary
54
 		test -f ${HOME}/.cvspass || touch ${HOME}/.cvspass
55
 
60
 
56
 		# Run 'cvs update' first
61
-		# Run 'cvs update' first
57
 		echo "===> Updating from CVS"
62
-		echo "===> Updating from CVS"
58
-		cvs -R update -Pd
63
-		cvs -R update -Pd
59
-		if [ $? -ne 0 ]
64
-		if [ $? -ne 0 ]
60
+		if [ "${DIFF_MODE}" = "CVSauto" ]
65
+		# Run 'svn update' first
61
+		then
66
+		echo "===> Updating from SVN"
62
+			cvs -R update -Pd 2> ${TEMPROOT}/.cvs.err > ${TEMPROOT}/.cvs.out
67
+		svn update
63
+			status=$?
68
+		status=$?
64
+			cat ${TEMPROOT}/.cvs.err ${TEMPROOT}/.cvs.out
65
+		else
66
+			cvs -R update -Pd
67
+			status=$?
68
+		fi
69
+		if [ $status -ne 0 ]
69
+		if [ $status -ne 0 ]
70
 		then
70
 		then
71
 			echo "Error updating CVS"
71
-			echo "Error updating CVS"
72
+			echo "Error updating SVN"
72
 			rm -rf ${TEMPROOT}
73
 			rm -rf ${TEMPROOT}
73
 			exit 1
74
 			exit 1
74
 		fi
75
 		fi
75
-
76
-
76
-		DIFF_CMD="cvs -R diff -uN"
77
-		DIFF_CMD="cvs -R diff -uN"
77
+		PORTBASENAME=`sed -E -e 's%.*/([^/]+)$%\1%' CVS/Repository`
78
+		DIFF_CMD="svn diff"
78
+		if [ "${DIFF_MODE}" = "CVSauto" ]
79
+		then
80
+			sort -k 2,666 ${TEMPROOT}/.cvs.out | \
81
+			sed -nE	-e 's/^[?A] (.*)$/echo "diff -uN \1.orig \1" \&\& diff -uN "\1.orig" "\1" /p' \
82
+				-e 's/^U (.*)$/mv "\1" "\1.orig" \&\& echo "diff -uN \1.orig \1" \&\& diff -uN "\1.orig" "\1" ; rm "\1.orig"/p' \
83
+				-e 's/^R (.*)$/cvs -R -q update -p "\1" > "\1.orig" \&\& echo "diff -uN \1.orig \1" \&\& diff -uN "\1.orig" "\1" ; rm "\1.orig"/p' \
84
+				-e 's/^M (.*)$/cvs -R diff -u "\1"/p' \
85
+				> ${TEMPROOT}/.cvs.diff_cmd
86
+			DIFF_CMD="sh -x ${TEMPROOT}/.cvs.diff_cmd"
87
+		else
88
+			DIFF_CMD="cvs -R diff -uN"
89
+		fi
90
 	else 
79
 	else 
91
 		# Non-CVS modes
80
-		# Non-CVS modes
81
+		# Non-SVN modes
92
+		DIRBASENAME=`basename \`pwd\``
82
+		DIRBASENAME=`basename \`pwd\``
93
+		PORTBASENAME_HEADER=`sed -n -E -e '1,/^($|[^#].*$)|\\$FreeBSD\:/s%^#.*\\$FreeBSD\:[[:space:]]*([^/]+/)*([^/]+)/Makefile.*\\$%\2%p' Makefile`
83
+		PORTBASENAME_HEADER=`sed -n -E -e '1,/^($|[^#].*$)|\\$FreeBSD\:/s%^#.*\\$FreeBSD\:[[:space:]]*([^/]+/)*([^/]+)/Makefile.*\\$%\2%p' Makefile`
94
+		if [ "${DIRBASENAME}" != "${PORTBASENAME_HEADER}" ]
84
+		if [ "${DIRBASENAME}" != "${PORTBASENAME_HEADER}" ]
Lines 141-152 Link Here
141
 		fi
131
 		fi
142
 
132
 
143
 		# Check to see if the original version of port exist 
133
 		# Check to see if the original version of port exist 
144
@@ -90,7 +163,7 @@
134
@@ -90,7 +138,7 @@
145
 			exit 1
135
 			exit 1
146
 		fi
136
 		fi
147
 		
137
 		
148
-		DIFF_CMD="diff -ruN --exclude=CVS ${ORIG_DIR} `pwd`"
138
-		DIFF_CMD="diff -ruN --exclude=CVS ${ORIG_DIR} `pwd`"
149
+		DIFF_CMD="diff -ruN --exclude=CVS ${ORIG_DIR} ."
139
+		DIFF_CMD="diff -ruN ${ORIG_DIR} ."
150
 	fi
140
 	fi
151
 
141
 
152
 	# Generate patch
142
 	# Generate patch
(-)pkg-descr (-1 / +1 lines)
Lines 6-9 Link Here
6
- port submit: submit a PR with new port, or port change/update
6
- port submit: submit a PR with new port, or port change/update
7
- port test: automate testing a new port or a port update
7
- port test: automate testing a new port or a port update
8
8
9
WWW:	http://sourceforge.net/projects/porttools/
9
WWW: http://sourceforge.net/projects/porttools/

Return to bug 174860