/usr/lib/surfraw/debvcsbrowse is in surfraw 2.2.9-1.
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 | #!/bin/sh
# elvis: debvcsbrowse -- Browse the VCS repository for a Debian package
. surfraw || exit 1
w3_usage_hook () {
cat <<EOF
Usage: $w3_argv0 [package|file.dsc|controlfile]
Description:
Browse the VCS repository for a Debian package
EOF
w3_global_usage
}
extract_vcs_browser ()
{
# sed /I is a gnu extension
grep -i '^vcs-browser:' | head -1 | \
sed 's/^[Vv][Cc][Ss]-[Bb][Rr][Oo][Ww][Ss][Ee][Rr]: *//;'
}
do_control()
{
if [ ! -f $1 ]
then
err $1": file not found"
return
fi
OUT="$(cat $1 | extract_vcs_browser)"
if [ -z "$OUT" ]
then
err $1": no Vcs-Browser field"
else
echo "$OUT"
fi
}
do_package()
{
if [ ! -x "`which apt-cache`" ]
then
err "apt-cache not installed. Try finding the vcs via debpts instead"
return
fi
OUT="$(apt-cache showsrc $1)"
if [ -z "$OUT" ]
then
err $1": package not found"
return
fi
OUT="$(echo "$OUT" | extract_vcs_browser)"
if [ -z "$OUT" ]
then
err $1": no Vcs-Browser field"
else
echo "$OUT"
fi
}
w3_config
w3_parse_args "$@"
# w3_args now contains a list of arguments
if test -z "$w3_args"; then
w3_usage_hook
exit
fi
case "$w3_args" in
*.dsc|*control) url="$(do_control "$w3_args")" ;;
*) url="$(do_package "$w3_args")" ;;
esac
if [ -n "$url" ]
then
w3_browse_url "$url"
fi
|