3 # Copyright (c) 2006 Matthias Schmidt <schmidtm @ mathematik . uni-marburg.de>
7 # Redistribution and use in source and binary forms, with or without
8 # modification, are permitted provided that the following conditions are met:
10 # - Redistributions of source code must retain the above copyright notice,
11 # this list of conditions and the following disclaimer.
12 # - Redistributions in binary form must reproduce the above copyright notice,
13 # this list of conditions and the following disclaimer in the documentation
14 # and/or other materials provided with the distribution.
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
20 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
23 # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
24 # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
25 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 # $DragonFly: src/usr.bin/pkg_search/pkg_search.sh,v 1.1 2007/12/04 18:24:18 dillon Exp $
30 if [ `uname -s` = "FreeBSD" ]; then
32 id=`uname -r | cut -d '.' -f 1`
34 elif [ `uname -s` = "DragonFly" ] || [ `uname -s` = "NetBSD" ]; then
40 echo "Usage: $0 [ -i | -k ] <name>"
44 if [ ! -d $PORTSDIR ]; then
45 echo "No Ports Tree Found! Please install."
51 awk -F\| -v name="$2" \
55 printf("Name\t: %s-50\nDir\t: %-50s\nDesc\t: %-50s\nURL\t: %-50s\nDeps\t: %s\n\n", $1, $2, $4, $10, $9); \
57 }' ${PORTSDIR}/${INDEXFILE}
60 awk -F\| -v name="$2" \
62 if ($1 ~ name || $4 ~ name || $10 ~ name) { \
64 printf("%-20s\t%-25s\n", $1, $4); \
66 }' ${PORTSDIR}/${INDEXFILE}
70 awk -F\| -v name="$1" \
74 printf("%-20s\t%-25s\n", $1, $4); \
76 }' ${PORTSDIR}/${INDEXFILE}