File: debcontents

package info (click to toggle)
surfraw 1.0.7-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 468 kB
  • ctags: 68
  • sloc: sh: 4,100; makefile: 170
file content (56 lines) | stat: -rwxr-xr-x 1,708 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/sh
# $Id: debcontents,v 1.2 2001/12/23 10:15:18 proff Exp $
# elvis: debcontents	-- Search contents of debian packages(packages.debian.org)
. surfraw || exit 1

w3_config_hook () {
def   SURFRAW_debian_arch i386
def   SURFRAW_debian_distro stable
def   SURFRAW_debian_search cgi-bin/search_contents.pl
}

w3_usage_hook () {
    cat <<EOF
Usage: $w3_argv0 [options] [search words]...
Description:
  Surfraw search debian packages (packages.debian.org)
Local options:
  -arch=			Specialized search on architecture
	  i386		|	Intel 386
	  m68k		|	M68k
	  alpha		|	alpha
	  sparc		|	sparc
	  powerpc	|	PowerPC
	  arm		|	ARM
                                Default: $SURFRAW_debian_arch
                                Environment: SURFRAW_debian_arch
  -distro=                      Specific distribution
          stable        |       Stable
          testing       |       Testing
          unstable      |       Unstable
                                Default: $SURFRAW_debian_distro
                                Environment: SURFRAW_debian_distro
EOF
    w3_global_usage
}

w3_parse_option_hook () {
    opt="$1"
    optarg="$2"
    case "$opt" in
	-arch=*) setopt   SURFRAW_debian_arch $optarg	;;
	-distro=*)  setopt   SURFRAW_debian_distro  $optarg	;;
	*) return 1 ;;
    esac
    return 0
}

w3_config
w3_parse_args "$@"
# w3_args now contains a list of arguments
if test -z "$w3_args"; then
    w3_browse_url "http://packages.debian.org/#search_contents"
else
    escaped_args=`w3_url_of_arg $w3_args`
    w3_browse_url "http://packages.debian.org/${SURFRAW_debian_search}?word=${escaped_args}&case=insensitive&version=${SURFRAW_debian_distro}&arch=${SURFRAW_debian_arch}&directories=yes"
fi