INN commit: branches/2.5 (9 files)

INN Commit rra at isc.org
Fri Sep 24 17:24:44 UTC 2010


    Date: Friday, September 24, 2010 @ 10:24:43
  Author: iulius
Revision: 9110

Add the possibility to run local innshellvars scripts.

innshellvars.local, innshellvars.pl.local and innshellvars.tcl.local
are now executed at the end of the run of the corresponding innshellvars script.
A typical use is to add or override variables.  For instance HOME or
GNUPGHOME.
These local scripts have to be executable; otherwise, they are not
taken into account.

Thanks to Matthew Vernon for the suggestion.

Added:
  branches/2.5/samples/innshellvars.local
    (from rev 9109, trunk/samples/innshellvars.local)
  branches/2.5/samples/innshellvars.pl.local
    (from rev 9109, trunk/samples/innshellvars.pl.local)
  branches/2.5/samples/innshellvars.tcl.local
    (from rev 9109, trunk/samples/innshellvars.tcl.local)
Modified:
  branches/2.5/doc/pod/news.pod
  branches/2.5/perl/INN/Config.pm.in
  branches/2.5/scripts/innshellvars.in
  branches/2.5/scripts/innshellvars.pl.in
  branches/2.5/scripts/innshellvars.tcl.in
  branches/2.5/site/Makefile

--------------------------------+
 doc/pod/news.pod               |    9 +++++++++
 perl/INN/Config.pm.in          |    9 +++++++++
 samples/innshellvars.local     |   13 +++++++++++++
 samples/innshellvars.pl.local  |   14 ++++++++++++++
 samples/innshellvars.tcl.local |   13 +++++++++++++
 scripts/innshellvars.in        |    6 ++++++
 scripts/innshellvars.pl.in     |    5 +++++
 scripts/innshellvars.tcl.in    |    6 ++++++
 site/Makefile                  |   12 +++++++++++-
 9 files changed, 86 insertions(+), 1 deletion(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2010-09-24 17:16:09 UTC (rev 9109)
+++ doc/pod/news.pod	2010-09-24 17:24:43 UTC (rev 9110)
@@ -44,6 +44,15 @@
 Fixed an issue at configure time that made INN wrongly assume that OpenBSD
 (4.6) didn't support Unix-domain sockets.  Thanks to Wim Lewis for the patch.
 
+=item *
+
+It is now possible to run a script at the end of the execution of
+B<innshellvars> scripts.  If a file named F<innshellvars.local>,
+F<innshellvars.pl.local> or F<innshellvars.tcl.local> is present and
+executable in I<pathetc>, then it will be executed by the corresponding
+B<innshellvars> script (respectively shell, INN::Config Perl module,
+and Tcl).  A typical use is to add or override variables.
+
 =back
 
 =head1 Changes in 2.5.2

Modified: perl/INN/Config.pm.in
===================================================================
--- perl/INN/Config.pm.in	2010-09-24 17:16:09 UTC (rev 9109)
+++ perl/INN/Config.pm.in	2010-09-24 17:24:43 UTC (rev 9110)
@@ -187,6 +187,11 @@
 @LOCKVAR, @EXTPROGVAR, @EXTCOMPVAR, @SYSVAR, @PARAMVAR);
 
 
+##  Load another script that can override or add variables.
+if (-x "${pathetc}/innshellvars.pl.local") {
+    do "${pathetc}/innshellvars.pl.local";
+}
+
 ##  That's all.
 1;
 
@@ -206,6 +211,10 @@
 programs, masks, parameters) and you should have a look at the source
 code of the module to see what you can use in your Perl scripts.
 
+A local Perl script named F<innshellvars.pl.local> in I<pathetc> will be
+loaded, if present and executable, at the end of the run of this module.
+A typical use is to add or override variables.
+
 You only have to declare the module at the beginning of them:
 
     use lib '<pathnews>/lib/perl';

