[Blends-commit] [SCM] website branch, master, updated. 58e19c34dc2432286c94d0dfa2b0e92e09966a66

Andreas Tille tille at debian.org
Fri Feb 5 21:53:25 UTC 2016


The following commit has been merged in the master branch:
commit 58e19c34dc2432286c94d0dfa2b0e92e09966a66
Author: Andreas Tille <tille at debian.org>
Date:   Fri Feb 5 22:53:16 2016 +0100

    Add some command line option and a very basic help screen

diff --git a/misc/sql/edam.sh b/misc/sql/edam.sh
index 0e0f3db..2f6b2ef 100755
--- a/misc/sql/edam.sh
+++ b/misc/sql/edam.sh
@@ -5,6 +5,18 @@
 #        * "main license" (Files: *)
 #        * Upstream-Contact
 
+usage() {
+cat >/dev/stderr <<EOT
+Usage: $0 [option]
+      -h print this help screen
+      -j JSON export
+      -m forcing public mirror over local one
+
+Description:
+ Query local or public UDD for information that could be useful for EDAM.
+EOT
+}
+
 PORT="-p 5452"
 
 SERVICE="service=udd"
@@ -22,12 +34,30 @@ if ! psql $PORT $SERVICE -c "" 2>/dev/null ; then
 fi
 
 EXT=txt
-if [ "$1" = "-j" ] ; then
-  JSONBEGIN="SELECT array_to_json(array_agg(t)) FROM ("
-  JSONEND=") t"
-  EXT=json
-  OUTPUTFORMAT=--tuples-only
-fi
+while getopts "hjm" o; do
+    case "${o}" in
+        h)
+            usage
+            exit 0
+            ;;
+        j)
+           JSONBEGIN="SELECT array_to_json(array_agg(t)) FROM ("
+           JSONEND=") t"
+           EXT=json
+           OUTPUTFORMAT=--tuples-only
+           ;;
+        m)
+           PORT="--port=5432"
+           export PGPASSWORD="public-udd-mirror"
+           SERVICE="--host=public-udd-mirror.xvm.mit.edu --username=public-udd-mirror udd"
+           ;;
+        *)
+            usage
+            exit 1
+            ;;
+    esac
+done
+shift $((OPTIND-1))
 
 team="'debian-med-packaging at lists.alioth.debian.org'"
 
@@ -71,7 +101,7 @@ $JSONBEGIN
       -- select packages which have versions outside experimental
       SELECT px.package, strip_binary_upload(px.version) AS version,
              (SELECT release FROM ( SELECT release, sort FROM releases
-                                     UNION 
+                                     UNION
                                     SELECT 'vcs' AS release, 10000 AS sort
                                   ) reltmp WHERE sort = MAX(rx.sort)) AS release
         FROM (

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list