Date: Tue, 2 May 2006 17:20:27 +0800 (CST) From: Cheng-Lung Sung <clsung@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Cc: vd@FreeBSD.org Subject: ports/96649: [patch] Tools/scripts/rmport: rmport can not execute under category/ Message-ID: <20060502092027.CC89B7EA4E@FreeBSD.csie.nctu.edu.tw> Resent-Message-ID: <200605020920.k429KGf5043377@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 96649 >Category: ports >Synopsis: [patch] Tools/scripts/rmport: rmport can not execute under category/ >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 02 09:20:16 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Cheng-Lung Sung >Release: FreeBSD 6.1-PRERELEASE i386 >Organization: FreeBSD @ Taiwan >Environment: System: FreeBSD FreeBSD.csie.nctu.edu.tw 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #7: Thu Apr 13 03:20:20 CST 2006 root@FreeBSD.csie.nctu.edu.tw:/home/usr.obj/usr/src/sys/FREEBSD i386 >Description: when execute rmport under ports category, it will failed with "No such file or direcotyr", unlike common usage in addport So I suggest a patch that will not affect original behaivor, but will help us when running the command under ports category. maintainer is cc'ed. >How-To-Repeat: % cd ports/textproc; rmport -d p5-Template-Magic/ make: chdir /usr/ports/p5-Template-Magic/: No such file or directory >Fix: --- /usr/ports/Tools/scripts/rmport Tue Apr 18 03:32:12 2006 +++ ./rmport Tue May 2 17:05:53 2006 @@ -54,6 +54,18 @@ make -C ${PORTSDIR}/${1} -V PKGNAME } +# if execute under some category +find_category() +{ + catport=${1} + if [ -d "${PORTSDIR}/${catport}" ] ; then + echo ${catport} + else + cat=`pwd | xargs basename` + echo ${cat}/${catport} + fi +} + find_expired() { EXPVAR=EXPIRATION_DATE @@ -273,7 +285,7 @@ if [ ${#} -ne 2 ] ; then usage fi - catport=${2} + catport=`find_category ${2}` check_dep ${catport} 0 ${catport} exit fi @@ -292,6 +304,7 @@ co_common for catport in $* ; do + catport=`find_category ${catport}` cat=`dirname ${catport}` port=`basename ${catport}` # remove any trailing slashes >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060502092027.CC89B7EA4E>