Add leap-madison.sh
authorVarac <varac@leap.se>
Tue, 20 Jun 2017 18:19:35 +0000 (20:19 +0200)
committerVarac <varac@leap.se>
Tue, 20 Jun 2017 18:19:35 +0000 (20:19 +0200)
debian/leap-madison.sh [new file with mode: 0755]

diff --git a/debian/leap-madison.sh b/debian/leap-madison.sh
new file mode 100755 (executable)
index 0000000..98bf0d8
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/sh
+
+
+usage() {
+  echo "$0 <packagename>"
+  echo "See which version of a LEAP package is included in which debian repo"
+  exit 1
+}
+
+get_version() {
+  repo="$1"
+  dist="$2"
+  component="$3"
+
+  entry=$(curl -s "http://deb.leap.se/${repo}/dists/${dist}/${component}/binary-amd64/Packages" | grep -A 3 "^Package: ${name}")
+  version=$(echo "${entry}" | grep '^Version' | cut -d':' -f 2 )
+  echo "Repo ${repo}, dist ${dist}, component ${component}: ${version}"
+}
+
+name=$1
+
+[ -z "$name" ] && usage
+
+# Platform
+for dist in jessie stretch
+do
+  for component in master snapshots staging 0.10
+  do
+    get_version platform ${dist} ${component}
+  done
+  echo
+done
+echo
+
+# Client
+for dist in jessie stretch
+do
+  for component in master snapshots staging
+  do
+    get_version client ${dist} ${component}
+  done
+  echo
+done
+echo