From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Aug 30 13:20:32 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9EC4216A4DE for ; Wed, 30 Aug 2006 13:20:32 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5440443D70 for ; Wed, 30 Aug 2006 13:20:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k7UDKNZ1099299 for ; Wed, 30 Aug 2006 13:20:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k7UDKNQK099298; Wed, 30 Aug 2006 13:20:23 GMT (envelope-from gnats) Resent-Date: Wed, 30 Aug 2006 13:20:23 GMT Resent-Message-Id: <200608301320.k7UDKNQK099298@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Martin Kammerhofer Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F93716A4DD for ; Wed, 30 Aug 2006 13:14:23 +0000 (UTC) (envelope-from dada@pluto.tugraz.at) Received: from mailrelay1.tugraz.at (mailrelay.tu-graz.ac.at [129.27.2.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 128C843D55 for ; Wed, 30 Aug 2006 13:14:22 +0000 (GMT) (envelope-from dada@pluto.tugraz.at) Received: from pluto.tugraz.at (pluto.tu-graz.ac.at [129.27.3.200]) by mailrelay1.tugraz.at (8.13.8/8.13.8) with ESMTP id k7UDEKCJ001715 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 30 Aug 2006 15:14:20 +0200 (CEST) Received: from pluto.tugraz.at (localhost.localdomain [127.0.0.1]) by pluto.tugraz.at (8.13.1/8.13.1) with ESMTP id k7UDEJPJ010129 for ; Wed, 30 Aug 2006 15:14:20 +0200 Received: (from dada@localhost) by pluto.tugraz.at (8.13.1/8.13.1/Submit) id k7UDEJMM010128 for freebsd-gnats-submit@freebsd.org; Wed, 30 Aug 2006 15:14:19 +0200 Message-Id: <200608301314.k7UDEJMM010128@pluto.tugraz.at> Date: Wed, 30 Aug 2006 15:14:19 +0200 From: Martin Kammerhofer To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: ports/102695: [patch] port misc/portless: 0.2.4 => 0.2.5 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 13:20:32 -0000 >Number: 102695 >Category: ports >Synopsis: [patch] port misc/portless: from 0.2.4 to 0.2.5 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Aug 30 13:20:22 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Martin Kammerhofer >Release: FreeBSD 6.1-STABLE i386 >Organization: Graz Uni >Environment: System: FreeBSD Martin.liebt.Susi 6.1-STABLE FreeBSD 6.1-STABLE #0: Tue Aug 29 17:21:39 CEST 2006 toor@Martin.liebt.Susi:/usr/obj/usr/src/sys/P2B-S i386 >Description: Addition of -W option and minor bug fixed where whitespace at begin/end of portglob argument was not properly rejected. >How-To-Repeat: >Fix: diff -ru /usr/ports/misc/portless/Makefile portless/Makefile --- /usr/ports/misc/portless/Makefile Tue Aug 15 18:44:18 2006 +++ portless/Makefile Wed Aug 30 11:21:22 2006 @@ -6,7 +6,7 @@ # PORTNAME= portless -PORTVERSION= 0.2.4 +PORTVERSION= 0.2.5 CATEGORIES= misc MASTER_SITES= # empty DISTFILES= # none diff -ru /usr/ports/misc/portless/files/portless.1 portless/files/portless.1 --- /usr/ports/misc/portless/files/portless.1 Tue Aug 15 18:44:19 2006 +++ portless/files/portless.1 Wed Aug 30 11:36:44 2006 @@ -22,11 +22,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)portless.1,v 1.7 2006/08/13 10:23:14 martin Exp +.\" @(#)portless.1,v 1.10 2006/08/30 09:36:44 martin Exp .\" .\" Note: The date here should be updated whenever a non-trivial .\" change is made to the manual page. -.Dd August 13, 2006 +.Dd August 30, 2006 .Dt PORTLESS 1 .Os .Sh NAME @@ -38,7 +38,7 @@ .Op Fl P Ar pager .Ar portglob... .Nm -.Op Fl w +.Op Fl W | w .Ar portglob... .Sh DESCRIPTION .Nm @@ -58,7 +58,7 @@ .It Fl I Ignore case when matching .Ar portglob -against the ports tree. This option is only effective when +against the ports tree. This option is only effective if .Ar portglob contains at least one unquoted globbing meta-character ( .Sq Li * , @@ -93,8 +93,19 @@ of directories matching .Ar portglob to stdout. -This option is incompatible with all other options. +.It Fl W +Like +.Fl w +but echoes just the last two components of the directory (i.e.\& +.Em category/portname +) to stdout. .El +.Lp +Options +.Fl W +and +.Fl w +are incompatible with all other options. .Sh ENVIRONMENT The .Nm @@ -129,8 +140,4 @@ .Nm utility and this manual page were written by .An Martin Kammerhofer Aq mkamm@gmx.net . -.Sh BUGS -The -.Fl w -option is a retrofitted hack. .\" EOF diff -ru /usr/ports/misc/portless/files/portless.sh portless/files/portless.sh --- /usr/ports/misc/portless/files/portless.sh Tue Aug 15 18:44:19 2006 +++ portless/files/portless.sh Wed Aug 30 11:21:22 2006 @@ -1,6 +1,6 @@ #! @BASH@ -- # (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*- -# @(#)portless.sh,v 1.11 2006/08/13 10:23:14 martin Exp +# @(#)portless.sh,v 1.12 2006/08/30 09:21:22 martin Exp # Show "pkg-descr" file of matching port(s). # # Copyright (c) 2006 Martin Kammerhofer @@ -29,7 +29,7 @@ Script=`basename $0` # name of this script # set defaults -for opt in d f I i M m p w; do +for opt in d f I i M m P p W w; do eval opt_$opt="" done PORTSDIR=${PORTSDIR:-/usr/ports} @@ -45,7 +45,7 @@ echo >&2 "$Script: $1" shift done - echo >&2 "usage: $Script [-dfIiMmpw] [-P pager] 'portglob'..." + echo >&2 "usage: $Script [-dfIiMmp | -Ww] [-P pager] 'portglob'..." exit 64 # EX_USAGE } @@ -60,20 +60,21 @@ } # process options -while getopts "D:dfIiMmpP:wx" option +while getopts "D:dfIiMmpP:Wwx" option do case "$option" in (D) PORTSDIR="$OPTARG";; # undocumented (d) addopt d "$PKGDESCR";; (f) opt_f="f";; (I) shopt -s nocaseglob || - usage "Option -I needs bash!" + usage "option -I needs bash!" opt_I="I";; (i) addopt i "distinfo";; (M) addopt M "Makefile";; (m) addopt m "pkg-message";; (p) addopt p "pkg-plist";; - (P) PAGER="$OPTARG";; + (P) PAGER="$OPTARG"; opt_P="P";; + (W) opt_W="W";; (w) opt_w="w";; (x) set -x;; # undocumented (*) usage;; @@ -81,12 +82,13 @@ done shift $(($OPTIND - 1)) [ -d "$PORTSDIR" ] || fatal "No such directory '$PORTSDIR'" -if [ -n "$opt_w" ]; then - [ -n "$filelist" ] && usage "option -w not compatible with other options" +if [ -n "$opt_W" -o -n "$opt_w" ]; then + [ -n "$filelist" -o -n "$opt_P" -o -n "$opt_W" -a -n "$opt_w" ] && + usage "options -W and -w are not compatible with any other option!" PAGER="/bin/ls -1d" # just echo directory name(s) filelist="." elif [ -n "$opt_f" -a -n "$opt_I" ]; then - usage "only one of options -f and -I is useful" + usage "only one of options -f and -I is useful!" else [ -n "$filelist" ] || filelist="$PKGDESCR" fi @@ -105,7 +107,6 @@ dirglob=$1 portglob=$2 shift 2 - set +f for f in $filelist; do if [ -n "$opt_f" ]; then set -- "$@" "$PORTSDIR"$dirglob"$portglob/$f" @@ -113,14 +114,22 @@ set -- "$@" "$PORTSDIR"$dirglob$portglob/"$f" fi done - $PAGER "$@" || { rc=$?; return $rc; } # remember last error code + if [ -n "$opt_W" -o -n "$opt_w" ]; then + lstrip="" + [ -n "$opt_W" ] && lstrip=-e\ 's;^.*/\([^/]*/[^/]*\)$;\1;' + { + $PAGER "$@" | grep -Ev '/distfiles/|/packages/' | + sed -e 's;/.$;;' $lstrip + } || { rc=$?; return $rc; } # remember last error code + else + $PAGER "$@" || { rc=$?; return $rc; } # remember last error code + fi } # main for p in "$@"; do - set -f - set -- $p - [ $# != 1 ] && usage "portglob '$p' contains whitespace!" + expr "$p" : ".*[$IFS]" >/dev/null && + usage "portglob '$p' contains whitespace!" case "$p" in (*/*/*) usage "portglob '$p' contains more than one slash!";; >Release-Note: >Audit-Trail: >Unformatted: