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 |
|