View | Details | Raw Unified | Return to bug 116512
Collapse All | Expand All

(-)./Makefile (-1 / +1 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	portless
8
PORTNAME=	portless
9
PORTVERSION=	0.2.5
9
PORTVERSION=	0.2.7
10
CATEGORIES=	ports-mgmt
10
CATEGORIES=	ports-mgmt
11
MASTER_SITES=	# empty
11
MASTER_SITES=	# empty
12
DISTFILES=	# none
12
DISTFILES=	# none
(-)./files/portless.1 (-7 / +24 lines)
Lines 1-4 Link Here
1
.\" Copyright (c) 2006 Martin Kammerhofer
1
.\" Copyright (c) 2006, 2007 Martin Kammerhofer <mkamm@gmx.net>
2
.\" All rights reserved.
2
.\" All rights reserved.
3
.\"
3
.\"
4
.\" Redistribution and use in source and binary forms, with or without
4
.\" Redistribution and use in source and binary forms, with or without
Lines 22-32 Link Here
22
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
.\" SUCH DAMAGE.
23
.\" SUCH DAMAGE.
24
.\"
24
.\"
25
.\" @(#)portless.1,v 1.10 2006/08/30 09:36:44 martin Exp
25
.\" @(#)portless.1,v 1.14 2007/09/21 09:23:00 martin Exp
26
.\"
26
.\"
27
.\" Note: The date here should be updated whenever a non-trivial
27
.\" Note: The date here should be updated whenever a non-trivial
28
.\" change is made to the manual page.
28
.\" change is made to the manual page.
29
.Dd August 30, 2006
29
.Dd September 21, 2007
30
.Dt PORTLESS 1
30
.Dt PORTLESS 1
31
.Os
31
.Os
32
.Sh NAME
32
.Sh NAME
Lines 35-44 Link Here
35
.Sh SYNOPSIS
35
.Sh SYNOPSIS
36
.Nm
36
.Nm
37
.Op Fl dfIiMmp
37
.Op Fl dfIiMmp
38
.Op Fl gG Ar 'pattern'
38
.Op Fl P Ar pager
39
.Op Fl P Ar pager
39
.Ar portglob...
40
.Ar portglob...
40
.Nm
41
.Nm
41
.Op Fl W | w
42
.Op Fl IWw
43
.Op Fl gG Ar 'pattern'
42
.Ar portglob...
44
.Ar portglob...
43
.Sh DESCRIPTION
45
.Sh DESCRIPTION
44
.Nm
46
.Nm
Lines 55-60 Link Here
55
Take the
57
Take the
56
.Ar portglob
58
.Ar portglob
57
argument literal (not as a shell glob).
59
argument literal (not as a shell glob).
60
.It Fl gG Ar 'pattern'
61
Filter the list of selected files with
62
.Xr grep 1
63
\&. Option
64
.Fl G
65
differs from
66
.Fl g
67
only by using
68
.Pa fgrep
69
rather than
70
.Pa grep .
58
.It Fl I
71
.It Fl I
59
Ignore case when matching
72
Ignore case when matching
60
.Ar portglob
73
.Ar portglob
Lines 65-71 Link Here
65
.Sq Li \&? ,
78
.Sq Li \&? ,
66
or
79
or
67
.Sq Li [
80
.Sq Li [
68
).
81
). Used together with
82
.Fl g
83
it also greps case insensitively.
69
.It Fl i
84
.It Fl i
70
Display the
85
Display the
71
.Pa distinfo
86
.Pa distinfo
Lines 131-140 Link Here
131
.Dl "portless lang/\e*doc"
146
.Dl "portless lang/\e*doc"
132
.Dl "portless 'www/*python*'"
147
.Dl "portless 'www/*python*'"
133
.Sh SEE ALSO
148
.Sh SEE ALSO
149
The
134
.Xr ports_glob 1
150
.Xr ports_glob 1
135
from the
151
command (part of the
136
.Pa ports-mgmt/portupgrade
152
.Pa ports-mgmt/portupgrade
137
port
153
port),
154
.Xr grep 1 .
138
.Sh AUTHOR
155
.Sh AUTHOR
139
The
156
The
140
.Nm
157
.Nm
(-)./files/portless.sh (-7 / +15 lines)
Lines 1-9 Link Here
1
#! @BASH@ --
1
#! @BASH@ --
2
# (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*-
2
# (X)Emacs: -*- mode: Shell-Script; coding: latin-1; -*-
3
# @(#)portless.sh,v 1.12 2006/08/30 09:21:22 martin Exp
3
# @(#)portless.sh,v 1.17 2007/09/21 09:23:01 martin Exp
4
# Show "pkg-descr" file of matching port(s).
4
# Show "pkg-descr" file of matching port(s).
5
#
5
#
6
# Copyright (c) 2006 Martin Kammerhofer <mkamm@gmx.net>
6
# Copyright (c) 2006, 2007 Martin Kammerhofer <mkamm@gmx.net>
7
# All rights reserved.
7
# All rights reserved.
8
# Redistribution and use in source and binary forms, with or without
8
# Redistribution and use in source and binary forms, with or without
9
# modification, are permitted provided that the following conditions
9
# modification, are permitted provided that the following conditions
Lines 29-40 Link Here
29
Script=`basename $0` # name of this script
29
Script=`basename $0` # name of this script
30
30
31
# set defaults
31
# set defaults
32
for opt in d f I i M m P p W w; do
32
for opt in d f g G I i M m P p W w; do
33
    eval opt_$opt=""
33
    eval opt_$opt=""
34
done
34
done
35
PORTSDIR=${PORTSDIR:-/usr/ports}
35
PORTSDIR=${PORTSDIR:-/usr/ports}
36
PAGER=${PAGER:-less -e}
36
PAGER=${PAGER:-less -e}
37
PKGDESCR="pkg-descr"
37
PKGDESCR="pkg-descr"
38
GREP_PATTERN=""
38
filelist=""
39
filelist=""
39
rc=0
40
rc=0
40
41
Lines 45-51 Link Here
45
	echo >&2 "$Script: $1"
46
	echo >&2 "$Script: $1"
46
	shift
47
	shift
47
    done
48
    done
48
    echo >&2 "usage: $Script [-dfIiMmp | -Ww] [-P pager] 'portglob'..."
49
    echo >&2 "usage: $Script [-dfIiMmp | -Ww] [-gG pattern] [-P pager] 'portglob'..."
49
    exit 64	# EX_USAGE
50
    exit 64	# EX_USAGE
50
}
51
}
51
52
Lines 60-74 Link Here
60
}
61
}
61
62
62
# process options
63
# process options
63
while getopts "D:dfIiMmpP:Wwx" option
64
while getopts "D:dfG:g:IiMmpP:Wwx" option
64
  do
65
  do
65
  case "$option" in
66
  case "$option" in
66
      (D) PORTSDIR="$OPTARG";;		# undocumented
67
      (D) PORTSDIR="$OPTARG";;		# undocumented
67
      (d) addopt d "$PKGDESCR";;
68
      (d) addopt d "$PKGDESCR";;
68
      (f) opt_f="f";;
69
      (f) opt_f="f";;
70
      (G) GREP_PATTERN="$OPTARG"; opt_g="G"; opt_G="-F";;
71
      (g) GREP_PATTERN="$OPTARG"; opt_g="g"; opt_G="";;
69
      (I) shopt -s nocaseglob ||
72
      (I) shopt -s nocaseglob ||
70
      usage "option -I needs bash!"
73
      usage "option -I needs bash!"
71
      opt_I="I";;
74
      opt_I="-i";;
72
      (i) addopt i "distinfo";;
75
      (i) addopt i "distinfo";;
73
      (M) addopt M "Makefile";;
76
      (M) addopt M "Makefile";;
74
      (m) addopt m "pkg-message";;
77
      (m) addopt m "pkg-message";;
Lines 114-119 Link Here
114
	    set -- "$@" "$PORTSDIR"$dirglob$portglob/"$f"
117
	    set -- "$@" "$PORTSDIR"$dirglob$portglob/"$f"
115
	fi
118
	fi
116
    done
119
    done
120
    if [ -n "$opt_g" ]; then
121
	set -- $(grep -l $opt_G $opt_I -- "$GREP_PATTERN" "$@")
122
	[ $# = 0 ] && return			# grep found no match
123
    fi
117
    if [ -n "$opt_W" -o -n "$opt_w" ]; then
124
    if [ -n "$opt_W" -o -n "$opt_w" ]; then
118
	lstrip=""
125
	lstrip=""
119
	[ -n "$opt_W" ] && lstrip=-e\ 's;^.*/\([^/]*/[^/]*\)$;\1;'
126
	[ -n "$opt_W" ] && lstrip=-e\ 's;^.*/\([^/]*/[^/]*\)$;\1;'
Lines 128-133 Link Here
128
135
129
# main
136
# main
130
for p in "$@"; do
137
for p in "$@"; do
138
    p=${p%/}					# strip a trailing slash
131
    expr "$p" : ".*[$IFS]" >/dev/null &&
139
    expr "$p" : ".*[$IFS]" >/dev/null &&
132
	usage "portglob '$p' contains whitespace!"
140
	usage "portglob '$p' contains whitespace!"
133
    case "$p" in
141
    case "$p" in

Return to bug 116512