Copied: branches/2.5/samples/innshellvars.local (from rev 9109, trunk/samples/innshellvars.local)
===================================================================
--- samples/innshellvars.local	                        (rev 0)
+++ samples/innshellvars.local	2010-09-24 17:24:43 UTC (rev 9110)
@@ -0,0 +1,13 @@
+##  $Id$
+##
+##  Sample innshellvars.local script.
+##
+##  It permits to add or override variables defined by
+##  the innshellvars shell script.
+##  This script has to be executable in order to be included
+##  during the run of innshellvars.
+
+##  Defining or redefining VARIABLE will allow to use
+##  $VARIABLE with the corresponding value in a script
+##  calling innshellvars.
+#VARIABLE = 'test'

Copied: branches/2.5/samples/innshellvars.pl.local (from rev 9109, trunk/samples/innshellvars.pl.local)
===================================================================
--- samples/innshellvars.pl.local	                        (rev 0)
+++ samples/innshellvars.pl.local	2010-09-24 17:24:43 UTC (rev 9110)
@@ -0,0 +1,14 @@
+##  $Id$
+##
+##  Sample innshellvars.pl.local script.
+##
+##  It permits to add or override variables defined by
+##  the INN::Config Perl module (or the legacy innshellvars.pl
+##  Perl script).
+##  This script has to be executable in order to be included
+##  during the run of INN::Config.
+
+##  Defining or redefining $variable will allow to use
+##  $INN::Config::variable with the corresponding value
+##  in a script calling INN::Config.
+#$variable = 'test';

Copied: branches/2.5/samples/innshellvars.tcl.local (from rev 9109, trunk/samples/innshellvars.tcl.local)
===================================================================
--- samples/innshellvars.tcl.local	                        (rev 0)
+++ samples/innshellvars.tcl.local	2010-09-24 17:24:43 UTC (rev 9110)
@@ -0,0 +1,13 @@
+##  $Id$
+##
+##  Sample innshellvars.tcl.local script.
+##
+##  It permits to add or override variables defined by
+##  the innshellvars.tcl script.
+##  This script has to be executable in order to be included
+##  during the run of innshellvars.tcl.
+
+##  Defining or redefining variable will allow to use
+##  $variable with the corresponding value during the run
+##  of innshellvars.tcl.
+#set variable "test"

Modified: scripts/innshellvars.in
===================================================================
--- scripts/innshellvars.in	2010-09-24 17:16:09 UTC (rev 9109)
+++ scripts/innshellvars.in	2010-09-24 17:24:43 UTC (rev 9110)
@@ -125,3 +125,9 @@
 
 HOME=$PATHNEWS
 export HOME
+
+
+##  Load another script that can override or add variables. 
+if [ -x ${PATHETC}/innshellvars.local ]; then
+    . ${PATHETC}/innshellvars.local
+fi

Modified: scripts/innshellvars.pl.in
===================================================================
--- scripts/innshellvars.pl.in	2010-09-24 17:16:09 UTC (rev 9109)
+++ scripts/innshellvars.pl.in	2010-09-24 17:24:43 UTC (rev 9110)
@@ -140,4 +140,9 @@
 $home = ${pathnews};
 $ENV{'HOME'} = ${pathnews};
 
+##  Load another script that can override or add variables.
+if (-x "${pathetc}/innshellvars.pl.local") {
+    do "${pathetc}/innshellvars.pl.local";
+}
+
 1 ;

Modified: scripts/innshellvars.tcl.in
===================================================================
--- scripts/innshellvars.tcl.in	2010-09-24 17:16:09 UTC (rev 9109)
+++ scripts/innshellvars.tcl.in	2010-09-24 17:24:43 UTC (rev 9110)
@@ -133,3 +133,9 @@
 
 set inn_home "$inn_pathnews"
 set env(HOME) "$inn_pathnews"
