summaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2012-05-02 18:32:30 +0000
committerChris Rees <crees@FreeBSD.org>2012-05-02 18:32:30 +0000
commitdd16d151dbe6688a95aa2b0b9685d973cb24c011 (patch)
treee84cf93992e03c9194911a66172bbc4fa053af4a /Tools
parentUpdate to 2.11.1. (diff)
Take maintainership-- thanks to vd for his past work on this script
Approved by: vd (maintainer) - Make the diff output work - Use cdiff if exists, otherwise stick with $EDITOR - Stop trying to remove CVSROOT; hasn't been checked out since modules support was removed by erwin
Notes
Notes: svn path=/head/; revision=295873
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/scripts/rmport17
1 files changed, 11 insertions, 6 deletions
diff --git a/Tools/scripts/rmport b/Tools/scripts/rmport
index 7e6c5ef7a99b..f531dd1afd2f 100755
--- a/Tools/scripts/rmport
+++ b/Tools/scripts/rmport
@@ -3,6 +3,7 @@
# rmport - remove port(s) from the FreeBSD Ports Collection.
#
# Copyright 2006-2007 Vasil Dimov
+# Copyright 2012-2012 Chris Rees
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -29,10 +30,11 @@
# Authors:
# Originally written by Vasil Dimov <vd@FreeBSD.org>
# Others:
+# Chris Rees <crees@FreeBSD.org>
#
# $FreeBSD$
#
-# MAINTAINER= vd@FreeBSD.org
+# MAINTAINER= crees@FreeBSD.org
#
PORTSDIR=${PORTSDIR:-/usr/ports}
@@ -44,6 +46,10 @@ SED="sed -i .orig -E"
# use ~/.ssh/config to set up the desired username if different than $LOGNAME
PCVS=${PCVS:-cvs -d pcvs.freebsd.org:/home/pcvs}
+if ! CDIFF=$(which cdiff) ; then
+ CDIFF=${EDITOR}
+fi
+
log()
{
echo "==> $*" >&2
@@ -387,7 +393,7 @@ diff()
diffout=${codir}/diff
- ${PCVS} diff -u ports > ${diffout} 2>&1 || :
+ ${PCVS} diff -uN ports > ${diffout} 2>&1 || :
read -p "hit <enter> to view cvs diff output" dummy
@@ -422,7 +428,7 @@ cleanup()
rmdir CVS
# release cvs directories
- ${PCVS} rel -d CVSROOT ports
+ ${PCVS} rel -d ports
cd /
rmdir ${codir}
@@ -528,10 +534,9 @@ done
# the diff afterwards
answer=y
while [ "${answer}" = "y" ] ; do
- diffout=diff
+ diffout=$(diff)
- # EDITOR instead of PAGER because vim has nice syntax highlighting ;-)
- ${EDITOR} ${diffout}
+ ${CDIFF} ${diffout}
echo "" >&2
echo "you can now edit files under ${codir}/ by hand" >&2