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
This commit is contained in:
Chris Rees 2012-05-02 18:32:30 +00:00
parent 287e58ebab
commit dd16d151db
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=295873

View file

@ -3,6 +3,7 @@
# rmport - remove port(s) from the FreeBSD Ports Collection. # rmport - remove port(s) from the FreeBSD Ports Collection.
# #
# Copyright 2006-2007 Vasil Dimov # Copyright 2006-2007 Vasil Dimov
# Copyright 2012-2012 Chris Rees
# All rights reserved. # All rights reserved.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -29,10 +30,11 @@
# Authors: # Authors:
# Originally written by Vasil Dimov <vd@FreeBSD.org> # Originally written by Vasil Dimov <vd@FreeBSD.org>
# Others: # Others:
# Chris Rees <crees@FreeBSD.org>
# #
# $FreeBSD$ # $FreeBSD$
# #
# MAINTAINER= vd@FreeBSD.org # MAINTAINER= crees@FreeBSD.org
# #
PORTSDIR=${PORTSDIR:-/usr/ports} 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 # use ~/.ssh/config to set up the desired username if different than $LOGNAME
PCVS=${PCVS:-cvs -d pcvs.freebsd.org:/home/pcvs} PCVS=${PCVS:-cvs -d pcvs.freebsd.org:/home/pcvs}
if ! CDIFF=$(which cdiff) ; then
CDIFF=${EDITOR}
fi
log() log()
{ {
echo "==> $*" >&2 echo "==> $*" >&2
@ -387,7 +393,7 @@ diff()
diffout=${codir}/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 read -p "hit <enter> to view cvs diff output" dummy
@ -422,7 +428,7 @@ cleanup()
rmdir CVS rmdir CVS
# release cvs directories # release cvs directories
${PCVS} rel -d CVSROOT ports ${PCVS} rel -d ports
cd / cd /
rmdir ${codir} rmdir ${codir}
@ -528,10 +534,9 @@ done
# the diff afterwards # the diff afterwards
answer=y answer=y
while [ "${answer}" = "y" ] ; do while [ "${answer}" = "y" ] ; do
diffout=diff diffout=$(diff)
# EDITOR instead of PAGER because vim has nice syntax highlighting ;-) ${CDIFF} ${diffout}
${EDITOR} ${diffout}
echo "" >&2 echo "" >&2
echo "you can now edit files under ${codir}/ by hand" >&2 echo "you can now edit files under ${codir}/ by hand" >&2