~ubuntu-branches/ubuntu/trusty/surfraw/trusty-proposed

« back to all changes in this revision

Viewing changes to elvi/rpmsearch

  • Committer: Bazaar Package Importer
  • Author(s): Ian Beckwith
  • Date: 2009-11-20 03:34:34 UTC
  • mfrom: (1.1.5 upstream) (4.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091120033434-gwrdq4frtunem00q
* New upstream version.
  + Only use first matching bookmark (Closes: #530786).
  + Fix debsec (patch from Moritz Muehlenhoff) (Closes: #550741).
* Remove Moritz from Uploaders (per #550741), thanks for your work!.
* debian/rules: call dh_installexamples to install examples/ dir.
* debian/control:
  + update vcs- fields to point to new git repo.
  + Standards-Version: 3.8.3 (No changes).
  + add Recommends: curl | wget | libwww-perl for -o.
  + Remove Conflicts/Replaces: surfaw, this transition was complete
    many releases ago.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# elvis: rpmsearch      -- Search for RPMs in various distros
 
3
# ianb@erislabs.net 20091112
 
4
. surfraw || exit 1
 
5
 
 
6
w3_config_hook () {
 
7
    def   SURFRAW_rpmsearch_distro  all
 
8
    def   SURFRAW_rpmsearch_version all
 
9
    def   SURFRAW_rpmsearch_arch    all
 
10
    def   SURFRAW_rpmsearch_by      rpmname
 
11
}
 
12
 
 
13
w3_usage_hook () {
 
14
    cat <<EOF
 
15
Usage: $w3_argv0 [options] [search words]...
 
16
Description:
 
17
  Search for RPMs in various distros
 
18
Local options:
 
19
  -search=TYPE                  Search by TYPE
 
20
          rpmname       |        RPM name (default)
 
21
          fuzzyname     |        Fuzzy name match
 
22
          provide       |        Provides
 
23
          require       |        Requires
 
24
          conflict      |        Conflicts
 
25
          obsolete      |        Obsoletes
 
26
          trigger       |        Triggers
 
27
                                Default: $SURFRAW_rpmsearch_by
 
28
                                Environment: SURFRAW_rpmsearch_by
 
29
  -distro=NAME                  Search in distribution NAME
 
30
          all           |        All (default)
 
31
          Altlinux      |        Altlinux
 
32
          Arklinux      |        Arklinux
 
33
          Caosity       |        Caosity
 
34
          CentOS        |        CentOS
 
35
          Fedora        |        Fedora
 
36
          Mandriva      |        Mandriva
 
37
          Momonga       |        Momonga
 
38
          OpenSuse      |        OpenSuse
 
39
          PLD           |        PLD
 
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,
 
46
    sparcv9, x86_64
 
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
 
60
EOF
 
61
    w3_global_usage
 
62
}
 
63
 
 
64
w3_parse_option_hook () {
 
65
    opt="$1"
 
66
    optarg="$2"
 
67
    case "$opt" in
 
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" ;;
 
73
    *) return 1 ;;
 
74
    esac
 
75
    return 0
 
76
}
 
77
 
 
78
w3_config
 
79
w3_parse_args "$@"
 
80
# w3_args now contains a list of arguments
 
81
 
 
82
if test -z "$w3_args"; then
 
83
    w3_browse_url "http://sophie.zarb.org/rpmfind"
 
84
else
 
85
    escaped_args=`w3_url_of_arg $w3_args`
 
86
 
 
87
    if [ "$SURFRAW_rpmsearch_distro" = all ]
 
88
    then
 
89
        SURFRAW_rpmsearch_distro=""
 
90
    fi
 
91
 
 
92
    if [ "$SURFRAW_rpmsearch_version" = all ]
 
93
    then
 
94
        SURFRAW_rpmsearch_version=""
 
95
    fi
 
96
 
 
97
    if [ "$SURFRAW_rpmsearch_arch" = all ]
 
98
    then
 
99
        SURFRAW_rpmsearch_arch=""
 
100
    fi
 
101
 
 
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}"
 
103
 
 
104
fi