[Bond-users] PAPYRUS GIT IS BROKEN

Jasen Betts jasen at treshna.com
Sun Dec 11 16:30:58 EST 2011


On Sun, Dec 11, 2011 at 07:22:32PM +0000, Colin Close wrote:
> Hi All,
> This is just a heads up to say that the current git version is broken and will 
> not generate reports (at least not for me). 
> I have my database on a separate machine to the bobd system it is thus 
> interrogated over a local network (no dns just ip addresses).
> The file that is broken is the papyrus script  it is broken by this seemingly 
> innocuous commit.
> dde9c788ec0a1743960c2c69537d1243aa8de2de

I am guessing you aren't using --database-connection-string
and papyrus_backend is choking on the empty string that was getting
substituted in the arguments.

try this patch:

--- a/papyrus
+++ b/papyrus
@@ -292,6 +292,7 @@ while [ "$#" -gt "0" ] ; do
     shift
 done
 
+
 if [ -z "$input" ] ; then
 usage
 exit 1
@@ -337,21 +338,32 @@ fi
 trap "${dryrun} rm -rf $workdir $cleanup " 0 1 2 15
 run mkdir "$workdir"
 
+
+
+# build an argument list avoiding empty arguments from empty source lists.
+
+[ "$remote" ] && backend="papyrus_backend"
+backend=( $backend $validate $dbname $dbtype )
+(( ${#dbconn} )) && backend=( "${backend[@]}" "${dbconn[@]}" )
+backend=( "${backend[@]}"  $dbschema $dbprovider )
+(( ${#args} )) && backend=( "${backend[@]}" "${args[@]}" )
+
 if ! [ "$remote" ]
 then
-say -n "Running backend $input..."
+say -n "Running backend on $input..."
 (
 IFS=\\
 echo
-exdirect "$workdir/output.xml" $backend $validate $dbname $dbtype "${dbconn[@]}" $dbschema $dbprovider "${args[@]}" "$input" 
+exdirect "$workdir/output.xml" "${backend[@]}" "$input" 
 )
 
 else
  say -n "Running remote backend "
+ # may need work here to over-quote the arguments for ssh 
  if ! [ "$dryrun" ]
- then ssh $remote papyrus_backend $validate $dbname $dbtype "${dbconn[@]}" $dbschema $dbprovider  "${args[@]}" -  < "$input" > "$workdir/output.xml"
+ then ssh $remote "${backend[@]}" -  < "$input" > "$workdir/output.xml"
  fail $? "remote papyrus backend failed!"
- else echo ssh $remote papyrus_backend $validate $dbname $dbtype "${dbconn[@]}" $dbschema $dbprovider "${args[@]}" - \< \"$input\" \> \"$workdir/output.xml\"
+ else echo ssh $remote "${backend[@]}" - \< \"$input\" \> \"$workdir/output.xml\"
  fi 
 fi


-- 
Jasen Betts
treshna Enterprises Ltd
Tel: +64 3 974 9169 or 0800 894 149  
(for Jasen dial ext 204 when the voice starts)
Fax: +64 28 894 860
Web: www.treshna.com
267 Madras Street, Christchurch, New Zealand
IT Consultancy - Websites - Database development - Computer tech support




More information about the Bond-users mailing list