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

« back to all changes in this revision

Viewing changes to elvi/debcontents

  • Committer: Bazaar Package Importer
  • Author(s): Ian Beckwith
  • Date: 2008-07-25 05:14:30 UTC
  • mfrom: (1.1.2 upstream) (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080725051430-2uo53spku6iz8z5i
Backport slinuxdoc fix from 2.2.3 prerelease.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
 
# $Id: debcontents,v 1.9 2008-03-11 12:59:45 ianb-guest Exp $
 
2
# $Id: debcontents,v 1.10 2008-07-03 00:22:43 ianb-guest Exp $
3
3
# elvis: debcontents    -- Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com)
4
4
. surfraw || exit 1
5
5
 
6
6
w3_config_hook () {
7
7
def   SURFRAW_debcontents_arch    i386
8
8
def   SURFRAW_debcontents_distro  stable
9
 
def   SURFRAW_debcontents_search  ""
 
9
def   SURFRAW_debcontents_search  "files"
10
10
defyn SURFRAW_debcontents_ubuntu  no
 
11
defyn SURFRAW_debcontents_archive no
11
12
}
12
13
 
13
14
w3_usage_hook () {
16
17
Description:
17
18
  Search contents of debian/ubuntu packages (packages.debian.org/packages.ubuntu.com)
18
19
Local options:
 
20
  -a                            Search archived debian releases
19
21
  -u                            Search ubuntu packages instead of debian
20
22
  -search=                      Type of search
21
 
      files             |       Packages that contain files named like this (debian, ubuntu)
22
 
      path              |       Paths ending with the keyword (debian)
23
 
      dirs              |       Packages that contain files or directories
24
 
                                named like this (ubuntu)
 
23
      files             |       Packages that contain files named like this
 
24
      path              |       Paths ending with the keyword
25
25
      word              |       Packages that contain files or directories
26
 
                                whose names contain the keyword (debian, ubuntu)
27
 
      list                      List all files in this package (ubuntu)
 
26
                                whose names contain the keyword
28
27
                                Default: $SURFRAW_debcontents_search
29
28
                                Environment: SURFRAW_debcontents_search
30
29
  -arch=                        Specialized search on architecture
49
48
       testing          |       Testing
50
49
       unstable         |       Unstable
51
50
       oldstable        |       Old Stable
 
51
     Archived Debian (-a):
 
52
      bo                |       1.3.1
 
53
      hamm              |       2.0
 
54
      slink             |       2.1
 
55
      potato            |       2.2
 
56
      woody             |       3.0
52
57
     Ubuntu (-u):
53
58
       dapper           |       Dapper
54
59
       dapper-updates   |       Dapper Updates
55
60
       dapper-backports |       Dapper Backports
56
 
       edgy             |       Edgy
57
 
       edgy-updates     |       Edgy Updates
58
 
       edgy-backports   |       Edgy Backports
59
61
       feisty           |       Feisty
60
62
       feisty-updates   |       Feisty Updates
61
63
       feisty-backports |       Feisty Backports
65
67
       hardy            |       Hardy
66
68
       hardy-updates    |       Hardy Updates
67
69
       hardy-backports  |       Hardy Backports
 
70
       intrepid         |       Intrepid
68
71
                                Default: $SURFRAW_debcontents_distro
69
72
                                Environment: SURFRAW_debcontents_distro
70
73
EOF
79
82
        -distro=*)  setopt   SURFRAW_debcontents_distro  $optarg        ;;
80
83
        -search=*)  setopt   SURFRAW_debcontents_search  $optarg        ;;
81
84
        -u*)        setoptyn SURFRAW_debcontents_ubuntu  yes            ;;
 
85
        -a*)        setoptyn SURFRAW_debcontents_archive yes            ;;
82
86
        -ca*)       setoptyn SURFRAW_debcontents_usecase yes            ;;
83
87
        *) return 1 ;;
84
88
    esac
89
93
w3_parse_args "$@"
90
94
# w3_args now contains a list of arguments
91
95
 
92
 
if ifyes SURFRAW_debcontents_ubuntu
 
96
if   ifyes SURFRAW_debcontents_ubuntu
93
97
then
94
98
        searchpage="http://packages.ubuntu.com/#search_contents"
95
99
        searchurl="http://packages.ubuntu.com/search"
 
100
elif ifyes SURFRAW_debcontents_archive
 
101
then
 
102
        searchpage="http://archive.debian.net/#search_contents"
 
103
        searchurl="http://archive.debian.net/search"
96
104
else
97
105
        searchpage="http://packages.debian.org/#search_contents"
98
106
        searchurl="http://packages.debian.org/search"
115
123
    url="$url&suite=${SURFRAW_debcontents_distro}"
116
124
 
117
125
    case "$SURFRAW_debcontents_search" in
118
 
        "")  url="$url&mode=path"           ;;
119
 
        p*)  url="$url&mode=path"           ;;
120
 
        f*)  url="$url&mode=exactfilename"  ;;
121
 
        w*)  url="$url&mode=filename"       ;;
122
 
        *)   err "Unknown search type"      ;;
 
126
        p*)      if ifyes SURFRAW_debcontents_ubuntu ||
 
127
                    ifyes SURFRAW_debcontents_archive
 
128
                 then
 
129
                    searchmode=""
 
130
                 else
 
131
                    searchmode=path
 
132
                 fi;;
 
133
        f*)      searchmode=exactfilename  ;;
 
134
        w*)      searchmode=filename       ;;
 
135
        *)       err "Unknown search type" ;;
123
136
    esac
124
137
 
 
138
    url="${url}&mode=${searchmode}"
125
139
    w3_browse_url "$url"
126
140
fi