]> git.donarmstrong.com Git - cran2deb.git/blobdiff - branch/split_build/exec/showbuilds
rename double_build -> split_build
[cran2deb.git] / branch / split_build / exec / showbuilds
diff --git a/branch/split_build/exec/showbuilds b/branch/split_build/exec/showbuilds
new file mode 100755 (executable)
index 0000000..c35e558
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/sh
+## DOC: cran2deb showbuilds [date]
+## DOC:     list build summary for given date
+## DOC:     default value for date is current day
+## DOC:
+db=/var/cache/cran2deb/cran2deb.db
+date=`date "+%Y-%m-%d"`
+
+usage_and_exit()
+{
+    cat <<EOF
+Usage: showbuilds [-d date] [-?|-h]"
+  Show build for given dates
+Options:
+  -d date       use given date, else default to current date
+  -h            show this help
+EOF
+    exit 0
+}
+
+options=':d:h?'
+while getopts "$options" i
+do
+    case "$i" in
+        d)
+            date=$OPTARG
+            ;;
+        h|?)
+            usage_and_exit
+            ;;
+    esac
+done
+
+cmd="select id,success,system,package,r_version,deb_epoch,deb_revision,scm_revision,db_version,date_stamp,time_stamp from builds where date_stamp = '${date}'"
+
+sqlite3 -header -column $db "$cmd"
+