add packages.d.o and relateds support
authorThorsten Glaser <t.glaser@tarent.de>
Tue, 15 Apr 2014 07:21:55 +0000 (09:21 +0200)
committerThorsten Glaser <t.glaser@tarent.de>
Tue, 15 Apr 2014 07:21:55 +0000 (09:21 +0200)
bash-ksh/profile-funcs

index 9325531..835c98f 100644 (file)
@@ -10,7 +10,7 @@ bts() {
 }
 # Debian Package Tracking System, QA, buildd logs Debian, buildd logs D-Ports
 pts() {
-       local p=${1%%_*} not_slash_bksls=$'[!/\t\n\f\r ]'
+       local p=${1%%_*} not_slash_bksls=$'[!/\t\n\f\r ]' r=${1#*_}
 
        if [[ $p = src:* ]]; then
                ${BROWSER:-lynx} "http://packages.debian.org/source/sid/${p#src:}"
@@ -24,6 +24,16 @@ pts() {
                ${BROWSER:-lynx} "http://buildd.debian-ports.org/status/package.php?p=${p#bp:}"
        elif [[ $p = f:* ]]; then
                ${BROWSER:-lynx} "http://packages.debian.org/search?searchon=contents&keywords=${p#f:}&mode=path&suite=unstable&arch=any"
+       elif [[ $p = p:* ]]; then
+               ${BROWSER:-lynx} "http://packages.debian.org/${p#p:}"
+       elif [[ $p = ap:* ]]; then
+               ${BROWSER:-lynx} "http://archive.debian.net/${p#ap:}"
+       elif [[ $p = up:* ]]; then
+               ${BROWSER:-lynx} "http://packages.ubuntu.com/${p#up:}"
+       elif [[ $p = ab:* ]]; then
+               ${BROWSER:-lynx} "http://snapshot.debian.org/binary/${p#ab:}/"
+       elif [[ $p = as:* ]]; then
+               ${BROWSER:-lynx} "http://snapshot.debian.org/package/${p#as:}/${r:+${r%%_*}/}"
        else
                ${BROWSER:-lynx} "http://packages.debian.org/sid/$p"
        fi