tcl-mod_dtcl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject cvs commit: tcl-moddtcl/debian postinst postrm
Date Mon, 15 Oct 2001 10:44:10 GMT
davidw      01/10/15 03:44:09

  Modified:    .        mod_dtcl.c mod_dtcl.h tcl_commands.c
               debian   postinst postrm
  Log:
  Fixed bug with Parse.
  
  Applied patch for Debian SSL stuff from János Holányi.
  
  Revision  Changes    Path
  1.50      +28 -8     tcl-moddtcl/mod_dtcl.c
  
  Index: mod_dtcl.c
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- mod_dtcl.c	2001/09/30 18:48:33	1.49
  +++ mod_dtcl.c	2001/10/15 10:44:09	1.50
  @@ -57,7 +57,7 @@
    * originally written at the National Center for Supercomputing Applications,
    * University of Illinois, Urbana-Champaign.  */
   
  -/* $Id: mod_dtcl.c,v 1.49 2001/09/30 18:48:33 davidw Exp $  */
  +/* $Id: mod_dtcl.c,v 1.50 2001/10/15 10:44:09 davidw Exp $  */
   
   /* mod_dtcl.c by David Welton <davidw@apache.org> - originally mod_include.  */
   /* See http://tcl.apache.org/mod_dtcl/credits.ttml for additional credits. */
  @@ -346,7 +346,7 @@
   
   /* This is a seperate function so that it may be called from 'Parse' */
   
  -int get_parse_exec_file(request_rec *r, dtcl_server_conf *dsc, int toplevel)
  +int get_parse_exec_file(request_rec *r, dtcl_server_conf *dsc, char *filename, int toplevel)
   {
       char *hashKey = NULL;
       int isNew = 0;
  @@ -356,12 +356,32 @@
       Tcl_HashEntry *entry = NULL;
       Tcl_Interp *interp = dsc->server_interp;
   
  +    time_t ctime;
  +    time_t mtime;
  +
  +    /* If toplevel is 0, we are being called from Parse, which means
  +       we need to get the information about the file ourselves. */
  +    if (toplevel == 0) 
  +    {
  +	int ret = 0;
  +	struct stat stat;
  +	ret = Tcl_Stat(filename, &stat);
  +	if (ret < 0)
  +	    return TCL_ERROR;
  +	ctime = stat.st_ctime;
  +	mtime = stat.st_mtime;
  +    } else {
  +	ctime = r->finfo.st_ctime;
  +	mtime = r->finfo.st_mtime;
  +    }
  +
       /* Look for the script's compiled version. If it's not found,
          create it. */
  +
       if (*(dsc->cache_size))
       {
  -	hashKey = ap_psprintf(r->pool, "%s%lx%lx%d", r->filename,
  -			      r->finfo.st_mtime, r->finfo.st_ctime, toplevel);
  +	hashKey = ap_psprintf(r->pool, "%s%lx%lx%d", filename,
  +			      mtime, ctime, toplevel);
   	entry = Tcl_CreateHashEntry(dsc->objCache, hashKey, &isNew);
       }
       if (isNew || *(dsc->cache_size) == 0)
  @@ -369,13 +389,13 @@
   	outbuf = Tcl_NewObj();
   	Tcl_IncrRefCount(outbuf);
   
  -	if(!strcmp(r->content_type, "application/x-httpd-tcl"))
  +	if(!strcmp(r->content_type, "application/x-httpd-tcl") || toplevel == 0) 
   	{
   	    /* It's a TTML file  */
  -	    result = get_ttml_file(r, dsc, interp, r->filename, 1, outbuf);
  +	    result = get_ttml_file(r, dsc, interp, filename, toplevel, outbuf);
   	} else {
   	    /* It's a plain Tcl file */
  -	    result = get_tcl_file(r, interp, r->filename, outbuf);
  +	    result = get_tcl_file(r, interp, filename, outbuf);
   	}
   	if (result != TCL_OK)
   	    return result;
  @@ -566,7 +586,7 @@
       }
   #endif /* USE_ONLY_UPLOAD_COMMAND == 1 */
   
  -    get_parse_exec_file(r, dsc, 1);
  +    get_parse_exec_file(r, dsc, r->filename, 1);
       /* reset globals  */
       *(dsc->buffer_output) = 0;
       *(dsc->headers_printed) = 0;
  
  
  
  1.14      +1 -1      tcl-moddtcl/mod_dtcl.h
  
  Index: mod_dtcl.h
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/mod_dtcl.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mod_dtcl.h	2001/09/05 12:01:22	1.13
  +++ mod_dtcl.h	2001/10/15 10:44:09	1.14
  @@ -89,7 +89,7 @@
       ApacheRequest *req;         /* libapreq request  */
   } dtcl_interp_globals;
   
  -int get_parse_exec_file(request_rec *r, dtcl_server_conf *dsc, int toplevel);
  +int get_parse_exec_file(request_rec *r, dtcl_server_conf *dsc, char *filename, int toplevel);
   int set_header_type(request_rec *, char *);
   int print_headers(request_rec *);
   int print_error(request_rec *, int, char *);
  
  
  
  1.19      +1 -1      tcl-moddtcl/tcl_commands.c
  
  Index: tcl_commands.c
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/tcl_commands.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- tcl_commands.c	2001/09/30 18:48:33	1.18
  +++ tcl_commands.c	2001/10/15 10:44:09	1.19
  @@ -67,7 +67,7 @@
   	Tcl_AddErrorInfo(interp, Tcl_PosixError(interp));
   	return TCL_ERROR;
       }
  -    if (get_parse_exec_file(globals->r, dsc, 0) == OK)
  +    if (get_parse_exec_file(globals->r, dsc, filename, 0) == OK)
   	return TCL_OK;
       else
   	return TCL_ERROR;
  
  
  
  1.2       +37 -5     tcl-moddtcl/debian/postinst
  
  Index: postinst
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/debian/postinst,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- postinst	2000/09/08 10:26:53	1.1
  +++ postinst	2001/10/15 10:44:09	1.2
  @@ -1,9 +1,9 @@
   #!/bin/bash
   # postinst for libapache-mod-dtcl, based on:
  -# postinst for libapache-mod-perl, based on:
   # postinst.skeleton
   # Skeleton maintainer script showing all the possible cases.
   # Written by Charles Briscoe-Smith, March-April 1998.  Public Domain.
  +# Updated and added apache-ssl patch by János Holányi <csani@lme.linux.hu>, 2001
   
   # Abort if any command returns an error value
   set -e
  @@ -31,6 +31,22 @@
   	return 0
   }
   
  +enable_ssl () {
  +       [ -f /etc/apache-ssl/httpd.conf ] || exit 0
  +       if grep '^LoadModule.*mod_dtcl\.so' /etc/apache-ssl/httpd.conf 2>&1 >/dev/null
  +       then
  +               return 0
  +       fi
  +       echo -n "A new Apache module has been installed.  Reconfigure apache-ssl [Y/n]?
"
  +       read CONFIG
  +       if [ ".$CONFIG" == ".n" -o ".$CONFIG" == ".N" ]
  +       then
  +               return 0
  +       fi
  +        [ -x /usr/sbin/apache-sslconfig ] && /usr/sbin/apache-sslconfig --force-modules
  +       return 0
  +}
  +
   # Restart apache if user wants.
   ask_restart () {
   	echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
  @@ -41,6 +57,15 @@
   	fi
   }
   
  +ask_restart_ssl () {
  +       echo -n "An Apache module has been modified.  Restart apache-ssl [Y/n]? "
  +       read CONFIG
  +       if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
  +       then
  +               /usr/sbin/apache-sslctl restart
  +       fi
  +}
  +
   case "$1" in
     configure)
       # Configure this package.  If the package must prompt the user for
  @@ -51,17 +76,20 @@
         # which version was most recently configured, or even whether
         # there is a most recently configured version.
   		enable
  +               enable_ssl
         :
       elif test -z "$2" -o "$2" = "<unknown>"; then
         # The package has not ever been configured on this system, or was
         # purged since it was last configured.
         # DJ: So let's enable the module!
   		enable
  +               enable_ssl
         :
       else
         # Version $2 is the most recently configured version of this
         # package.
   		ask_restart
  +               ask_restart_ssl
         :
       fi ;;
     abort-upgrade | abort-remove | abort-deconfigure)
  @@ -78,11 +106,15 @@
   fi
   
   cat <<EOF
  -You must add the following line to your config files:
  -http.conf:
  -LoadModule dtcl_module mod_dtcl.so
  +You must add the following line to your httpd.conf config files
  +(of both apache and/or apache-ssl):
  +
  +To Section 1: Global Environment section:
  +
  +LoadModule dtcl_module /usr/lib/apache/1.3/mod_dtcl.so
  +
  +To Section 2: 'Main' server configuration, <IfModule mod_mime.c> section:
   
  -srm.conf:
   AddType application/x-httpd-tcl .ttml
   EOF
   
  
  
  
  1.2       +22 -1     tcl-moddtcl/debian/postrm
  
  Index: postrm
  ===================================================================
  RCS file: /home/cvs/tcl-moddtcl/debian/postrm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- postrm	2000/09/08 10:26:53	1.1
  +++ postrm	2001/10/15 10:44:09	1.2
  @@ -2,6 +2,7 @@
   # postrm.skeleton
   # Skeleton maintainer script showing all the possible cases.
   # Written by Charles Briscoe-Smith, March-April 1998.  Public Domain.
  +# Patch for apache/apache-ssl by János Holányi <csani@lme.linux.hu>, 2001
   
   # Abort if any command returns an error value
   set -e
  @@ -15,6 +16,14 @@
   	ask_restart
   }
   
  +killconf_ssl () {
  +       tmpfile=/etc/apache-ssl/httpd.conf.tmp.$$
  +       cat /etc/apache-ssl/httpd.conf |\
  +                sed 's/^(LoadModule.*mod_dtcl\.so)/#\1/' > $tmpfile
  +       mv -f $tmpfile /etc/apache-ssl/httpd.conf
  +       ask_restart_ssl
  +}
  +
   # Restart apache if user wants.
   ask_restart () {
   	echo -n "An Apache module has been modified.  Restart apache [Y/n]? "
  @@ -24,7 +33,17 @@
   		/usr/sbin/apachectl restart || true
   	fi
   }
  -                                                        # This script is called twice during
the removal of the package; once
  +
  +ask_restart_ssl () {
  +       echo -n "An Apache module has been modified.  Restart apache-ssl [Y/n]? "
  +       read CONFIG
  +       if [ ".$CONFIG" != ".n" -a ".$CONFIG" != ".N" ]
  +       then
  +               /usr/sbin/apache-sslctl restart || true
  +       fi
  +}
  +
  +# This script is called twice during the removal of the package; once
   # after the removal of the package's files from the system, and as
   # the final step in the removal of this package, after the package's
   # conffiles have been removed.
  @@ -34,6 +53,7 @@
       # This package has been removed, but its configuration has not yet
       # been purged.
   	killconf
  +       killconf_ssl
       :
       ;;
     purge | disappear | upgrade | failed-upgrade | abort-upgrade)
  @@ -43,6 +63,7 @@
       # Back out of an attempt to install this package.  Undo the effects of
       # "preinst install...".  There are two sub-cases.
       killconf
  +    killconf_ssl
       :
   	;;
     *) echo "$0: didn't understand being called with \`$1'" 1>&2
  
  
  

Mime
View raw message