2
# elvis: rpmsearch -- Search for RPMs in various distros
3
# ianb@erislabs.net 20091112
7
def SURFRAW_rpmsearch_distro all
8
def SURFRAW_rpmsearch_version all
9
def SURFRAW_rpmsearch_arch all
10
def SURFRAW_rpmsearch_by rpmname
15
Usage: $w3_argv0 [options] [search words]...
17
Search for RPMs in various distros
19
-search=TYPE Search by TYPE
20
rpmname | RPM name (default)
21
fuzzyname | Fuzzy name match
27
Default: $SURFRAW_rpmsearch_by
28
Environment: SURFRAW_rpmsearch_by
29
-distro=NAME Search in distribution NAME
40
Scientific | Scientific
41
Default: $SURFRAW_rpmsearch_distro
42
Environment: SURFRAW_rpmsearch_distro
43
-arch=NAME Search in architecture NAME
44
all (default), alpha, athlon, i386, i486,
45
i586, i686, ia64, ppc, ppc64, sparc, sparc64,
47
Default: $SURFRAW_rpmsearch_arch
48
Environment: SURFRAW_rpmsearch_arch
49
-version=VER Search in distro version VER
50
all (default), 10, 10.0, 10.0-community, 10.1,
51
10.1-community, 10.2, 10.2-community, 10.3, 11,
52
11.0, 11.1, 2, 2006.0, 2006.0-community,
53
2007.0, 2007.1, 2008.0, 2008.1, 2009.0, 2009.1,
54
2010.0, 3, 4, 40, 4.0, 4.1, 46, 5, 50, 51,
55
5.1, 52, 5.2, 6, 7, 7.0, 7.1, 7.2, 8, 8.0, 8.1,
56
8.2, 9, 9.0, 9.1, 9.2, ac, community, cooker,
57
cs4.0, current, devel, development, factory, th
58
Default: $SURFRAW_rpmsearch_version
59
Environment: SURFRAW_rpmsearch_version
64
w3_parse_option_hook () {
68
-dist*=*) setopt SURFRAW_rpmsearch_distro "$optarg" ;;
69
-ver*=*) setopt SURFRAW_rpmsearch_version "$optarg" ;;
70
-arch*=*) setopt SURFRAW_rpmsearch_arch "$optarg" ;;
71
-ver*=*) setopt SURFRAW_rpmsearch_version "$optarg" ;;
72
-sear*=*) setopt SURFRAW_rpmsearch_by "$optarg" ;;
80
# w3_args now contains a list of arguments
82
if test -z "$w3_args"; then
83
w3_browse_url "http://sophie.zarb.org/rpmfind"
85
escaped_args=`w3_url_of_arg $w3_args`
87
if [ "$SURFRAW_rpmsearch_distro" = all ]
89
SURFRAW_rpmsearch_distro=""
92
if [ "$SURFRAW_rpmsearch_version" = all ]
94
SURFRAW_rpmsearch_version=""
97
if [ "$SURFRAW_rpmsearch_arch" = all ]
99
SURFRAW_rpmsearch_arch=""
102
w3_browse_url "http://sophie.zarb.org/rpmfind?distrib=${SURFRAW_rpmsearch_distro}&version=${SURFRAW_rpmsearch_version}&arch=${SURFRAW_rpmsearch_arch}&search=${escaped_args}&st=${SURFRAW_rpmsearch_by}"