summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--misc/portless/Makefile10
-rw-r--r--misc/portless/files/portless.117
-rw-r--r--misc/portless/files/portless.sh17
-rw-r--r--ports-mgmt/portless/Makefile10
-rw-r--r--ports-mgmt/portless/files/portless.117
-rw-r--r--ports-mgmt/portless/files/portless.sh17
6 files changed, 66 insertions, 22 deletions
diff --git a/misc/portless/Makefile b/misc/portless/Makefile
index 1c553ed..2974c7d 100644
--- a/misc/portless/Makefile
+++ b/misc/portless/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portless
-PORTVERSION= 0.2.2
+PORTVERSION= 0.2.4
CATEGORIES= misc
MASTER_SITES= # empty
DISTFILES= # none
@@ -15,14 +15,18 @@ EXTRACT_ONLY= # empty
MAINTAINER= mkamm@gmx.net
COMMENT= Quick display of files inside the FreeBSD ports tree
-NO_BUILD= yes
+RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+
MAN1= portless.1
MANCOMPRESSED= no
PLIST_FILES= bin/portless
+do-build:
+ ${SED} -e 's;@BASH@;${LOCALBASE}/bin/bash;g' \
+ ${FILESDIR}/portless.sh >${WRKDIR}/portless
do-install:
- ${INSTALL_SCRIPT} ${FILESDIR}/portless.sh ${PREFIX}/bin/portless
+ ${INSTALL_SCRIPT} ${WRKDIR}/portless ${PREFIX}/bin
${INSTALL_MAN} ${FILESDIR}/portless.1 ${PREFIX}/man/man1
.include <bsd.port.mk>
diff --git a/misc/portless/files/portless.1 b/misc/portless/files/portless.1
index 0ba11a8..2b0e51c 100644
--- a/misc/portless/files/portless.1
+++ b/misc/portless/files/portless.1
@@ -22,11 +22,11 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)portless.1,v 1.6 2006/07/06 10:41:39 martin Exp
+.\" @(#)portless.1,v 1.7 2006/08/13 10:23:14 martin Exp
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
-.Dd July 6, 2006
+.Dd August 13, 2006
.Dt PORTLESS 1
.Os
.Sh NAME
@@ -34,7 +34,7 @@
.Nd "quickly browse port descriptions"
.Sh SYNOPSIS
.Nm
-.Op Fl dfiMmp
+.Op Fl dfIiMmp
.Op Fl P Ar pager
.Ar portglob...
.Nm
@@ -55,6 +55,17 @@ file of the port. This is the default.
Take the
.Ar portglob
argument literal (not as a shell glob).
+.It Fl I
+Ignore case when matching
+.Ar portglob
+against the ports tree. This option is only effective when
+.Ar portglob
+contains at least one unquoted globbing meta-character (
+.Sq Li * ,
+.Sq Li \&? ,
+or
+.Sq Li [
+).
.It Fl i
Display the
.Pa distinfo
diff --git a/misc/portless/files/portless.sh b/misc/portless/files/portless.sh
index e682fdd..27d0aee 100644
--- a/misc/portless/files/portless.sh
+++ b/misc/portless/files/portless.sh
@@ -1,6 +1,6 @@
-#! /bin/sh --
+#! @BASH@ --
# (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*-
-# @(#)portless.sh,v 1.8 2006/07/06 10:32:01 martin Exp
+# @(#)portless.sh,v 1.11 2006/08/13 10:23:14 martin Exp
# Show "pkg-descr" file of matching port(s).
#
# Copyright (c) 2006 Martin Kammerhofer <mkamm@gmx.net>
@@ -29,7 +29,7 @@
Script=`basename $0` # name of this script
# set defaults
-for opt in d f i M m p w; do
+for opt in d f I i M m p w; do
eval opt_$opt=""
done
PORTSDIR=${PORTSDIR:-/usr/ports}
@@ -45,7 +45,7 @@ usage()
echo >&2 "$Script: $1"
shift
done
- echo >&2 "usage: $Script [-dfiMmp] [-P pager] 'portglob'..."
+ echo >&2 "usage: $Script [-dfIiMmpw] [-P pager] 'portglob'..."
exit 64 # EX_USAGE
}
@@ -60,12 +60,15 @@ addopt()
}
# process options
-while getopts "D:dfiMmpP:wx" option
+while getopts "D:dfIiMmpP:wx" 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!"
+ opt_I="I";;
(i) addopt i "distinfo";;
(M) addopt M "Makefile";;
(m) addopt m "pkg-message";;
@@ -82,6 +85,8 @@ if [ -n "$opt_w" ]; then
[ -n "$filelist" ] && usage "option -w not compatible with other options"
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"
else
[ -n "$filelist" ] || filelist="$PKGDESCR"
fi
@@ -100,6 +105,7 @@ page() {
dirglob=$1
portglob=$2
shift 2
+ set +f
for f in $filelist; do
if [ -n "$opt_f" ]; then
set -- "$@" "$PORTSDIR"$dirglob"$portglob/$f"
@@ -112,6 +118,7 @@ page() {
# main
for p in "$@"; do
+ set -f
set -- $p
[ $# != 1 ] && usage "portglob '$p' contains whitespace!"
case "$p" in
diff --git a/ports-mgmt/portless/Makefile b/ports-mgmt/portless/Makefile
index 1c553ed..2974c7d 100644
--- a/ports-mgmt/portless/Makefile
+++ b/ports-mgmt/portless/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= portless
-PORTVERSION= 0.2.2
+PORTVERSION= 0.2.4
CATEGORIES= misc
MASTER_SITES= # empty
DISTFILES= # none
@@ -15,14 +15,18 @@ EXTRACT_ONLY= # empty
MAINTAINER= mkamm@gmx.net
COMMENT= Quick display of files inside the FreeBSD ports tree
-NO_BUILD= yes
+RUN_DEPENDS= ${LOCALBASE}/bin/bash:${PORTSDIR}/shells/bash
+
MAN1= portless.1
MANCOMPRESSED= no
PLIST_FILES= bin/portless
+do-build:
+ ${SED} -e 's;@BASH@;${LOCALBASE}/bin/bash;g' \
+ ${FILESDIR}/portless.sh >${WRKDIR}/portless
do-install:
- ${INSTALL_SCRIPT} ${FILESDIR}/portless.sh ${PREFIX}/bin/portless
+ ${INSTALL_SCRIPT} ${WRKDIR}/portless ${PREFIX}/bin
${INSTALL_MAN} ${FILESDIR}/portless.1 ${PREFIX}/man/man1
.include <bsd.port.mk>
diff --git a/ports-mgmt/portless/files/portless.1 b/ports-mgmt/portless/files/portless.1
index 0ba11a8..2b0e51c 100644
--- a/ports-mgmt/portless/files/portless.1
+++ b/ports-mgmt/portless/files/portless.1
@@ -22,11 +22,11 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)portless.1,v 1.6 2006/07/06 10:41:39 martin Exp
+.\" @(#)portless.1,v 1.7 2006/08/13 10:23:14 martin Exp
.\"
.\" Note: The date here should be updated whenever a non-trivial
.\" change is made to the manual page.
-.Dd July 6, 2006
+.Dd August 13, 2006
.Dt PORTLESS 1
.Os
.Sh NAME
@@ -34,7 +34,7 @@
.Nd "quickly browse port descriptions"
.Sh SYNOPSIS
.Nm
-.Op Fl dfiMmp
+.Op Fl dfIiMmp
.Op Fl P Ar pager
.Ar portglob...
.Nm
@@ -55,6 +55,17 @@ file of the port. This is the default.
Take the
.Ar portglob
argument literal (not as a shell glob).
+.It Fl I
+Ignore case when matching
+.Ar portglob
+against the ports tree. This option is only effective when
+.Ar portglob
+contains at least one unquoted globbing meta-character (
+.Sq Li * ,
+.Sq Li \&? ,
+or
+.Sq Li [
+).
.It Fl i
Display the
.Pa distinfo
diff --git a/ports-mgmt/portless/files/portless.sh b/ports-mgmt/portless/files/portless.sh
index e682fdd..27d0aee 100644
--- a/ports-mgmt/portless/files/portless.sh
+++ b/ports-mgmt/portless/files/portless.sh
@@ -1,6 +1,6 @@
-#! /bin/sh --
+#! @BASH@ --
# (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*-
-# @(#)portless.sh,v 1.8 2006/07/06 10:32:01 martin Exp
+# @(#)portless.sh,v 1.11 2006/08/13 10:23:14 martin Exp
# Show "pkg-descr" file of matching port(s).
#
# Copyright (c) 2006 Martin Kammerhofer <mkamm@gmx.net>
@@ -29,7 +29,7 @@
Script=`basename $0` # name of this script
# set defaults
-for opt in d f i M m p w; do
+for opt in d f I i M m p w; do
eval opt_$opt=""
done
PORTSDIR=${PORTSDIR:-/usr/ports}
@@ -45,7 +45,7 @@ usage()
echo >&2 "$Script: $1"
shift
done
- echo >&2 "usage: $Script [-dfiMmp] [-P pager] 'portglob'..."
+ echo >&2 "usage: $Script [-dfIiMmpw] [-P pager] 'portglob'..."
exit 64 # EX_USAGE
}
@@ -60,12 +60,15 @@ addopt()
}
# process options
-while getopts "D:dfiMmpP:wx" option
+while getopts "D:dfIiMmpP:wx" 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!"
+ opt_I="I";;
(i) addopt i "distinfo";;
(M) addopt M "Makefile";;
(m) addopt m "pkg-message";;
@@ -82,6 +85,8 @@ if [ -n "$opt_w" ]; then
[ -n "$filelist" ] && usage "option -w not compatible with other options"
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"
else
[ -n "$filelist" ] || filelist="$PKGDESCR"
fi
@@ -100,6 +105,7 @@ page() {
dirglob=$1
portglob=$2
shift 2
+ set +f
for f in $filelist; do
if [ -n "$opt_f" ]; then
set -- "$@" "$PORTSDIR"$dirglob"$portglob/$f"
@@ -112,6 +118,7 @@ page() {
# main
for p in "$@"; do
+ set -f
set -- $p
[ $# != 1 ] && usage "portglob '$p' contains whitespace!"
case "$p" in
OpenPOWER on IntegriCloud