Annotation of /trunk/mage/usr/lib/mage/pkgsearch.sh
Parent Directory
|
Revision Log
Revision 40 -
(hide annotations)
(download)
(as text)
Thu Jan 6 23:28:28 2005 UTC (19 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 1502 byte(s)
Thu Jan 6 23:28:28 2005 UTC (19 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 1502 byte(s)
updated revision tags
1 | niro | 24 | #!/bin/bash |
2 | |||
3 | #pkgsearch | ||
4 | |||
5 | #searches given MAGE-TREE for hits | ||
6 | |||
7 | niro | 40 | # version: 0.3.6-r10 |
8 | niro | 24 | |
9 | SEARCHFILE=$1 | ||
10 | |||
11 | source /etc/mage.rc | ||
12 | source /etc/init.d/functions | ||
13 | |||
14 | #missing color: | ||
15 | COLGRAY="\033[0;6m\033[37m" | ||
16 | |||
17 | echo "Searching for ${SEARCHFILE} ..." | ||
18 | |||
19 | #get files | ||
20 | RESULT=$(find ${MAGEDIR} -name *${SEARCHFILE}*.mage) | ||
21 | |||
22 | #show it | ||
23 | for i in ${RESULT} | ||
24 | do | ||
25 | |||
26 | # | ||
27 | # old stuff; wanna test what looks better :) | ||
28 | # | ||
29 | # source ${i} | ||
30 | # if [ ${STATE} == "stable" ] | ||
31 | # then | ||
32 | # CATEGORIE=$(dirname ${i}|sed -e "s:${MAGEDIR}::g"|cut -d / -f2) | ||
33 | # APPNAME=$(basename $(dirname ${i})) | ||
34 | # VERSION=$(basename ${i} .mage|sed -e "s:${APPNAME}::g") | ||
35 | # echo -en "\t${COLGREEN}${CATEGORIE}/${APPNAME}${COLDEFAULT}" | ||
36 | # echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
37 | # fi | ||
38 | |||
39 | source ${i} | ||
40 | |||
41 | CATEGORIE=$(dirname ${i}|sed -e "s:${MAGEDIR}::g"|cut -d / -f2) | ||
42 | APPNAME=$(basename $(dirname ${i})) | ||
43 | VERSION=$(basename ${i} .mage|sed -e "s:${APPNAME}::g") | ||
44 | case ${STATE} in | ||
45 | stable) | ||
46 | echo -en " " | ||
47 | echo -en "${COLGREEN}${CATEGORIE}/${APPNAME}${COLDEFAULT}" | ||
48 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
49 | ;; | ||
50 | unstable) | ||
51 | echo -en ${COLRED}" [unstable] " | ||
52 | echo -en "${COLRED}${CATEGORIE}/${APPNAME}${COLDEFAULT}" | ||
53 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
54 | ;; | ||
55 | old) | ||
56 | echo -en ${COLGRAY}" [deprecated] " | ||
57 | echo -en "${COLGRAY}${CATEGORIE}/${APPNAME}${COLDEFAULT}" | ||
58 | echo -e " ${COLBLUE}[${VERSION#-*}]${COLDEFAULT}" | ||
59 | ;; | ||
60 | esac | ||
61 | |||
62 | #let us be a little bit safer | ||
63 | unset STABLE CATEGORIE APPNAME VERSION | ||
64 | done | ||
65 | echo |
Properties
Name | Value |
---|---|
svn:executable | * |