/usr/lib/surfraw/archpkg is in surfraw 2.2.9-1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | #!/bin/sh
# elvis: archpkg -- Search Arch Linux Packages (www.archlinux.org/packages/)
# Author: jason ryan • http://jasonwryan.com
. surfraw || exit 1
w3_config_hook () {
def SURFRAW_arch_ix "$SURFRAW_ix"
def SURFRAW_arch_repo "$SURFRAW_repo"
def SURFRAW_arch_date "$SURFRAW_date"
def SURFRAW_arch_results 25
}
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [options] [search string]
Description: Surfraw search Arch Linux packages (www.archlinux.org)
Local options:
-arch=ARCHITECTURES | -a=ARCHITECTURES
any | Any (default)
i686 | i686
x86_64 | x86_64
-repo=REPOSITORIES | -r=REPOSITORIES
comm | Community
commtest | Community-Testing
core | Core
extra | Extra
multi | Multilib
multitest | Multilib-Testing
test | Testing
Default: All
-date=UPDATED | -d=UPDATED (format: YYYY-MM-DD)
-num=NUMBER | Number of results per page
Default: $SURFRAW_arch_results
EOF
w3_global_usage
}
w3_parse_option_hook () {
opt="$1"
optarg="$2"
case "$opt" in
-a*=*) setopt SURFRAW_arch_ix $optarg ;;
-r*=*) setopt SURFRAW_arch_repo $optarg ;;
-d*=*) setopt SURFRAW_arch_date $optarg ;;
-n*=*) setopt SURFRAW_arch_results $optarg ;;
*) return 1 ;;
esac
return 0
}
w3_config
w3_parse_args "$@"
# selected repository
case "$SURFRAW_arch_repo" in
comm) repo="Community" ;;
commtest) repo="Community-Testing" ;;
core) repo="Core" ;;
extra) repo="Extra" ;;
multi) repo="Multilib" ;;
multitest)repo="Multilib-Testing" ;;
test) repo="Testing" ;;
*) repo="" ;;
esac
# no arguments present
if [ -z "$w3_args" ]; then
w3_browse_url "http://www.archlinux.org/packages/"
else
# if w3_args contains a list of arguments
escaped_args=$(w3_url_of_arg $w3_args)
base="http://www.archlinux.org/packages/?sort="
# repository and architecture
if [ -n "$SURFRAW_arch_repo" -a "$SURFRAW_arch_ix" ]; then
w3_browse_url "${base}&arch=${SURFRAW_arch_ix}&repo=${repo}&q=${escaped_args}&maintainer=&last_update=${SURFRAW_arch_date}&flagged=&limit=${SURFRAW_arch_results}"
# check for repository
elif [ -n "$SURFRAW_arch_repo" ]; then
w3_browse_url "${base}&repo=${repo}&q=${escaped_args}&maintainer=&last_update=${SURFRAW_arch_date}&flagged=&limit=${SURFRAW_arch_results}"
# just architecture
elif [ -n "$SURFRAW_arch_ix" ]; then
w3_browse_url "${base}&arch=${SURFRAW_arch_ix}&q=${escaped_args}&maintainer=&last_update=${SURFRAW_arch_date}&flagged=&limit=${SURFRAW_arch_results}"
# none of the above...
else
w3_browse_url "${base}&q=${escaped_args}&maintainer=&last_update=${SURFRAW_arch_date}&flagged=&limit=${SURFRAW_arch_results}"
fi
fi
|