+
+
+##  Load another script that can override or add variables.
+if {[file executable "${inn_pathetc}/innshellvars.tcl.local"] == 1} {
+    source "${inn_pathetc}/innshellvars.tcl.local"
+}

Modified: site/Makefile
===================================================================
--- site/Makefile	2010-09-24 17:16:09 UTC (rev 9109)
+++ site/Makefile	2010-09-24 17:24:43 UTC (rev 9110)
@@ -63,7 +63,9 @@
 	innwatch.ctl distrib.pats distributions actsync.cfg actsync.ign \
 	motd.news storage.conf cycbuff.conf buffindexed.conf \
 	innfeed.conf startup_innd.pl filter_innd.pl filter_nnrpd.pl \
-	filter_innd.py INN.py nnrpd.py \
+	filter_innd.py INN.py \
+	innshellvars.local innshellvars.pl.local innshellvars.tcl.local \
+	nnrpd.py \
 	nnrpd_auth.pl nnrpd_access.pl nocem.ctl \
         news2mail.cf readers.conf \
 	radius.conf nnrpd_auth.py nnrpd_access.py nnrpd_dynamic.py \
@@ -89,6 +91,8 @@
 	$D$(PATH_PYTHON_FILTER_INND) $D$(PATH_PYTHON_INN_MODULE) \
 	$D$(PATH_PYTHON_NNRPD_MODULE) \
 	$D$(PATH_TCL_STARTUP) $D$(PATH_TCL_FILTER) \
+	$D$(PATHETC)/innshellvars.local $D$(PATHETC)/innshellvars.pl.local \
+	$D$(PATHETC)/innshellvars.tcl.local \
 	$D$(PATHETC)/nocem.ctl \
 	$D$(PATH_NNRPAUTH) $D$(PATHETC)/news2mail.cf $D$(PATH_READERSCONF) \
 	$D$(PATH_RADIUS_CONF) $D$(PATH_NNRPYAUTH) $D$(PATH_NNRPYACCESS) $D$(PATH_NNRPYDYNAMIC) \
@@ -194,6 +198,9 @@
 $D$(PATHETC)/news2mail.cf: news2mail.cf	; $(COPY_RPUB) $? $@
 $D$(PATHETC)/innreport.conf: innreport.conf	; $(COPY_RPUB) $? $@
 $D$(PATHHTTP)/innreport.css: innreport.css	; $(COPY_RPUB) $? $@
+$D$(PATHETC)/innshellvars.local: innshellvars.local	; $(COPY_XPUB) $? $@
+$D$(PATHETC)/innshellvars.pl.local: innshellvars.pl.local	; $(COPY_XPUB) $? $@
+$D$(PATHETC)/innshellvars.tcl.local: innshellvars.tcl.local	; $(COPY_XPUB) $? $@
 $D$(PATHETC)/localgroups: localgroups	; $(COPY_RPUB) $? $@
 $D$(PATH_STORAGECONF): storage.conf	; $(COPY_RPUB) $? $@
 $D$(PATH_CYCBUFFCONFIG): cycbuff.conf	; $(COPY_RPUB) $? $@
@@ -250,6 +257,9 @@
 inn.conf:	../samples/inn.conf		; $(COPY) $? $@
 innreport.conf:	../samples/innreport.conf	; $(COPY) $? $@
 innreport.css:	../samples/innreport.css	; $(COPY) $? $@
+innshellvars.local: ../samples/innshellvars.local	; $(COPY) $? $@
+innshellvars.pl.local: ../samples/innshellvars.pl.local	; $(COPY) $? $@
+innshellvars.tcl.local: ../samples/innshellvars.tcl.local	; $(COPY) $? $@
 localgroups:	../samples/localgroups		; $(COPY) $? $@
 storage.conf:	../samples/storage.conf		; $(COPY) $? $@
 cycbuff.conf:	../samples/cycbuff.conf		; $(COPY) $? $@




More information about the inn-committers mailing list