diff options
author | Erwin Lansing <erwin@FreeBSD.org> | 2006-06-11 09:43:46 +0000 |
---|---|---|
committer | Erwin Lansing <erwin@FreeBSD.org> | 2006-06-11 09:43:46 +0000 |
commit | 1901427f7741e96af2b3ed73cd04f1313cb2b711 (patch) | |
tree | d5885f014dd1557c3a14c98b0180675bbe111bae /ports-mgmt/portless | |
parent | COBF (aka C-Obfuscator) is a program which manipulates C or C++ sourcefiles (diff) |
portless is a small shell script which lets FreeBSD users quickly browse
port descriptions given the port's name or a glob. Basically to view
the descriptions of GCC (related) ports you type
portless gcc\*
and portless will display the descriptions of all gcc* ports.
There are options to display the postinstall messages or Makefiles instead.
- Martin Kammerhofer
mkamm@gmx.net
PR: ports/98739
Submitted by: Martin Kammerhofer
Notes
Notes:
svn path=/head/; revision=165086
Diffstat (limited to 'ports-mgmt/portless')
-rw-r--r-- | ports-mgmt/portless/Makefile | 30 | ||||
-rw-r--r-- | ports-mgmt/portless/files/portless.1 | 108 | ||||
-rw-r--r-- | ports-mgmt/portless/files/portless.sh | 92 | ||||
-rw-r--r-- | ports-mgmt/portless/pkg-descr | 9 |
4 files changed, 239 insertions, 0 deletions
diff --git a/ports-mgmt/portless/Makefile b/ports-mgmt/portless/Makefile new file mode 100644 index 000000000000..1c073309ed55 --- /dev/null +++ b/ports-mgmt/portless/Makefile @@ -0,0 +1,30 @@ +# New ports collection makefile for: portless +# Date created: 8 June 2006 +# Whom: Martin Kammerhofer +# +# $FreeBSD$ +# + +PORTNAME= portless +PORTVERSION= 0.1 +CATEGORIES= misc +MASTER_SITES= # empty +DISTFILES= # none +EXTRACT_ONLY= # empty + +MAINTAINER= mkamm@gmx.net +COMMENT= Quick display of files inside the FreeBSD ports tree + +RUN_DEPENDS= less:${PORTSDIR}/sysutils/less + +NO_BUILD= yes +MAN1= portless.1 +MANCOMPRESSED= no + +PLIST_FILES= bin/portless + +do-install: + ${INSTALL_SCRIPT} ${FILESDIR}/portless.sh ${PREFIX}/bin/portless + ${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 new file mode 100644 index 000000000000..e3ba9076418f --- /dev/null +++ b/ports-mgmt/portless/files/portless.1 @@ -0,0 +1,108 @@ +.\" Copyright (c) 2006 Martin Kammerhofer +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" @(#)portless.1,v 1.1 2006/06/08 10:10:56 martin Exp +.\" +.\" Note: The date here should be updated whenever a non-trivial +.\" change is made to the manual page. +.Dd June 8, 2006 +.Dt PORTLESS 1 +.Os +.Sh NAME +.Nm portless +.Nd "quickly browse port descriptions" +.Sh SYNOPSIS +.Nm +.Op Fl dfiMmp +.Op Fl P Ar pager +.Ar portglob... +.Sh DESCRIPTION +.Nm +lets FreeBSD users quickly browse port descriptions given the port's +name or a (shell type) glob. +.Pp +The options are as follows: +.Bl -tag -width ".Fl P Ar pager" +.It Fl d +Display the +.Pa pkg-descr +file of the port. This is the default. +.It Fl f +Take the +.Ar portglob +argument literal (not as a shell glob). +.It Fl i +Display the +.Pa distinfo +file of the port. +.It Fl M +Display the +.Pa Makefile +file of the port. +.It Fl m +Display the +.Pa pkg-message +file of the port. +.It Fl p +Display the +.Pa pkg-plist +file of the port. +.It Fl P Ar pager +Use the +.Ar pager +program to display the files rather than the program specified by the +.Ev PAGER +environment variable or the default of +.Dq Pa less -e +\&. +.El +.Sh ENVIRONMENT +The +.Nm +command uses the +.Ev PORTSDIR +(default: +.Pa /usr/ports +) and the +.Ev PAGER +(default: +.Dq Pa less -e +) environment variables. +.Sh FILES +.Bl -tag -width ".Pa /usr/ports/*/*/*" -compact +.It Pa /usr/ports/*/*/* +.El +.Sh EXAMPLES +The following is an example of a typical usage +of the +.Nm +command: +.Pp +.Dl "portless gcc\e*" +.Sh AUTHOR +The +.Nm +utility and this manual page were written by +.An Martin Kammerhofer Aq mkamm@gmx.net . +.\" EOF diff --git a/ports-mgmt/portless/files/portless.sh b/ports-mgmt/portless/files/portless.sh new file mode 100644 index 000000000000..5681e9ab2d53 --- /dev/null +++ b/ports-mgmt/portless/files/portless.sh @@ -0,0 +1,92 @@ +#! /bin/sh -- +# (X)Emacs: -*- mode: Shell-Script; coding: iso8859-1; -*- +# @(#)portless.sh,v 1.3 2006/06/08 10:10:56 martin Exp +# Show "pkg-descr" file of matching port(s). +# +# Copyright (c) 2006 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 +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +Script=`basename $0` # name of this script + +# set defaults +opt_f="" +PORTSDIR=${PORTSDIR:-/usr/ports} +PAGER=${PAGER=$:-less -e} +PKGDESCR="pkg-descr" + +# print usage message to stderr and exit +usage() +{ + while [ $# != 0 ]; do + echo >&2 "$Script: $1" + shift + done + echo >&2 "usage: $Script [-dfiMmp] [-P pager] 'portglob'..." + exit 64 # EX_USAGE +} + +# process options +while getopts "D:dfiMmpP:" option + do + case "$option" in + (D) PORTSDIR="$OPTARG";; + (d) PKGDESCR="pkg-descr";; + (f) opt_f="f";; + (i) PKGDESCR="distinfo";; + (M) PKGDESCR="Makefile";; + (m) PKGDESCR="pkg-message";; + (p) PKGDESCR="pkg-plist";; + (P) PAGER="$OPTARG";; + (*) usage;; + esac +done +shift $(($OPTIND - 1)) + +# there must be at least one argument +if [ $# = 0 ]; then + usage +fi + +# main +for p in "$@"; do + case "$p" in + (*/*/*) + usage "portglob '$p' contains more than one slash!";; + + (*/*) + if [ -n "$opt_f" ]; then + $PAGER "$PORTSDIR/$p/$PKGDESCR" + else + $PAGER "$PORTSDIR"/$p/"$PKGDESCR" + fi;; + + (*) + if [ -n "$opt_f" ]; then + $PAGER "$PORTSDIR"/[a-z]*/"$p/$PKGDESCR" + else + $PAGER "$PORTSDIR"/[a-z]*/$p/"$PKGDESCR" + fi;; + esac +done + +#EOF# diff --git a/ports-mgmt/portless/pkg-descr b/ports-mgmt/portless/pkg-descr new file mode 100644 index 000000000000..f50213ae140d --- /dev/null +++ b/ports-mgmt/portless/pkg-descr @@ -0,0 +1,9 @@ +portless is a small shell script which lets FreeBSD users quickly browse +port descriptions given the port's name or a glob. Basically to view +the descriptions of GCC (related) ports you type + portless gcc\* +and portless will display the descriptions of all gcc* ports. +There are options to display the postinstall messages or Makefiles instead. + +- Martin Kammerhofer + mkamm@gmx.net |