Add show-versions-in-repo.sh
authorVarac <varac@leap.se>
Mon, 26 Jun 2017 12:31:26 +0000 (14:31 +0200)
committerVarac <varac@leap.se>
Mon, 26 Jun 2017 12:31:36 +0000 (14:31 +0200)
debian/show-versions-in-repo.sh [new file with mode: 0755]

diff --git a/debian/show-versions-in-repo.sh b/debian/show-versions-in-repo.sh
new file mode 100755 (executable)
index 0000000..c33444d
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+
+usage() {
+  echo "$0 <repo> <dist> <component>"
+  echo
+  echo "Show which package versions are included in which debian repo"
+  echo "Example: $0 platform jessie snapshots"
+  exit 1
+}
+
+repo="$1"
+dist="$2"
+component="$3"
+
+[ -z "$repo" ] && usage
+[ -z "$dist" ] && usage
+[ -z "$component" ] && usage
+
+curl -s "http://deb.leap.se/${repo}/dists/${dist}/${component}/binary-amd64/Packages" | grep -A2 '^Package' | egrep -v '^(Architecture|Source)' | tr '\n' ' ' | sed 's/--/\n/g' | sed 's/^ *//'