You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2013/01/12 15:58:59 UTC

svn commit: r1432441 - in /tcl/rivet/branches/2.1: ./ doc/ doc/xml/ rivet/ rivet/packages/dio/ rivet/packages/session/ rivet/rivet-tcl/ src/apache-2/ src/librivet/

Author: mxmanghi
Date: Sat Jan 12 14:58:58 2013
New Revision: 1432441

URL: http://svn.apache.org/viewvc?rev=1432441&view=rev
Log:
    * rivet/rivet-tcl/xml.tcl: revised command for simple XML string mark up
    * src/librivet/rivetPkgInit.c: package version taken from preprocessor symbol
    RIVET_VERSION so that it's guaranteed mod_rivet.c will get the right library
    version.
    * src/apache-2/mod_rivet.c: removed trailing spaces from various lines (offends
    some patch management tools such as quilt)
    * doc/xml/install.xml: fixed link to download page on the website
    * rivet/packages/dio/dio.tcl: method store uses internally methods 'insert' or
    'update' (depending on the existence of a row having the same keyfield). The
    latest version of DIO shipped a 'store' method that returns the very same value
    returned either by 'insert' or 'update'. Previous versions of DIO returned
    invariably 1, which was undocumented and not very well thought out (handled 
    errors in 'store' return a -code error, not necessarily 0). Previous behavior
    is reinstated (bug #54313)
    * rivet/packages/session/session-class.tcl: method 'store' had an hardcoded 
    'parray' the ran  when an error occurred. It also printed a message using 
    'puts' instead of 'debug' 
    * src/apache-2/rivetCore.c: command 'headers' returns a meaningful error in case
    a subcommand is invalid
    * src/apache-2/mod_rivet.c: Tcl_PkgRequire for packages Rivet and rivetlib
    are exchanged so that commands in librivet.so can be imported when 
    they are on the export list and a programmer issues a 'package require 
    ::rivet' (fixes bug #54290)
    * rivet/init.tcl: this script is now providing package 'Rivet' instead of
    'RivetTcl'. init.tcl initializes the Tcl core of Rivet and a package rivet
    has to exists for compatibility with version 2.0 where it was provided 
    rather pointelessly by librivet.so.


Modified:
    tcl/rivet/branches/2.1/   (props changed)
    tcl/rivet/branches/2.1/ChangeLog
    tcl/rivet/branches/2.1/VERSION
    tcl/rivet/branches/2.1/configure.ac
    tcl/rivet/branches/2.1/doc/   (props changed)
    tcl/rivet/branches/2.1/doc/xml/install.xml
    tcl/rivet/branches/2.1/rivet/init.tcl
    tcl/rivet/branches/2.1/rivet/packages/dio/dio.tcl
    tcl/rivet/branches/2.1/rivet/packages/session/session-class.tcl
    tcl/rivet/branches/2.1/rivet/rivet-tcl/xml.tcl
    tcl/rivet/branches/2.1/src/apache-2/mod_rivet.c
    tcl/rivet/branches/2.1/src/apache-2/rivetCore.c
    tcl/rivet/branches/2.1/src/librivet/rivetPkgInit.c

Propchange: tcl/rivet/branches/2.1/
------------------------------------------------------------------------------
  Merged /tcl/rivet/trunk:r1416704-1428560

Modified: tcl/rivet/branches/2.1/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/ChangeLog?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/ChangeLog (original)
+++ tcl/rivet/branches/2.1/ChangeLog Sat Jan 12 14:58:58 2013
@@ -1,3 +1,42 @@
+2012-12-30 Massimo Manghi <mx...@apache.org>
+    * rivet/rivet-tcl/xml.tcl: revised command for simple XML string mark up
+
+2012-12-18 Massimo Manghi <mx...@apache.org>
+    * src/librivet/rivetPkgInit.c: package version taken from preprocessor symbol
+    RIVET_VERSION so that it's guaranteed mod_rivet.c will get the right library
+    version.
+    * src/apache-2/mod_rivet.c: removed trailing spaces from various lines (offends
+    some patch management tools such as quilt)
+
+2012-12-17 Massimo Manghi <mx...@apache.org>
+    * doc/xml/install.xml: fixed link to download page on the website
+    * rivet/packages/dio/dio.tcl: method store uses internally methods 'insert' or
+    'update' (depending on the existence of a row having the same keyfield). The
+    latest version of DIO shipped a 'store' method that returns the very same value
+    returned either by 'insert' or 'update'. Previous versions of DIO returned
+    invariably 1, which was undocumented and not very well thought out (handled 
+    errors in 'store' return a -code error, not necessarily 0). Previous behavior
+    is reinstated (bug #54313)
+
+2012-12-16 Massimo Manghi <mx...@apache.org>
+    * rivet/packages/session/session-class.tcl: method 'store' had an hardcoded 
+    'parray' the ran  when an error occurred. It also printed a message using 
+    'puts' instead of 'debug' 
+
+2012-12-15 Massimo Manghi <mx...@apache.org>
+    * src/apache-2/rivetCore.c: command 'headers' returns a meaningful error in case
+    a subcommand is invalid
+
+2012-12-12 Massimo Manghi <mx...@apache.org>
+    * src/apache-2/mod_rivet.c: Tcl_PkgRequire for packages Rivet and rivetlib
+    are exchanged so that commands in librivet.so can be imported when 
+    they are on the export list and a programmer issues a 'package require 
+    ::rivet' (fixes bug #54290)
+    * rivet/init.tcl: this script is now providing package 'Rivet' instead of
+    'RivetTcl'. init.tcl initializes the Tcl core of Rivet and a package rivet
+    has to exists for compatibility with version 2.0 where it was provided 
+    rather pointelessly by librivet.so.
+
 2012-12-03 Massimo Manghi <mx...@apache.org>
     * doc/Makefile.am: Manual pages output encoding set to UTF-8
 

Modified: tcl/rivet/branches/2.1/VERSION
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/VERSION?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/VERSION (original)
+++ tcl/rivet/branches/2.1/VERSION Sat Jan 12 14:58:58 2013
@@ -1,2 +1 @@
-2.1.0
-
+2.1.1rc0

Modified: tcl/rivet/branches/2.1/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/configure.ac?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/configure.ac (original)
+++ tcl/rivet/branches/2.1/configure.ac Sat Jan 12 14:58:58 2013
@@ -22,7 +22,7 @@ dnl
 # so you can encode the package version directly into the source files.
 #-----------------------------------------------------------------------
 
-AC_INIT([Rivet],[2.1.0])
+AC_INIT([Rivet],[2.1.1])
 TEA_INIT([3.9])
 
 AC_CONFIG_AUX_DIR(tclconfig)

Propchange: tcl/rivet/branches/2.1/doc/
------------------------------------------------------------------------------
  Merged /tcl/rivet/trunk/doc:r1416704-1428560

Modified: tcl/rivet/branches/2.1/doc/xml/install.xml
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/doc/xml/install.xml?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/doc/xml/install.xml (original)
+++ tcl/rivet/branches/2.1/doc/xml/install.xml Sat Jan 12 14:58:58 2013
@@ -40,7 +40,7 @@
          <step>
             <title>Get Rivet</title>
             <para>
-                Download the sources at <ulink url="http://tcl.apache.org/rivet/download.html"/>.  
+                Download the sources at <ulink url="http://tcl.apache.org/rivet/static/download.html"/>.  
             </para>
          </step>
          <step performance="optional">

Modified: tcl/rivet/branches/2.1/rivet/init.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/rivet/init.tcl?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/rivet/init.tcl (original)
+++ tcl/rivet/branches/2.1/rivet/init.tcl Sat Jan 12 14:58:58 2013
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-package provide RivetTcl 2.1
+package provide Rivet 2.1
 
 namespace eval ::Rivet {
 
@@ -117,11 +117,11 @@ namespace eval ::Rivet {
         set tclpath [file join [file dirname [info script]] rivet-tcl]
         set auto_path [linsert $auto_path 0 $tclpath]
 
-        ## As we moved the commands ensemble to ::rivet namespace we
+        ## As we moved the commands set to ::rivet namespace we
         ## we want to guarantee the commands are still accessible
         ## at global level by putting them on the export list.
         ## Importing the ::rivet namespace is deprecated and we should
-        ## make it clear that this will be removed in the future
+        ## make it clear in the manual
 
         ## we keep in ::rivet::export_list a list of importable commands
 
@@ -190,7 +190,7 @@ interp alias {} ::incr0 {} incr
 # This option is not guaranteed to be supported in future versions.
 
 if {[info exists module_conf(import_rivet_commands)] && $module_conf(import_rivet_commands)} {
-    namespace import -force ::rivet::*
+    namespace eval :: { namespace import -force ::rivet::* }
 }
 
 array unset module_conf

Modified: tcl/rivet/branches/2.1/rivet/packages/dio/dio.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/rivet/packages/dio/dio.tcl?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/rivet/packages/dio/dio.tcl (original)
+++ tcl/rivet/branches/2.1/rivet/packages/dio/dio.tcl Sat Jan 12 14:58:58 2013
@@ -448,11 +448,11 @@ proc handle {interface args} {
 	$res destroy
 
 	if {$numrows} {
-            return [eval $this update $arrayName $args]
+            $this update $arrayName $args
 	} else {
-            return [eval $this insert $myTable $arrayName] 
+            $this insert $myTable $arrayName
 	}
-
+        return 1
     }
 
     #

Modified: tcl/rivet/branches/2.1/rivet/packages/session/session-class.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/rivet/packages/session/session-class.tcl?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/rivet/packages/session/session-class.tcl (original)
+++ tcl/rivet/branches/2.1/rivet/packages/session/session-class.tcl Sat Jan 12 14:58:58 2013
@@ -316,8 +316,8 @@ package require Itcl
 	set kf [list session_id package_ key_]
 
 	if {![$dioObject store a -table $sessionCacheTable -keyfield $kf]} {
-	    puts "Failed to store $sessionCacheTable '$kf'"
-	    parray a
+	    debug "Failed to store $sessionCacheTable '$kf'"
+	    #parray a
 	    error [$dioObject errorinfo]
 	}
     }

Modified: tcl/rivet/branches/2.1/rivet/rivet-tcl/xml.tcl
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/rivet/rivet-tcl/xml.tcl?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/rivet/rivet-tcl/xml.tcl (original)
+++ tcl/rivet/branches/2.1/rivet/rivet-tcl/xml.tcl Sat Jan 12 14:58:58 2013
@@ -3,20 +3,18 @@
 #
 # Example 1:
 #
-#  ::rivet::xml Test b i -> <b><i>Test</i></b>
+#  ::rivet::xml Test b i 
+# <== <b><i>Test</i></b>
 #  
 # Example 2:
 #
 # ::rivet::xml Test [list div class box id testbox] b i
-#
-#    -> <div class="box" id="testbox"><b><i>Test</i></b></div>
+# <== <div class="box" id="testbox"><b><i>Test</i></b></div>
 #
 # Example 3
 #
-# set d [list div [list a 1 b 2] b [list c 3 d 4] i [list e 5 f 6]]
-# ::rivet::xml Test {*}$d
-#
-#   -> <div a="1" b="2"><b c="3" d="4"><b c="3" d="4"><i e="5" f="6">Test</i></b></div>
+# ::rivet::xml "anything ..." div [list a href "http://..../" alt "alternate message"] 
+# <== <div><a href="http://..../" alt="alternate message">anything ...</a></div>
 #
 # $Id: $
 #
@@ -25,27 +23,27 @@ namespace eval ::rivet {
 
     proc xml {textstring args} {
 
-        set xmlout ""
-        set tags_stack   {}
+        set xmlout      ""
+        set tags_stack  {}
 
         foreach el $args {
 
-            set tag  [lindex $el 0]
-            set tags_stack [linsert $tags_stack 0 $tag]
+            set el  [lassign $el tag]
+            lappend tags_stack $tag
             append xmlout "<$tag"
 
-            if {[llength $el] > 1} {
-
-                foreach {attrib attrib_v} [lrange $el 1 end] {
-                    append xmlout " $attrib=\"$attrib_v\""
-                }
-
-            } 
+            foreach {attrib attrib_v} $el {
+                append xmlout " $attrib=\"$attrib_v\""
+            }
 
             append xmlout ">"
         }
 
-        append xmlout "$textstring</[join $tags_stack ></]>"
-
+        if {[::rivet::lempty $tags_stack]} {
+            return $textstring
+        } else {
+            return [append xmlout "$textstring</[join [lreverse $tags_stack] "></"]>"]
+        }
     }
+
 }

Modified: tcl/rivet/branches/2.1/src/apache-2/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/src/apache-2/mod_rivet.c?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/src/apache-2/mod_rivet.c (original)
+++ tcl/rivet/branches/2.1/src/apache-2/mod_rivet.c Sat Jan 12 14:58:58 2013
@@ -924,7 +924,7 @@ Rivet_PerInterpInit(server_rec *s, rivet
     /* Eval Rivet's init.tcl file to load in the Tcl-level commands. */
 
     /* We put in front the auto_path list the path to the directory where
-     * init.tcl is located (provides package RivetTcl)
+     * init.tcl is located (provides package Rivet, previously RivetTcl)
      */
 
     auto_path = Tcl_GetVar2Ex(interp,"auto_path",NULL,TCL_GLOBAL_ONLY);
@@ -947,21 +947,35 @@ Rivet_PerInterpInit(server_rec *s, rivet
     Rivet_InitServerVariables(interp, p );
 //  Rivet_PropagateServerConfArray( interp, rsc );
 
-    /* Eval Rivet's init.tcl file to load in the Tcl-level commands. */
 
-    /* Watch out! Calling Tcl_PkgRequire with a version number binds this module to
-     * the 'package provide' statement in rivet/init.tcl 
+    /* Loading into the interpreter the commands provided by librivet.so */
+    /* Tcl Bug #3216070 has been solved with 8.5.10 and commands shipped with
+     * Rivetlib can be mapped at this stage
      */
 
-    /*  If rivet was configured to export the ::rivet namespace commands we have to
-     *  set the array variable ::rivet::module_conf(export_namespace_commands) before calling init.tcl
+    if (Tcl_PkgRequire(interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION, 1) == NULL)
+    {
+        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
+                     MODNAME ": Error loading rivetlib package: %s",
+		     Tcl_GetStringResult(interp) );
+        exit(1);
+    }
+
+    /*  If rivet is configured to export the ::rivet namespace commands we set the
+     *  array variable ::rivet::module_conf(export_namespace_commands) before calling init.tcl
      *  This array will be unset after commands are exported.
      */
 
     Tcl_SetVar2Ex(interp,"module_conf","export_namespace_commands",Tcl_NewIntObj(RIVET_NAMESPACE_EXPORT),0);
     Tcl_SetVar2Ex(interp,"module_conf","import_rivet_commands",Tcl_NewIntObj(RIVET_NAMESPACE_IMPORT),0);
 
-    if (Tcl_PkgRequire(interp, "RivetTcl", "2.1", 1) == NULL)
+    /* Eval Rivet's init.tcl file to load in the Tcl-level commands. */
+
+    /* Watch out! Calling Tcl_PkgRequire with a version number binds this module to
+     * the Rivet package revision number in rivet/init.tcl
+     */
+
+    if (Tcl_PkgRequire(interp, "Rivet", "2.1", 1) == NULL)
     {
         ap_log_error (APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
                       MODNAME ": init.tcl must be installed correctly for Apache Rivet to function: %s (%s)",
@@ -969,19 +983,6 @@ Rivet_PerInterpInit(server_rec *s, rivet
         exit(1);
     }
 
-    /* Loading into the interpreter the commands provided by librivet.so */
-
-    /* Tcl Bug #3216070 has been solved with 8.5.10 and commands shipped with
-     * Rivetlib can be mapped at this stage
-     */
-
-    if (Tcl_PkgRequire(interp, RIVETLIB_TCL_PACKAGE, "1.2", 1) == NULL)
-    {
-        ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
-                     MODNAME ": Error loading rivetlib package: %s",
-		     Tcl_GetStringResult(interp) );
-        exit(1);
-    } 
     /* */
 
     /* Set the output buffer size to the largest allowed value, so that we 
@@ -1549,9 +1550,13 @@ Rivet_ChildHandlers(server_rec *s, int i
 static apr_status_t
 Rivet_ChildExit(void *data)
 {
-    server_rec *s = (server_rec*) data;
+    char        *errmsg = MODNAME ": Running ChildExit handler";
+    server_rec  *s = (server_rec*) data;
+
     Rivet_ChildHandlers(s, 0);
     Tcl_Finalize();
+
+    ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, s, errmsg );
     return OK;
 }
 
@@ -1561,8 +1566,10 @@ Rivet_ChildExit(void *data)
  *
  * Arguments:
  *  server_rec* s: pointer to a server_rec structure
+ *
  * Results:
  *  pointer to a Tcl_Interp structure
+ *
  * Side Effects:
  *
  *-----------------------------------------------------------------------------

Modified: tcl/rivet/branches/2.1/src/apache-2/rivetCore.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/src/apache-2/rivetCore.c?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/src/apache-2/rivetCore.c (original)
+++ tcl/rivet/branches/2.1/src/apache-2/rivetCore.c Sat Jan 12 14:58:58 2013
@@ -351,7 +351,8 @@ TCL_CMD_HEADER( Rivet_Headers )
             return TCL_ERROR;
         }
         TclWeb_SetHeaderType(Tcl_GetString(objv[2]), globals->req);
-    } else if (!strcmp("numeric", opt)) /* ### numeric ### */
+    }
+    else if (!strcmp("numeric", opt)) /* ### numeric ### */
     {
         int st = 200;
 
@@ -365,7 +366,15 @@ TCL_CMD_HEADER( Rivet_Headers )
         } else {
             return TCL_ERROR;
         }
+
     } else {
+
+        Tcl_Obj* result = Tcl_NewStringObj("unrecognized subcommand: ",-1);
+        Tcl_IncrRefCount(result);
+        Tcl_AppendStringsToObj(result,opt,NULL);
+
+        Tcl_SetObjResult(interp, result);
+        Tcl_DecrRefCount(result);
         return TCL_ERROR;
     }
     return TCL_OK;

Modified: tcl/rivet/branches/2.1/src/librivet/rivetPkgInit.c
URL: http://svn.apache.org/viewvc/tcl/rivet/branches/2.1/src/librivet/rivetPkgInit.c?rev=1432441&r1=1432440&r2=1432441&view=diff
==============================================================================
--- tcl/rivet/branches/2.1/src/librivet/rivetPkgInit.c (original)
+++ tcl/rivet/branches/2.1/src/librivet/rivetPkgInit.c Sat Jan 12 14:58:58 2013
@@ -110,7 +110,7 @@ Rivetlib_Init( Tcl_Interp *interp )
     Tcl_Export(interp,rivet_ns,"*",0);
 #endif
 
-    return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, "1.2" );
+    return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION );
 }
 
 /*-----------------------------------------------------------------------------
@@ -148,5 +148,5 @@ Rivetlib_SafeInit( Tcl_Interp *interp )
     rivet_ns = Rivet_GetNamespace(interp);
     Tcl_Export(interp,rivet_ns,"*",0);
 #endif
-    return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, "1.2" );
+    return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION );
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org