aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt/portless
diff options
context:
space:
mode:
authorMarcelo Araujo <araujo@FreeBSD.org>2007-09-27 14:49:54 +0000
committerMarcelo Araujo <araujo@FreeBSD.org>2007-09-27 14:49:54 +0000
commit9939e501cf46def5ce762b429defd76d9dd6a15c (patch)
tree6d77819cf4ead543f208f78f7088b9ae7360554e /ports-mgmt/portless
parent3e8d834c87306ece1b5325376ccb34b9e23448f6 (diff)
downloadports-9939e501cf46def5ce762b429defd76d9dd6a15c.tar.gz
ports-9939e501cf46def5ce762b429defd76d9dd6a15c.zip
- Update to 0.2.7.
- Fixed the Ignore trailing slash in port globs. - Optionally narrow selected ports by grepping the pkg-descr files. PR: ports/116512 Submitted by: Martin Kammerhofer <dada@pluto.tugraz.at> (maintainer) Approved by: stas (mentor)
Notes
Notes: svn path=/head/; revision=200174
Diffstat (limited to 'ports-mgmt/portless')
-rw-r--r--ports-mgmt/portless/Makefile2
-rw-r--r--ports-mgmt/portless/files/portless.131
-rw-r--r--ports-mgmt/portless/files/portless.sh22
3 files changed, 40 insertions, 15 deletions
diff --git a/ports-mgmt/portless/Makefile b/ports-mgmt/portless/Makefile
index 64601a1ad152..c08bc40aa3b1 100644
--- a/ports-mgmt/portless/Makefile
+++ b/ports-mgmt/portless/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portless
-PORTVERSION= 0.2.5
+PORTVERSION= 0.2.7
CATEGORIES= ports-mgmt
MASTER_SITES= # empty
DISTFILES= # none
diff --git a/ports-mgmt/portless/files/portless.1 b/ports-mgmt/portless/files/portless.1
index 81c1e20dcd37..6215d269d1f7 100644
--- a/ports-mgmt/portless/files/portless.1
+++ b/ports-mgmt/portless/files/portless.1
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2006 Martin Kammerhofer
+.\" Copyright (c) 2006, 2007 Martin Kammerhofer <mkamm@gmx.net>
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,11 +22,11 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)portless.1,v 1.10 2006/08/30 09:36:44 martin Exp
+.\" @(#)portless.1,v 1.14 2007/09/21 09:23:00 martin Exp
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
-.Dd August 30, 2006
+.Dd September 21, 2007
.Dt PORTLESS 1
.Os
.Sh NAME
@@ -35,10 +35,12 @@
.Sh SYNOPSIS
.Nm
.Op Fl dfIiMmp
+.Op Fl gG Ar 'pattern'
.Op Fl P Ar pager
.Ar portglob...
.Nm
-.Op Fl W | w
+.Op Fl IWw
+.Op Fl gG Ar 'pattern'
.Ar portglob...
.Sh DESCRIPTION
.Nm
@@ -55,6 +57,17 @@ file of the port. This is the default.
Take the
.Ar portglob
argument literal (not as a shell glob).
+.It Fl gG Ar 'pattern'
+Filter the list of selected files with
+.Xr grep 1
+\&. Option
+.Fl G
+differs from
+.Fl g
+only by using
+.Pa fgrep
+rather than
+.Pa grep .
.It Fl I
Ignore case when matching
.Ar portglob
@@ -65,7 +78,9 @@ contains at least one unquoted globbing meta-character (
.Sq Li \&? ,
or
.Sq Li [
-).
+). Used together with
+.Fl g
+it also greps case insensitively.
.It Fl i
Display the
.Pa distinfo
@@ -131,10 +146,12 @@ command:
.Dl "portless lang/\e*doc"
.Dl "portless 'www/*python*'"
.Sh SEE ALSO
+The
.Xr ports_glob 1
-from the
+command (part of the
.Pa ports-mgmt/portupgrade
-port
+port),
+.Xr grep 1 .
.Sh AUTHOR
The
.Nm
diff --git a/ports-mgmt/portless/files/portless.sh b/ports-mgmt/portless/files/portless.sh
index d8f112c5844d..0e1c8f67707c 100644
--- a/ports-mgmt/portless/files/portless.sh
+++ b/ports-mgmt/portless/files/portless.sh
@@ -1,9 +1,9 @@
#! @BASH@ --
-# (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*-
-# @(#)portless.sh,v 1.12 2006/08/30 09:21:22 martin Exp
+# (X)Emacs: -*- mode: Shell-Script; coding: latin-1; -*-
+# @(#)portless.sh,v 1.17 2007/09/21 09:23:01 martin Exp
# Show "pkg-descr" file of matching port(s).
#
-# Copyright (c) 2006 Martin Kammerhofer <mkamm@gmx.net>
+# Copyright (c) 2006, 2007 Martin Kammerhofer <mkamm@gmx.net>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@@ -29,12 +29,13 @@
Script=`basename $0` # name of this script
# set defaults
-for opt in d f I i M m P p W w; do
+for opt in d f g G I i M m P p W w; do
eval opt_$opt=""
done
PORTSDIR=${PORTSDIR:-/usr/ports}
PAGER=${PAGER:-less -e}
PKGDESCR="pkg-descr"
+GREP_PATTERN=""
filelist=""
rc=0
@@ -45,7 +46,7 @@ usage()
echo >&2 "$Script: $1"
shift
done
- echo >&2 "usage: $Script [-dfIiMmp | -Ww] [-P pager] 'portglob'..."
+ echo >&2 "usage: $Script [-dfIiMmp | -Ww] [-gG pattern] [-P pager] 'portglob'..."
exit 64 # EX_USAGE
}
@@ -60,15 +61,17 @@ addopt()
}
# process options
-while getopts "D:dfIiMmpP:Wwx" option
+while getopts "D:dfG:g:IiMmpP:Wwx" option
do
case "$option" in
(D) PORTSDIR="$OPTARG";; # undocumented
(d) addopt d "$PKGDESCR";;
(f) opt_f="f";;
+ (G) GREP_PATTERN="$OPTARG"; opt_g="G"; opt_G="-F";;
+ (g) GREP_PATTERN="$OPTARG"; opt_g="g"; opt_G="";;
(I) shopt -s nocaseglob ||
usage "option -I needs bash!"
- opt_I="I";;
+ opt_I="-i";;
(i) addopt i "distinfo";;
(M) addopt M "Makefile";;
(m) addopt m "pkg-message";;
@@ -114,6 +117,10 @@ page() {
set -- "$@" "$PORTSDIR"$dirglob$portglob/"$f"
fi
done
+ if [ -n "$opt_g" ]; then
+ set -- $(grep -l $opt_G $opt_I -- "$GREP_PATTERN" "$@")
+ [ $# = 0 ] && return # grep found no match
+ fi
if [ -n "$opt_W" -o -n "$opt_w" ]; then
lstrip=""
[ -n "$opt_W" ] && lstrip=-e\ 's;^.*/\([^/]*/[^/]*\)$;\1;'
@@ -128,6 +135,7 @@ page() {
# main
for p in "$@"; do
+ p=${p%/} # strip a trailing slash
expr "$p" : ".*[$IFS]" >/dev/null &&
usage "portglob '$p' contains whitespace!"
case "$p" in