[Swift-commit] r7256 - provenancedb/tags
wilde at ci.uchicago.edu
wilde at ci.uchicago.edu
Wed Oct 30 19:12:21 CDT 2013
Author: wilde
Date: 2013-10-30 19:12:21 -0500 (Wed, 30 Oct 2013)
New Revision: 7256
Modified:
provenancedb/tags/locate.server
provenancedb/tags/tag.server
Log:
Initial changes for intrinsic attributes - server side.
Modified: provenancedb/tags/locate.server
===================================================================
--- provenancedb/tags/locate.server 2013-10-31 00:08:08 UTC (rev 7255)
+++ provenancedb/tags/locate.server 2013-10-31 00:12:21 UTC (rev 7256)
@@ -1,13 +1,13 @@
#! /bin/sh
+unset LANG
+
database=${TAGDB:-provdb}
format=default
-echo
-
echo $(date): STARTING >./locate.log
-echo $(date): "$*" >./locate.log
+echo $(date): "$*" >>./locate.log
while [ $# -gt 0 ]; do
case $1 in
@@ -48,18 +48,17 @@
select dataset_id from annot_dataset_text where (name='type' and value='pdb')
);"
-# echo -e "$QUERY\n"
-
tout=$(mktemp /tmp/tags.out.XXXXXX)
thdr=$(mktemp /tmp/tags.hdr.XXXXXX)
tbody=$(mktemp /tmp/tags.body.XXXXXX)
$SQLCMD -c "$QUERY" >$tout
head -2 $tout >$thdr
-tail -n +3 $tout | grep -v '(.*rows)' | grep -v '^$' | sort >$tbody
+tail -n +3 $tout | grep -v '(.*rows)' | grep -v '^$' | /bin/sort >$tbody
if [ $format = default ]; then
+echo
cat $thdr $tbody | awk '
BEGIN {
start=0
Modified: provenancedb/tags/tag.server
===================================================================
--- provenancedb/tags/tag.server 2013-10-31 00:08:08 UTC (rev 7255)
+++ provenancedb/tags/tag.server 2013-10-31 00:12:21 UTC (rev 7256)
@@ -1,7 +1,9 @@
#! /bin/sh
-#TAGDB=${TAGDB:-provdb}
+echo $(date): $* >./tag.log
+database=${TAGDB:-provdb}
+
usage()
{
echo $0: usage:
@@ -11,14 +13,13 @@
END
}
-echo $(date): $* >./locate.log
-
multiple=false
while [ $# -gt 0 ]; do
case $1 in
-u|--user) user=$2; shift 2 ;;
-p|--password) password=$2; shift 2 ;;
+ -d|--database) database=$2; shift 2 ;;
-m|--multiple) multiple=true; shift 1 ;;
-h|-?|--help|-*|--*) usage; exit ;;
*) break ;;
@@ -29,7 +30,7 @@
dbpass=$(grep -w "^$user " users | awk '{print $2}')
-echo user=$user password=$password dbpass=$dbpass >>./locate.log
+echo user=$user password=$password dbpass=$dbpass >>./tag.log
if [ _$dbpass != _$password ]; then
echo ERROR: authentication failed.
@@ -39,11 +40,11 @@
object=$1
shift
-SQLCMD="psql -U provdb -h swift.rcc.uchicago.edu $TAGDB"
+SQLCMD="psql -U provdb -h swift.rcc.uchicago.edu $database"
$SQLCMD -c "insert into ds (id) values ('$object');"
-for anno in "$@"; do
+for anno in _owner=$user _group=TestGroup _created_on="$(date)" _modified_on="$(date)" _permissions=777 "$@"; do
name=$(echo "$anno" | awk -F= '{print $1}')
value=$(echo "$anno" | awk -F= '{print $2}')
echo anno=$anno name=$name value="$value"
More information about the Swift-commit
mailing list