Commit 769519dc authored by Andreas Tille's avatar Andreas Tille

Enable command line switch for aging packages to select local or public UDD

parent e2d36458
#!/bin/sh
./aging_packages_of_blend debian-med
./aging_packages_of_blend -m debian-med
# remove info about packages we have just checked and realised that we
# can not do much about it to update it. Responsible maintainers are
# informed (in most cases)
......
#!/bin/sh
# seek for packages uploaded a very long time ago by a Blend
usage() {
cat >/dev/stderr <<EOT
Usage: $0 [option] <blend>
-h this help screen
-m forcing public mirror over local one
Description:
Query UDD for all packages of a Blend and sort these by upload age
EOT
}
if [ ! $(which psql) ] ; then
cat <<EOT
No PostgreSQL client providing /usr/bin/psql installed.
On a Debian system please
sudo apt-get install postgresql-client-common
EOT
exit 1
fi
SERVICE="service=udd"
#if there is a local UDD clone just use this
if psql -l 2>/dev/null | grep -qw udd ; then
if psql $PORT -l 2>/dev/null | grep -qw udd ; then
SERVICE=udd
fi
# Check UDD connection
if ! psql $PORT $SERVICE -c "" 2>/dev/null ; then
echo "No local UDD found, use public mirror."
export PGPASSWORD="public-udd-mirror"
SERVICE="--host=public-udd-mirror.xvm.mit.edu --port=5432 --username=public-udd-mirror udd"
fi
while getopts "hjm" o; do
case "${o}" in
h)
usage
exit 0
;;
m)
export PGPASSWORD="public-udd-mirror"
SERVICE="--host=public-udd-mirror.xvm.mit.edu --port=5432 --username=public-udd-mirror udd"
;;
*)
usage
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ $# -ne 1 ] ; then
usage
exit 1
fi
psql $SERVICE >$1.out <<EOT
SELECT u.source, u.version, cast(u.date as date) AS date, s.release, u.distribution, u.maintainer_name, u.changed_by_name, u.signed_by_name FROM (
SELECT source, r.release, strip_binary_upload(MAX(version)) AS version,
......
#!/bin/sh
# seek for packages uploaded a very long time ago by a Blend
SERVICE="service=udd"
#if there is a local UDD clone just use this
if psql -l 2>/dev/null | grep -qw udd ; then
SERVICE=udd
fi
SERVICE="--host=public-udd-mirror.xvm.mit.edu --port=5432 --username=public-udd-mirror udd"
export PGPASSWORD="public-udd-mirror"
psql $SERVICE >$1.out <<EOT
SELECT u.source, u.version, cast(u.date as date) AS date, s.release, u.distribution, u.maintainer_name, u.changed_by_name, u.signed_by_name FROM (
SELECT source, r.release, strip_binary_upload(MAX(version)) AS version,
row_number() OVER (PARTITION BY source ORDER BY r.sort DESC)
FROM blends_dependencies b
JOIN packages p ON p.package = b.package
JOIN releases r ON p.release = r.release
WHERE blend = '$1' AND b.dependency != 'i' AND
(r.sort >= (SELECT sort FROM releases WHERE role = 'stable') OR r.sort = 0) -- 0 for experimental
GROUP BY source, r.release, r.sort
) s
JOIN upload_history u ON s.source = u.source AND s.version = u.version
WHERE row_number = 1
ORDER BY date, source
;
EOT
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