On 04/12/13 16:28, Giovanni Bechis wrote: > Little fix to be able to use portimport(1) even with a non standard > $PORTSDIR, I do not like this patch that much, > maybe there could be a better way to achieve the same result. > this is a better version, ok ? Cheers Giovanni
Index: portimport =================================================================== RCS file: /cvs/ports/infrastructure/bin/portimport,v retrieving revision 1.2 diff -u -p -u -p -r1.2 portimport --- portimport 11 Apr 2013 15:18:00 -0000 1.2 +++ portimport 12 Apr 2013 16:44:15 -0000 @@ -38,6 +38,7 @@ done cvsroot=$u...@cvs.openbsd.org:/cvs error=false fulldir=$(pwd) +: ${PORTSDIR:=/usr/ports} importname="ports/${fulldir##*/ports/*(mystuff/|openbsd-wip/|p5-ports-wip/)}" timestamp=$(date '+%Y%m%d') @@ -61,9 +62,9 @@ cvs -n -d$cvsroot import $importname $us read ans?'Correct path? [y/n] ' if [[ $ans == +(y|Y) ]]; then cvs -d$cvsroot import $importname $user ${user}_$timestamp - cd /usr/$importname/../ + cd ${PORTSDIR}/../$importname/../ cvs -d$cvsroot update -AdP ${fulldir##*/} echo "Don't forget to commit the category Makefile when you're done!" - cd /usr/$importname/../ + cd ${PORTSDIR}/../$importname/../ pwd fi