Created
December 27, 2012 12:31
-
-
Save tota/4388025 to your computer and use it in GitHub Desktop.
Switch CVS to SVN in ports/ports-mgmt/porttools
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: Makefile | |
=================================================================== | |
--- Makefile (revision 309540) | |
+++ Makefile (working copy) | |
@@ -3,7 +3,7 @@ | |
PORTNAME= porttools | |
PORTVERSION= 0.99 | |
-PORTREVISION= 6 | |
+PORTREVISION= 7 | |
CATEGORIES= ports-mgmt | |
MASTER_SITES= SF | |
Index: files/patch-README | |
=================================================================== | |
--- files/patch-README (revision 0) | |
+++ files/patch-README (working copy) | |
@@ -0,0 +1,61 @@ | |
+--- README.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ README 2012-12-27 19:22:20.000000000 +0900 | |
+@@ -7,7 +7,7 @@ | |
+ | |
+ FreeBSD Port Tools consist of the several small scripts run from | |
+ port(1) front-end: | |
+-- port commit: commit a port into the FreeBSD Ports CVS Repository | |
++- port commit: commit a port into the FreeBSD Ports SVN Repository | |
+ - port create: create a new port from a template | |
+ - port diff: generate a diff against a previous version of the port | |
+ - port fetch: fetch distfile(s) of a new version of the port | |
+@@ -43,42 +43,35 @@ | |
+ Let us assume you are interested in helping out with one of the ports. | |
+ The most convenient way of doing that with the Port Tools is the following. | |
+ Even though the Port Tools have 3 most of diff generation, the recommended is | |
+-CVS (default). Do not be scared away at this point - it is very simple. | |
++SVN (default). Do not be scared away at this point - it is very simple. | |
+ Let me give a quick overview: | |
+ | |
+-1. Set up CVSROOT environment variable | |
+- | |
+- sgk@elf% export CVSROOT=":pserver:anoncvs@anoncvs.FreeBSD.org:/home/ncvs" | |
+- | |
+- NOTE: you may want to check the Handbook for a list of anonymous CVS servers | |
+- (http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/anoncvs.html). | |
+- | |
+-2. Check out a working copy of the port. I usually do it in ~/ports directory: | |
++1. Check out a working copy of the port. I usually do it in ~/ports directory: | |
+ (NOTE: my ~/ports directory contains only those ports I am interested in, | |
+ i.e. either maitain or send changes/updates to. Thus, it does not have | |
+ to contain the whole FreeBSD Ports tree) | |
+ | |
+ sgk@elf:~% cd ~/ports | |
+- sgk@elf:~/ports% cvs co ipsvd | |
++ sgk@elf:~/ports% svn co ipsvd | |
+ | |
+ ipsvd is the sample port name. | |
+ | |
+-3. Now, make your changes - e.g. change PORTVERSION from 0.6.0 to 0.6.1. | |
++2. Now, make your changes - e.g. change PORTVERSION from 0.6.0 to 0.6.1. | |
+ | |
+ sgk@elf:~/ports/ipsvd% cd ipsvd | |
+ sgk@elf:~/ports/ipsvd% vim Makefile | |
+ | |
+-4. At this moment we need to fetch the new distfile and run "make makesum" | |
++3. At this moment we need to fetch the new distfile and run "make makesum" | |
+ to update the distinfo file. There is even simpler way to accomplish this | |
+ with the Port Tools version 0.50 or later: | |
+ | |
+ sgk@elf:~/ports/ipsvd% port fetch | |
+ | |
+-5. Now we want to make sure that the port compiles, installs and works fine: | |
++4. Now we want to make sure that the port compiles, installs and works fine: | |
+ | |
+ sgk@elf:~/ports/ipsvd% port test | |
+ | |
+-6. Once I am satisfied with the results, let us submit a PR | |
++5. Once I am satisfied with the results, let us submit a PR | |
+ with the port update: | |
+ | |
+ sgk@elf:~/ports/ipsvd% port submit | |
Property changes on: files/patch-README | |
___________________________________________________________________ | |
Added: svn:mime-type | |
## -0,0 +1 ## | |
+text/plain | |
\ No newline at end of property | |
Added: fbsd:nokeywords | |
## -0,0 +1 ## | |
+yes | |
\ No newline at end of property | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: files/patch-cmd_commit.in | |
=================================================================== | |
--- files/patch-cmd_commit.in (revision 0) | |
+++ files/patch-cmd_commit.in (working copy) | |
@@ -0,0 +1,59 @@ | |
+--- cmd_commit.in.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ cmd_commit.in 2012-12-27 19:44:56.000000000 +0900 | |
+@@ -1,6 +1,6 @@ | |
+ # cmd_commit | |
+ # Module for port(1) | |
+-# SUMMARY: commit a port into the FreeBSD Ports CVS Repository | |
++# SUMMARY: commit a port into the FreeBSD Ports SVN Repository | |
+ # | |
+ # $Id: cmd_commit.in,v 1.2 2009/09/09 19:58:30 skolobov Exp $ | |
+ # | |
+@@ -65,7 +65,7 @@ | |
+ echo "===> Pre-commit portlint check" | |
+ FLAGS="-C" | |
+ [ "${MODE}" = "new" ] && FLAGS="${FLAGS} -N" | |
+-PL_CVS_IGNORE='^\d+$|^pr-patch$|^cvs-msg$' \ | |
++PL_SVN_IGNORE='^\d+$|^pr-patch$|^svn-msg$' \ | |
+ portlint ${FLAGS} | |
+ if [ $? -ne 0 ] | |
+ then | |
+@@ -79,15 +79,12 @@ | |
+ then | |
+ ${PORTSDIR}/Tools/scripts/addport -d `pwd` -u ${FREEFALL_USERNAME} | |
+ else | |
+- # Initialize CVS environment | |
+- PCVS="cvs -d ${FREEFALL_USERNAME}@pcvs.FreeBSD.org:/home/pcvs" | |
+- | |
+ # Make sure we are working with up-to-date version | |
+- echo "===> Pre-commit CVS update" | |
+- ${PCVS} update | |
++ echo "===> Pre-commit SVN update" | |
++ svn update | |
+ | |
+- # See if CVS message already exists, and use that for commit log | |
+- MSG="cvs-msg" | |
++ # See if SVN message already exists, and use that for commit log | |
++ MSG="svn-msg" | |
+ FLAGS="" | |
+ if [ -e ${MSG} ] | |
+ then | |
+@@ -99,16 +96,16 @@ | |
+ echo '=============================================' | |
+ cat ${MSG} | |
+ echo '=============================================' | |
+- read -p "Is the CVS message above correct? (y/n)" ANSWER | |
++ read -p "Is the SVN message above correct? (y/n)" ANSWER | |
+ [ "${ANSWER}" = "y" ] && break | |
+ ${VISUAL:-vi} ${MSG} | |
+ done | |
+ fi | |
+ # Commit the port update | |
+ echo "===> Committing port update" | |
+- ${PCVS} commit ${FLAGS} | |
++ svn commit ${FLAGS} | |
+ | |
+- # Remove CVS message file only if commit was successful | |
++ # Remove SVN message file only if commit was successful | |
+ [ $? -eq 0 -a -e ${MSG} ] && rm ${MSG} | |
+ fi | |
+ | |
Property changes on: files/patch-cmd_commit.in | |
___________________________________________________________________ | |
Added: svn:mime-type | |
## -0,0 +1 ## | |
+text/plain | |
\ No newline at end of property | |
Added: fbsd:nokeywords | |
## -0,0 +1 ## | |
+yes | |
\ No newline at end of property | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: files/patch-cmd_diff.in | |
=================================================================== | |
--- files/patch-cmd_diff.in (revision 309540) | |
+++ files/patch-cmd_diff.in (working copy) | |
@@ -1,10 +1,11 @@ | |
---- cmd_diff.in.orig 2009-09-09 21:59:59.000000000 +0200 | |
-+++ cmd_diff.in 2009-10-25 16:28:14.000000000 +0100 | |
-@@ -21,6 +21,7 @@ | |
+--- cmd_diff.in.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ cmd_diff.in 2012-12-27 20:13:30.000000000 +0900 | |
+@@ -20,7 +20,7 @@ | |
+ Usage: port diff [-h] [-d <diff mode>] | |
-h - Display this usage summary | |
-d <diff mode> - Select diff generation mode: | |
- CVS - against CVS | |
-+ CVSauto - against CVS, no cvs add/delete required | |
+- CVS - against CVS | |
++ SVN - against SVN | |
<dir> - against Ports tree in <dir> | |
<pattern> - against original port in <pwd><pattern> | |
EOF | |
Index: files/patch-cmd_submit.in | |
=================================================================== | |
--- files/patch-cmd_submit.in (revision 309540) | |
+++ files/patch-cmd_submit.in (working copy) | |
@@ -1,10 +1,11 @@ | |
---- cmd_submit.in.orig 2009-09-09 20:59:59.000000000 +0100 | |
-+++ cmd_submit.in 2012-03-04 12:02:36.697273154 +0000 | |
-@@ -26,10 +26,12 @@ | |
+--- cmd_submit.in.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ cmd_submit.in 2012-12-27 19:13:58.000000000 +0900 | |
+@@ -25,11 +25,12 @@ | |
+ change - changing a port | |
update - updating a port to newer version | |
-d <diff mode> - Select diff generation mode: | |
- CVS - against CVS | |
-+ CVSauto - against CVS, no cvs add/delete required | |
+- CVS - against CVS | |
++ SVN - against SVN | |
<dir> - against Ports tree in <dir> | |
<pattern> - against original port in <pwd><pattern> | |
-s <severity> - Set PR's severity to <severity> | |
@@ -13,7 +14,7 @@ | |
-c - committer mode: more portlint(1) checks | |
-L - Skip running portlint(1) | |
EOF | |
-@@ -41,9 +43,10 @@ | |
+@@ -41,9 +42,10 @@ | |
PRIORITY="low" | |
COMMITTER="no" | |
RUN_PORTLINT="yes" | |
@@ -25,7 +26,7 @@ | |
if [ $? != 0 ] | |
then | |
echo "Error: invalid arguments" | |
-@@ -116,6 +119,10 @@ | |
+@@ -116,6 +118,10 @@ | |
-L) | |
RUN_PORTLINT="no" | |
;; | |
@@ -36,13 +37,13 @@ | |
esac | |
shift | |
done | |
-@@ -126,6 +133,15 @@ | |
+@@ -126,6 +132,15 @@ | |
[ "`grep '\$FreeBSD: ' Makefile`" ] || MODE="new" | |
fi | |
+# util_diff will set | |
+# - PORTBASENAME if PORTNAME != port's directory name | |
-+# - DIFF_TYPE to CVS, CVSauto, ports, or suffix | |
++# - DIFF_TYPE to SVN, ports, or suffix | |
+PORTBASENAME="" | |
+DIFF_TYPE="" | |
+ | |
@@ -52,7 +53,7 @@ | |
# Run portlint(1) to validate port's sanity | |
if [ "${RUN_PORTLINT}" = "yes" ] | |
then | |
-@@ -133,10 +149,24 @@ | |
+@@ -133,10 +148,13 @@ | |
FLAGS="-${PORTLINT_FLAGS:-abt}" | |
[ "${COMMITTER}" = "yes" ] && FLAGS="${FLAGS} -c" | |
[ "${MODE}" = "new" ] && FLAGS="${FLAGS} -N" | |
@@ -64,22 +65,11 @@ | |
+ else | |
+ cat ${TEMPROOT}/.portlint.out | |
echo "Error validating port" | |
-+ if [ "$DIFF_MODE" = "CVSauto" ] | |
-+ then | |
-+ grep "^FATAL:" ${TEMPROOT}/.portlint.out > ${TEMPROOT}/.portlint.fatal | |
-+ if ! egrep -qv '^FATAL:[[:space:]]+(file .+ not in CVS|CVS file .+ missing)' ${TEMPROOT}/.portlint.fatal | |
-+ then | |
-+ echo "All fatal portlint errors are CVS errors," | |
-+ echo "consider using portlint without the -c flag or" | |
-+ echo "use 'port submit -L' if all portlint messages are" | |
-+ echo "caused by your intentional addition/deletion of files" | |
-+ fi | |
-+ fi | |
+ rm -rf ${TEMPROOT} | |
exit 1 | |
fi | |
else | |
-@@ -146,6 +176,12 @@ | |
+@@ -146,6 +164,12 @@ | |
# Collect information about the port | |
PORTNAME="`make -V PKGNAMEPREFIX``make -V PORTNAME``make -V PKGNAMESUFFIX`" | |
PORTVERSION="`make -V PORTVERSION`" | |
@@ -92,7 +82,7 @@ | |
PKGNAME="`make -V PKGNAME`" | |
CATEGORY="`make -V CATEGORIES | sed -E 's/^([^ ]+).*$/\1/'`" | |
MAINTAINER="`make -V MAINTAINER`" | |
-@@ -155,9 +191,6 @@ | |
+@@ -155,9 +179,6 @@ | |
RELEASE="`uname -srp`" | |
SYSTEM="`uname -a | cut -d ' ' -f 1-12`" | |
@@ -102,7 +92,7 @@ | |
CC="" | |
if [ "${MODE}" = "new" ] | |
then | |
-@@ -194,10 +227,10 @@ | |
+@@ -194,10 +215,10 @@ | |
# Override some parameters if submitting an update to a newer | |
# version of an existing port | |
CLASS="update" | |
@@ -116,7 +106,7 @@ | |
# Check to see if maintainership was requested | |
MAINT_CHANGE="`grep '^[+-]MAINTAINER' ${PATCH} | wc -l`" | |
if [ ${MAINT_CHANGE} -eq 2 ] | |
-@@ -242,7 +275,12 @@ | |
+@@ -242,7 +263,12 @@ | |
fi | |
# Generate Synopsis line | |
@@ -130,7 +120,7 @@ | |
echo "===> Generating PR form" | |
PR_FORM="${TEMPROOT}/PR" | |
-@@ -266,9 +304,10 @@ | |
+@@ -266,9 +292,10 @@ | |
SEND-PR: [ low | medium | high ] | |
>Category: ports | |
SEND-PR: <choose from the list of categories below (one line)> | |
@@ -144,7 +134,7 @@ | |
>Class: ${CLASS} | |
SEND-PR: [ sw-bug | doc-bug | change-request | update | maintainer-update ] | |
>Release: ${RELEASE} | |
-@@ -277,24 +316,33 @@ | |
+@@ -277,25 +304,15 @@ | |
>Description: | |
EOF | |
@@ -156,35 +146,24 @@ | |
else | |
echo -e ${DESCRIPTION} >> ${PR_FORM} | |
-+ MODESTRING="${MODESTRING}, diff: ${DIFF_TYPE}" | |
- # Get list of added/removed files | |
- if [ "${DIFF_MODE}" = "CVS" ] | |
- then | |
- FILES_ADD=`grep --after-context=1 "^--- /dev/null" ${PATCH} | grep "^+++ " | awk '{print $2;}'` | |
- FILES_DEL=`grep --before-context=1 "^+++ /dev/null" ${PATCH} | grep "^--- " | awk '{print $2;}'` | |
-+ elif [ "${DIFF_MODE}" = "CVSauto" ] | |
-+ then | |
-+ 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}` | |
-+ 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}` | |
- else | |
+- # Get list of added/removed files | |
+- if [ "${DIFF_MODE}" = "CVS" ] | |
+- then | |
+- FILES_ADD=`grep --after-context=1 "^--- /dev/null" ${PATCH} | grep "^+++ " | awk '{print $2;}'` | |
+- FILES_DEL=`grep --before-context=1 "^+++ /dev/null" ${PATCH} | grep "^--- " | awk '{print $2;}'` | |
+- else | |
- TEMP=`mktemp -t porttools` || exit 1 | |
- find -s ${ORIG_DIR} -type f | sed -e "s#${ORIG_DIR}/##" > ${TEMP} | |
- CURR_DIR=`pwd` | |
- FILES_ADD=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -23 - ${TEMP}` | |
- FILES_DEL=`find -s ${CURR_DIR} -type f | sed -e "s#${CURR_DIR}/##" | comm -13 - ${TEMP}` | |
- rm -f ${TEMP} | |
-+ TEMPORIG=`mktemp -t porttools` || exit 1 | |
-+ TEMPNEW=`mktemp -t porttools` || exit 1 | |
-+ CVS_FILTER="egrep -v /CVS/[^/]*$" | |
-+ find -s ${ORIG_DIR} -type f | ${CVS_FILTER} | sed -e "s#^${ORIG_DIR}/##" > ${TEMPORIG} | |
-+ find -s . -type f | ${CVS_FILTER} | sed -e "s#^\./##" > ${TEMPNEW} | |
-+ FILES_ADD=`comm -13 ${TEMPORIG} ${TEMPNEW}` | |
-+ FILES_DEL=`comm -23 ${TEMPORIG} ${TEMPNEW}` | |
-+ rm -f ${TEMPORIG} ${TEMPNEW} | |
- fi | |
+- fi | |
++ MODESTRING="${MODESTRING}, diff: ${DIFF_TYPE}" | |
if [ -n "${FILES_ADD}" ] | |
-@@ -326,14 +374,14 @@ | |
+ then | |
+@@ -326,14 +343,14 @@ | |
cat >> ${PR_FORM} <<- EOF | |
Index: files/patch-port.1 | |
=================================================================== | |
--- files/patch-port.1 (revision 309540) | |
+++ files/patch-port.1 (working copy) | |
@@ -1,16 +1,30 @@ | |
---- port.1.orig 2009-09-09 20:59:59.000000000 +0100 | |
-+++ port.1 2012-03-04 12:04:12.799204352 +0000 | |
-@@ -125,6 +125,9 @@ | |
+--- port.1.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ port.1 2012-12-27 19:26:53.000000000 +0900 | |
+@@ -123,8 +123,8 @@ | |
+ .It Fl d Ar mode | |
+ select diff generation mode: | |
.Bl -tag -width ".Pa suffix" | |
- .It CVS | |
- diff against CVS repository (default). | |
-+.It CVSauto | |
-+diff against CVS repository, no cvs add/delete required. | |
-+Useful with read-only CVS servers that don't support add/delete. | |
+-.It CVS | |
+-diff against CVS repository (default). | |
++.It SVN | |
++diff against SVN repository (default). | |
.It Pa dir | |
diff against original version of the port in the Ports tree with root at | |
.Pa dir | |
-@@ -215,6 +218,8 @@ | |
+@@ -141,10 +141,10 @@ | |
+ .Pp | |
+ Example: | |
+ .Pp | |
+-.Dl % port diff -d CVS | |
++.Dl % port diff -d SVN | |
+ .Pp | |
+ This would generate unified diff of modified checked-out working copy | |
+-of the port against local or remote CVS repo. | |
++of the port against SVN repo. | |
+ .It Ar fetch | |
+ Fetch one or more distfiles of new or updated port version | |
+ and updates checksums. | |
+@@ -215,6 +215,8 @@ | |
.Bl -tag -width ".Fl s Ar severity" | |
.It Fl h | |
display usage summary for this command. | |
@@ -19,7 +33,7 @@ | |
.It Fl m Ar mode | |
Overrides automatic detection of operation mode: | |
.Bl -tag -width update | |
-@@ -245,6 +250,10 @@ | |
+@@ -245,6 +247,10 @@ | |
Skips running | |
.Xr portlint 1 . | |
Using this option will generate a warning and it strongly discouraged. | |
@@ -30,3 +44,12 @@ | |
.El | |
.It Ar test | |
Automates the process of testing a new port (or a port update) | |
+@@ -347,7 +353,7 @@ | |
+ for detailed description of the format. | |
+ .El | |
+ .Sh SEE ALSO | |
+-.Xr cvs 1 , | |
++.Xr svn 1 , | |
+ .Xr cdiff 1 , | |
+ .Xr diff 1 , | |
+ .Xr more 1 , | |
Index: files/patch-port.in | |
=================================================================== | |
--- files/patch-port.in (revision 0) | |
+++ files/patch-port.in (working copy) | |
@@ -0,0 +1,11 @@ | |
+--- port.in.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ port.in 2012-12-27 19:30:02.000000000 +0900 | |
+@@ -19,7 +19,7 @@ | |
+ ORGANIZATION="" | |
+ BUILDROOT="/tmp" | |
+ ARCHIVE_DIR="" | |
+- DIFF_MODE="CVS" | |
++ DIFF_MODE="SVN" | |
+ DIFF_VIEWER="more" | |
+ PORTLINT_FLAGS="abct" | |
+ EOF | |
Property changes on: files/patch-port.in | |
___________________________________________________________________ | |
Added: svn:mime-type | |
## -0,0 +1 ## | |
+text/plain | |
\ No newline at end of property | |
Added: fbsd:nokeywords | |
## -0,0 +1 ## | |
+yes | |
\ No newline at end of property | |
Added: svn:eol-style | |
## -0,0 +1 ## | |
+native | |
\ No newline at end of property | |
Index: files/patch-porttools.5 | |
=================================================================== | |
--- files/patch-porttools.5 (revision 309540) | |
+++ files/patch-porttools.5 (working copy) | |
@@ -1,11 +1,11 @@ | |
---- porttools.5.orig 2009-09-09 21:59:59.000000000 +0200 | |
-+++ porttools.5 2009-10-25 19:09:02.000000000 +0100 | |
+--- porttools.5.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ porttools.5 2012-12-27 19:46:53.000000000 +0900 | |
@@ -51,7 +51,7 @@ | |
Default to | |
.Pa /tmp . | |
.It Ev DIFF_MODE | |
-Selects diff generation mode. Valid values are: CVS, directory | |
-+Selects diff generation mode. Valid values are: CVS, CVSauto, directory | |
++Selects diff generation mode. Valid values are: SVN, directory | |
.Pq e.g. Pa /usr/ports , | |
or suffix | |
.Pq e.g. Pa .orig . | |
Index: files/patch-util_diff.in | |
=================================================================== | |
--- files/patch-util_diff.in (revision 309540) | |
+++ files/patch-util_diff.in (working copy) | |
@@ -1,6 +1,6 @@ | |
---- ./util_diff.in.orig 2009-09-09 21:59:59.000000000 +0200 | |
-+++ ./util_diff.in 2011-11-28 21:54:50.000000000 +0100 | |
-@@ -37,49 +37,122 @@ | |
+--- util_diff.in.orig 2009-09-10 04:59:59.000000000 +0900 | |
++++ util_diff.in 2012-12-27 20:08:23.000000000 +0900 | |
+@@ -37,49 +37,96 @@ | |
fi | |
cd ${SAVE_CWD} | |
else | |
@@ -14,25 +14,20 @@ | |
+ if [ "${DIFF_MODE}" = "" ] | |
then | |
- DIFF_MODE="/usr/ports" | |
-+ if [ -d CVS ] | |
++ if [ -d /usr/ports/.svn ] | |
+ then | |
-+ if grep -iq ":pserver:anoncvs@anoncvs.fr.FreeBSD.org:" CVS/Root | |
-+ then | |
-+ DIFF_MODE="CVSauto" | |
-+ else | |
-+ DIFF_MODE="CVS" | |
-+ fi | |
++ DIFF_MODE="SVN" | |
+ else | |
+ DIFF_MODE="/usr/ports" | |
+ fi | |
+ echo "Default diff mode is ${DIFF_MODE}" | |
-+ elif [ "${DIFF_MODE}" = "CVS" -o "${DIFF_MODE}" = "CVSauto" ] | |
++ elif [ "${DIFF_MODE}" = "SVN" ] | |
+ then | |
-+ # If there is no CVS subdirectory then | |
++ # If there is no .svn directory then | |
+ # fallback to diffing against /usr/ports tree | |
-+ if [ ! -d CVS ] | |
++ if [ ! -d /usr/ports/.svn ] | |
+ then | |
-+ echo "Diff mode was set to ${DIFF_MODE}, but there's no CVS subdirectory" | |
++ echo "Diff mode was set to ${DIFF_MODE}, but there's no .svn directory" | |
+ echo -n "Trying /usr/ports ... " | |
+ if [ -d /usr/ports ] | |
+ then | |
@@ -47,48 +42,33 @@ | |
fi | |
- if [ "${DIFF_MODE}" = "CVS" ] | |
-+ if [ "${DIFF_MODE}" = "CVS" -o "${DIFF_MODE}" = "CVSauto" ] | |
++ if [ "${DIFF_MODE}" = "SVN" ] | |
then | |
+- # Test for ~/.cvspass and create if necessary | |
+- test -f ${HOME}/.cvspass || touch ${HOME}/.cvspass | |
+ DIFF_TYPE=${DIFF_MODE} | |
- # Test for ~/.cvspass and create if necessary | |
- test -f ${HOME}/.cvspass || touch ${HOME}/.cvspass | |
- # Run 'cvs update' first | |
- echo "===> Updating from CVS" | |
+- # Run 'cvs update' first | |
+- echo "===> Updating from CVS" | |
- cvs -R update -Pd | |
- if [ $? -ne 0 ] | |
-+ if [ "${DIFF_MODE}" = "CVSauto" ] | |
-+ then | |
-+ cvs -R update -Pd 2> ${TEMPROOT}/.cvs.err > ${TEMPROOT}/.cvs.out | |
-+ status=$? | |
-+ cat ${TEMPROOT}/.cvs.err ${TEMPROOT}/.cvs.out | |
-+ else | |
-+ cvs -R update -Pd | |
-+ status=$? | |
-+ fi | |
++ # Run 'svn update' first | |
++ echo "===> Updating from SVN" | |
++ svn update | |
++ status=$? | |
+ if [ $status -ne 0 ] | |
then | |
- echo "Error updating CVS" | |
+- echo "Error updating CVS" | |
++ echo "Error updating SVN" | |
rm -rf ${TEMPROOT} | |
exit 1 | |
fi | |
- | |
- DIFF_CMD="cvs -R diff -uN" | |
-+ PORTBASENAME=`sed -E -e 's%.*/([^/]+)$%\1%' CVS/Repository` | |
-+ if [ "${DIFF_MODE}" = "CVSauto" ] | |
-+ then | |
-+ sort -k 2,666 ${TEMPROOT}/.cvs.out | \ | |
-+ sed -nE -e 's/^[?A] (.*)$/echo "diff -uN \1.orig \1" \&\& diff -uN "\1.orig" "\1" /p' \ | |
-+ -e 's/^U (.*)$/mv "\1" "\1.orig" \&\& echo "diff -uN \1.orig \1" \&\& diff -uN "\1.orig" "\1" ; rm "\1.orig"/p' \ | |
-+ -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' \ | |
-+ -e 's/^M (.*)$/cvs -R diff -u "\1"/p' \ | |
-+ > ${TEMPROOT}/.cvs.diff_cmd | |
-+ DIFF_CMD="sh -x ${TEMPROOT}/.cvs.diff_cmd" | |
-+ else | |
-+ DIFF_CMD="cvs -R diff -uN" | |
-+ fi | |
++ DIFF_CMD="svn diff" | |
else | |
- # Non-CVS modes | |
+- # Non-CVS modes | |
++ # Non-SVN modes | |
+ DIRBASENAME=`basename \`pwd\`` | |
+ PORTBASENAME_HEADER=`sed -n -E -e '1,/^($|[^#].*$)|\\$FreeBSD\:/s%^#.*\\$FreeBSD\:[[:space:]]*([^/]+/)*([^/]+)/Makefile.*\\$%\2%p' Makefile` | |
+ if [ "${DIRBASENAME}" != "${PORTBASENAME_HEADER}" ] | |
@@ -141,12 +121,12 @@ | |
fi | |
# Check to see if the original version of port exist | |
-@@ -90,7 +163,7 @@ | |
+@@ -90,7 +137,7 @@ | |
exit 1 | |
fi | |
- DIFF_CMD="diff -ruN --exclude=CVS ${ORIG_DIR} `pwd`" | |
-+ DIFF_CMD="diff -ruN --exclude=CVS ${ORIG_DIR} ." | |
++ DIFF_CMD="diff -ruN ${ORIG_DIR} ." | |
fi | |
# Generate patch | |
Index: pkg-descr | |
=================================================================== | |
--- pkg-descr (revision 309540) | |
+++ pkg-descr (working copy) | |
@@ -6,4 +6,4 @@ | |
- port submit: submit a PR with new port, or port change/update | |
- port test: automate testing a new port or a port update | |
-WWW: http://sourceforge.net/projects/porttools/ | |
+WWW: http://sourceforge.net/projects/porttools/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment