#! /bin/sh # who-uploads sourcepkg [ sourcepkg ... ] # Prints the latest uploader (and sponsor, if applicable) of a source package. # # Copyright (c) 2006 Adeodato Simó (dato@net.com.org.es) # Licensed under the terms of the MIT license, included below. # BUG: there can be other new items than uploads # TODO: make it a command line option MAX_NEWS_ITEM=3 GPG_NO_KEYRING="gpg --no-options --no-default-keyring --keyring /dev/null" GPG_DEBIAN_KEYRING="gpg --no-options --no-default-keyring" # Add path to the Debian keyrings here # GPG_DEBIAN_KEYRING="$GPG_DEBIAN_KEYRING --keyring /usr/share/keyrings/debian-keyring.gpg" # GPG_DEBIAN_KEYRING="$GPG_DEBIAN_KEYRING --keyring /usr/share/keyrings/debian-keyring.pgp" GPG_DEBIAN_KEYRING="$GPG_DEBIAN_KEYRING --keyring /org/keyring.debian.org/keyrings/debian-keyring.gpg" GPG_DEBIAN_KEYRING="$GPG_DEBIAN_KEYRING --keyring /org/keyring.debian.org/keyrings/debian-keyring.pgp" for package; do echo $package prefix=`echo $package | sed -re 's/^((lib)?.).*$/\1/'` BASE_URL="http://packages.qa.debian.org/${prefix}/${package}/news" for n in `seq 1 "$MAX_NEWS_ITEM"`; do GPG_TEXT=$(lynx -dump "${BASE_URL}/${n}.html" | sed -ne '/-----BEGIN PGP SIGNED MESSAGE-----/,/-----END PGP SIGNATURE-----/p') test -n "$GPG_TEXT" || continue VERSION=$( echo "$GPG_TEXT" | awk '/^Version/ {print $2; exit}' ) GPG_ID=$( echo "$GPG_TEXT" | $GPG_NO_KEYRING --verify 2>&1 | perl -ne 'm/ID (\w+)/ && print "$1\n"' ) UPLOADER=$( $GPG_DEBIAN_KEYRING --list-key --with-colons $GPG_ID | awk -F: '/@debian\.org>/ { a = $10; exit} /^pub/ { a = $10 } END { print a }' ) echo $VERSION $UPLOADER done test $# -eq 1 || echo done ### # MIT LICENSE (http://www.opensource.org/licenses/mit-license.php) # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.