Autocommit of all changes since last autosync startup on host ares
authorJulien Valroff <julien@kirya.net>
Fri, 30 Dec 2011 14:10:06 +0000 (15:10 +0100)
committerJulien Valroff <julien@kirya.net>
Fri, 30 Dec 2011 14:10:06 +0000 (15:10 +0100)
count_debian_packages.sh [deleted file]
count_source_packages [new file with mode: 0755]
count_ubuntu_packages.sh [deleted file]

diff --git a/count_debian_packages.sh b/count_debian_packages.sh
deleted file mode 100755 (executable)
index 4e6778b..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh
-# Count the number of source packages available in Debian & Ubuntu
-
-if [ $# -lt 2 ]; then
-  echo "Usage: count_source_packages <distribution> <suite>"
-  echo "where <distribution> can be either debian or ubuntu"
-  exit 1
-fi
-
-case $1 in
-    ubuntu)
-        URL="ftp://ftp.ubuntu.com/ubuntu"
-        DISTS="main multiverse restricted universe"
-        ;;
-    debian)
-        URL="ftp://ftp.debian.org/debian"
-        DISTS="main contrib non-free"
-        ;;
-    *)
-        echo "<distribution> can be either debian or ubuntu"
-        exit 1
-        ;;
-esac
-
-for arg in $*
-do
-
-  echo "Number of source packages in $arg: "
-  for dist in ${DISTS}; do
-    echo -n "  $dist: "
-    wget -q -O - ${URL}/dists/$arg/$dist/source/Sources.gz | zgrep -c '^Package: '
-  done
-
-done
diff --git a/count_source_packages b/count_source_packages
new file mode 100755 (executable)
index 0000000..bd96ad3
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+# Count the number of source packages available in Debian & Ubuntu
+
+if [ $# -lt 2 ]; then
+  echo "Usage: count_source_packages <distribution> <suite>"
+  echo "where <distribution> can be either debian or ubuntu"
+  echo "<section> argument can be specified more than once"
+  exit 1
+fi
+
+DIST=$1
+shift
+
+case ${DIST} in
+    ubuntu)
+        URL="ftp://ftp.ubuntu.com/ubuntu"
+        SECTIONS="main multiverse restricted universe"
+        ;;
+    debian)
+        URL="ftp://ftp.debian.org/debian"
+        SECTIONS="main contrib non-free"
+        ;;
+    *)
+        echo "<distribution> can be either debian or ubuntu"
+        exit 1
+        ;;
+esac
+
+for arg in "$@"
+do
+  echo "Number of source packages in ${DIST} $arg: "
+  for section in ${SECTIONS}; do
+    echo -n "  $section: "
+    wget -q -O - ${URL}/dists/$arg/$section/source/Sources.gz | zgrep -c '^Package: '
+  done
+
+done
diff --git a/count_ubuntu_packages.sh b/count_ubuntu_packages.sh
deleted file mode 100755 (executable)
index 2c3ac63..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sh
-if [ $# -lt 1 ]; then
-  echo "Please add at least one distribution as argument"
-  echo "Exiting"
-  exit 1
-fi
-for arg in $*
-do
-  echo -n "Number of source packages in $arg: "
-  wget -q -O - ftp://ftp.ubuntu.com/ubuntu/dists/$arg/main/source/Sources.gz | zgrep -c '^Package: '
-done