X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=usr_share_grml%2Fzsh%2Ffunctions%2FLookup%2FBackends%2FLOOKUP_be_deb_pts;fp=usr_share_grml%2Fzsh%2Ffunctions%2FLookup%2FBackends%2FLOOKUP_be_deb_pts;h=9fed2644447e5485b025aeed73902b9b23cbda13;hb=1ee27bd79f2b8eae519f6890bc43f5feca13a261;hp=0000000000000000000000000000000000000000;hpb=9ae0b0c0858f15dc7ec46fbd86660dafc3946695;p=grml-etc-core.git diff --git a/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_deb_pts b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_deb_pts new file mode 100644 index 0000000..9fed264 --- /dev/null +++ b/usr_share_grml/zsh/functions/Lookup/Backends/LOOKUP_be_deb_pts @@ -0,0 +1,43 @@ +### vim:ft=zsh:foldmethod=marker +## packages.qa.debian.org backend for lookup +## Copyright: 2009, Frank Terbeck + +LOOKUP_guard || return 1 +[[ -n ${lookup_describe} ]] && + printf '%s' 'debian PTS information about a package' && + return 0 + +local -a comp_args + +LOOKUP_guard -fd LOOKUP_help_${backend} || +function LOOKUP_help_${backend}() { + LOOKUP_guard || return 1 + printf 'usage: %s \n' ${backend} + printf '\n Warps you to a package'\''s page in Debian[1]'\''s Package\n' + printf ' Tracking System[2].\n' + printf '\nExamples\n' + printf ' %% lookup %s wesnoth\n' ${backend} + printf ' %% lookup %s zsh\n' ${backend} + printf '\n[1] \n' + printf '[2] \n' +} +LOOKUP_help && return 0 + +if [[ -n ${lookup_complete} ]] ; then + _message 'debian package' + _deb_packages avail + return 0 +fi + +local -x QUERY + +QUERY="$*" +LOOKUP_query_handler || return 1 +if [[ -z ${QUERY} ]] ; then + LOOKUP_help -f + return 1 +fi + +LOOKUP_encode -q +LOOKUP_browser "http://packages.qa.debian.org/${QUERY}" +return $?