/usr/bin/who-uploads is in devscripts 2.17.6+deb9u2.
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | #!/bin/bash
# who-uploads sourcepkg [ sourcepkg ... ]
# Tells you who made the latest uploads of a source package.
# NB: I'm encoded in UTF-8!!
# Written and copyright 2006 by Julian Gilbey <jdg@debian.org>
# Based on an original script
# copyright 2006 Adeodato Simó <dato@net.com.org.es>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
PROGNAME=`basename $0`
MODIFIED_CONF_MSG='Default settings modified by devscripts configuration files:'
usage () {
echo \
"Usage: $PROGNAME [options] package ...
Display the most recent three uploaders of each package.
Packages should be source packages, not binary packages.
Options:
-M, --max-uploads=N
Display at most the N most recent uploads (default: 3)
--keyring KEYRING Add KEYRING as a GPG keyring for Debian Developers'
keys in addition to /usr/share/keyrings/debian-keyring.*
and /usr/share/keyrings/debian-maintainers.gpg;
this option may be given multiple times
--no-default-keyrings
Do not use the default keyrings
--no-conf, --noconf
Don't read devscripts config files;
must be the first option given
--date Display the date of the upload
--no-date, --nodate
Don't display the date of the upload (default)
--help Show this message
--version Show version and copyright information
$MODIFIED_CONF_MSG"
}
version () {
echo \
"This is $PROGNAME, from the Debian devscripts package, version 2.17.6+deb9u2
This code is copyright 2006 by Julian Gilbey <jdg@debian.org>,
all rights reserved.
Based on original code copyright 2006 Adeodato Simó <dato@net.com.org.es>
This program comes with ABSOLUTELY NO WARRANTY.
You are free to redistribute this code under the terms of the
GNU General Public License, version 2 or later."
}
# Boilerplate: set config variables
DEFAULT_WHOUPLOADS_KEYRINGS=/usr/share/keyrings/debian-keyring.gpg:/usr/share/keyrings/debian-maintainers.gpg
DEFAULT_WHOUPLOADS_MAXUPLOADS=3
DEFAULT_WHOUPLOADS_DATE=no
VARS="WHOUPLOADS_KEYRINGS WHOUPLOADS_MAXUPLOADS WHOUPLOADS_DATE"
GPG=gpg
if ! command -v $GPG >/dev/null 2>&1; then
echo "$GPG missing"
GPG=gpg2
if ! command -v $GPG >/dev/null 2>&1; then
echo "$GPG missing"
exit 1
fi
fi
if [ "$1" = "--no-conf" -o "$1" = "--noconf" ]; then
shift
MODIFIED_CONF_MSG="$MODIFIED_CONF_MSG
(no configuration files read)"
# set defaults
for var in $VARS; do
eval "$var=\$DEFAULT_$var"
done
else
# Run in a subshell for protection against accidental errors
# in the config files
eval $(
set +e
for var in $VARS; do
eval "$var=\$DEFAULT_$var"
done
for file in /etc/devscripts.conf ~/.devscripts
do
[ -r $file ] && . $file
done
set | grep "^WHOUPLOADS_")
# check sanity
if [ "$WHOUPLOADS_MAXUPLOADS" != \
"$(echo \"$WHOUPLOADS_MAXUPLOADS\" | tr -cd 0-9)" ]; then
WHOUPLOADS_MAXUPLOADS=3
fi
WHOUPLOADS_DATE="$(echo "$WHOUPLOADS_DATE" | tr A-Z a-z)"
if [ "$WHOUPLOADS_DATE" != "yes" ] && [ "$WHOUPLOADS_DATE" != "no" ]; then
WHOUPLOADS_DATE=no
fi
# don't check WHOUPLOADS_KEYRINGS here
# set config message
MODIFIED_CONF=''
for var in $VARS; do
eval "if [ \"\$$var\" != \"\$DEFAULT_$var\" ]; then
MODIFIED_CONF_MSG=\"\$MODIFIED_CONF_MSG
$var=\$$var\";
MODIFIED_CONF=yes;
fi"
done
if [ -z "$MODIFIED_CONF" ]; then
MODIFIED_CONF_MSG="$MODIFIED_CONF_MSG
(none)"
fi
fi
MAXUPLOADS=$WHOUPLOADS_MAXUPLOADS
WANT_DATE=$WHOUPLOADS_DATE
declare -a GPG_DEFAULT_KEYRINGS
declare -a GPG_KEYRINGS
# Command-line options
TEMP=$(getopt -s bash -o 'h' \
--long max-uploads:,keyring:,no-default-keyrings \
--long no-conf,noconf \
--long date,nodate,no-date \
--long help,version \
--options M: \
-n "$PROGNAME" -- "$@") || (usage >&2; exit 1)
eval set -- $TEMP
# Process Parameters
while [ "$1" ]; do
case $1 in
--max-uploads|-M)
shift
if [ "$1" = "$(echo \"$1\" | tr -cd 0-9)" ]; then
MAXUPLOADS=$1
fi
;;
--keyring)
shift
if [ -f "$1" ]; then
GPG_KEYRINGS=("${GPG_KEYRINGS[@]}" "--keyring" "$1")
else
echo "Could not find keyring $1, skipping" >&2
fi
;;
--no-default-keyrings)
WHOUPLOADS_KEYRINGS=
;;
--no-conf|--noconf)
echo "$PROGNAME: $1 is only acceptable as the first command-line option!" >&2
exit 1 ;;
--date) WANT_DATE=yes ;;
--no-date|--nodate) WANT_DATE=no ;;
--help|-h) usage; exit 0 ;;
--version) version; exit 0 ;;
--) shift; break ;;
*) echo "$PROGNAME: bug in option parser, sorry!" >&2 ; exit 1 ;;
esac
shift
done
OIFS="$IFS"
IFS=:
for keyring in $WHOUPLOADS_KEYRINGS; do
if [ -f "$keyring" ]; then
GPG_DEFAULT_KEYRINGS=("${GPG_DEFAULT_KEYRINGS[@]}" "--keyring" "$keyring")
elif [ -n "$keyring" ]; then
echo "Could not find keyring $keyring, skipping it" >&2
fi
done
IFS="${OIFS:- }"
GNUPGHOME=$(mktemp -d)
trap '[ ! -d "$GNUPGHOME" ] || rm -r "$GNUPGHOME"' HUP INT QUIT PIPE ALRM TERM
export GNUPGHOME
# Some useful abbreviations for gpg options
GPG_OPTIONS="--no-options --no-auto-check-trustdb --no-default-keyring"
GPG_NO_KEYRING="$GPG_OPTIONS --keyring /dev/null"
if [ $# -eq 0 ]; then
usage;
exit 1
fi
# Now actually get the reports :)
for package; do
echo "Uploads for $package:"
prefix=$(echo $package | sed -re 's/^((lib)?.).*$/\1/')
pkgurl="https://packages.qa.debian.org/${prefix}/${package}.html"
baseurl="https://packages.qa.debian.org/${prefix}/"
# only grab the actual "Accepted" news announcements; hopefully this
# won't pick up many false positives
WGETOPTS="-q -O - --timeout=30 "
count=0
for news in $(wget $WGETOPTS $pkgurl |
sed -ne 's%^.*<a href="\('$package'/news/[0-9A-Z]*\.html\)">Accepted .*%\1%p'); do
HTML_TEXT=$(wget $WGETOPTS "$baseurl$news")
GPG_TEXT=$(echo "$HTML_TEXT" |
sed -ne 's/^<pre>//; /-----BEGIN PGP SIGNED MESSAGE-----/,/-----END PGP SIGNATURE-----/p')
test -n "$GPG_TEXT" || continue
VERSION=$(echo "$GPG_TEXT" | awk '/^Version/ { print $2; exit }')
DISTRO=$(echo "$GPG_TEXT" | awk '/^Distribution/ { print $2; exit }')
if [ "$WANT_DATE" = "yes" ]; then
DATE=$(echo "$HTML_TEXT" | sed -ne 's%<li><em>Date</em>: \(.*\)</li>%\1%p')
fi
GPG_ID=$(echo "$GPG_TEXT" | LC_ALL=C $GPG $GPG_NO_KEYRING --keyid-format long --verify 2>&1 |
sed -rne 's/.*using [^ ]* key ([0-9A-Z]+).*/\1/p')
UPLOADER=$($GPG $GPG_OPTIONS \
"${GPG_DEFAULT_KEYRINGS[@]}" "${GPG_KEYRINGS[@]}" \
--list-key --with-colons --fixed-list-mode $GPG_ID 2>/dev/null |
awk -F: '/@debian\.org>/ { a = $10; exit} /^uid/ { a = $10; exit} END { print a }' )
if [ -z "$UPLOADER" ]; then UPLOADER="<unrecognised public key ($GPG_ID)>"; fi
output="$VERSION to $DISTRO: $UPLOADER"
[ "$WANT_DATE" = "yes" ] && output="$output on $DATE"
echo $output | iconv -c -f UTF-8
count=$(($count + 1))
[ $count -eq $MAXUPLOADS ] && break
done
test $# -eq 1 || echo
done
[ ! -d "$GNUPGHOME" ] || rm -r "$GNUPGHOME"
exit 0
|