Annotation of /trunk/mage/usr/lib/mage/pkgsearch.sh
Parent Directory | Revision Log
Revision 284 -
(hide annotations)
(download)
(as text)
Sat Nov 5 15:05:47 2005 UTC (18 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 1365 byte(s)
Sat Nov 5 15:05:47 2005 UTC (18 years, 10 months ago) by niro
File MIME type: application/x-sh
File size: 1365 byte(s)
nicer output, added testing state support
1 | niro | 24 | #!/bin/bash |
2 | |||
3 | niro | 284 | # pkgsearch |
4 | niro | 24 | |
5 | niro | 284 | # searches given MAGE-TREE for hits |
6 | niro | 24 | |
7 | niro | 284 | # $Header: /home/cvsd/magellan-cvs/magellan-src/mage/usr/lib/mage/pkgsearch.sh,v 1.8 2005-11-05 15:05:47 niro Exp $ |
8 | niro | 24 | |
9 | SEARCHFILE=$1 | ||
10 | |||
11 | source /etc/mage.rc | ||
12 | source /etc/init.d/functions | ||
13 | |||
14 | niro | 284 | # missing color: |
15 | niro | 24 | COLGRAY="\033[0;6m\033[37m" |
16 | |||
17 | echo "Searching for ${SEARCHFILE} ..." | ||
18 | |||
19 | niro | 284 | # get files |
20 | niro | 24 | RESULT=$(find ${MAGEDIR} -name *${SEARCHFILE}*.mage) |
21 | |||
22 | niro | 284 | # show it |
23 | niro | 24 | for i in ${RESULT} |
24 | do | ||
25 | niro | 284 | source ${i} |
26 | niro | 24 | |
27 | CATEGORIE=$(dirname ${i}|sed -e "s:${MAGEDIR}::g"|cut -d / -f2) | ||
28 | APPNAME=$(basename $(dirname ${i})) | ||
29 | VERSION=$(basename ${i} .mage|sed -e "s:${APPNAME}::g") | ||
30 | case ${STATE} in | ||
31 | stable) | ||
32 | niro | 284 | echo -en ${COLGREEN}" [s] " |
33 | niro | 24 | echo -en "${COLGREEN}${CATEGORIE}/${APPNAME}${COLDEFAULT}" |
34 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
35 | ;; | ||
36 | niro | 284 | testing) |
37 | echo -en ${COLYELLOW}" [t] " | ||
38 | echo -en "${COLYELLOW}${CATEGORIE}/${APPNAME}${COLDEFAULT}" | ||
39 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
40 | ;; | ||
41 | niro | 24 | unstable) |
42 | niro | 284 | echo -en ${COLRED}" [u] " |
43 | niro | 24 | echo -en "${COLRED}${CATEGORIE}/${APPNAME}${COLDEFAULT}" |
44 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
45 | ;; | ||
46 | old) | ||
47 | niro | 284 | echo -en ${COLGRAY}" [d] " |
48 | niro | 24 | echo -en "${COLGRAY}${CATEGORIE}/${APPNAME}${COLDEFAULT}" |
49 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
50 | ;; | ||
51 | esac | ||
52 | niro | 284 | |
53 | # let us be a little bit safer | ||
54 | niro | 24 | unset STABLE CATEGORIE APPNAME VERSION |
55 | done | ||
56 | echo |
Properties
Name | Value |
---|---|
svn:executable | * |