summaryrefslogtreecommitdiffstats
path: root/bin/list-versions-engywuck-backports.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/list-versions-engywuck-backports.sh')
-rwxr-xr-xbin/list-versions-engywuck-backports.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/bin/list-versions-engywuck-backports.sh b/bin/list-versions-engywuck-backports.sh
new file mode 100755
index 0000000..11db243
--- /dev/null
+++ b/bin/list-versions-engywuck-backports.sh
@@ -0,0 +1,63 @@
+#!/bin/sh
+
+DATE="20190706T233220Z"
+
+set -e
+
+if [ ! -e /tmp/list-versions_sources.buster ]
+then
+ for ARCHIVE_AREA in main contrib non-free
+ do
+ wget "http://snapshot.debian.org/archive/debian/${DATE}/dists/buster/${ARCHIVE_AREA}/source/Sources.xz" -O - | xz -c -d >> /tmp/list-versions_sources.buster
+ done
+fi
+
+if [ ! -e /tmp/list-versions_sources.sid ]
+then
+ for ARCHIVE_AREA in main contrib non-free
+ do
+ wget "http://debian.ethz.ch/debian/dists/sid/${ARCHIVE_AREA}/source/Sources.xz" -O - | xz -c -d >> /tmp/list-versions_sources.sid
+ done
+fi
+
+List ()
+{
+ PACKAGE="${@}"
+
+ BUSTER="$(sed -n "/^Package: ${PACKAGE}$/,/^Version:/p" /tmp/list-versions_sources.buster | awk '/^Version: / { print $2 }' | tail -n1)"
+ SID="$(sed -n "/^Package: ${PACKAGE}$/,/^Version:/p" /tmp/list-versions_sources.sid | awk '/^Version: / { print $2 }' | tail -n1)"
+
+ VERSIONS="$(wget -q http://snapshot.debian.org/package/${PACKAGE}/ -O - | grep '<li><a href=' | awk -F\> '{ print $3 }' | sed -e 's|<.*$||' | grep -v 'bpo' | grep -v 'deb[0-9]u')"
+ VERSIONS="$(echo ${VERSIONS} | sed -e "s|.*\(${SID}\)|\1|" -e "s|\(${BUSTER}\).*|\1|")"
+
+ clear
+ echo "Package: ${PACKAGE}"
+ echo
+ echo ${VERSIONS} | sed -e 's| |\n|g' | sort -V
+ echo
+ echo "# releases: $(echo ${VERSIONS} | sed -e 's| |\n|g' | wc -l)"
+ echo
+ echo "stable: ${BUSTER}"
+ echo "sid: ${SID}"
+ echo
+ echo
+}
+
+if [ -n "${1}" ]
+then
+ for DEB in ${@}
+ do
+ List ${DEB}
+ done
+else
+ while true
+ do
+ echo -n "Package: "
+ read DEB
+ echo
+
+ List ${DEB}
+
+ read input
+ done
+fi