Commit ffd5a761 by Andreas Tille

Give better help, enable switch to force public mirror

parent aa552886
......@@ -4,10 +4,19 @@
# This query gives a list of source packages ordered by votes of binary
# package with maximum vote and the availability of a test suite
if [ $# -ne 2 ] ; then
echo "Usage: $0 <blend> <task>"
exit 1
fi
usage() {
cat >/dev/stderr <<EOT
Usage: $0 [option] <blend> <task>
-h this help screen
-m forcing public mirror over local one
Description:
Query UDD for packages belonging to a task of a specified blend.
The output is sorted according to usage statistics and contains
information about existence of an autopkgtest as well whether the
interface might require X11 or not.
EOT
}
if [ ! $(which psql) ] ; then
cat <<EOT
......@@ -32,6 +41,30 @@ if ! psql $PORT $SERVICE -c "" 2>/dev/null ; then
SERVICE="--host=public-udd-mirror.xvm.mit.edu --username=public-udd-mirror udd"
fi
while getopts "hjm" o; do
case "${o}" in
h)
usage
exit 0
;;
m)
PORT="--port=5432"
export PGPASSWORD="public-udd-mirror"
SERVICE="--host=public-udd-mirror.xvm.mit.edu --username=public-udd-mirror udd"
;;
*)
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ $# -ne 2 ] ; then
usage
exit 1
fi
psql $SERVICE <<EOT
SELECT source, vote, MAX(testsuite) as testsuite, tags FROM (
SELECT source, vote, testsuite, tags, row_number() OVER (PARTITION BY source ORDER BY vote DESC) FROM (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment