INN commit: trunk (9 files)

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


    Date: Friday, September 24, 2010 @ 10:16:09
  Author: iulius
Revision: 9109

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:
  trunk/samples/innshellvars.local
  trunk/samples/innshellvars.pl.local
  trunk/samples/innshellvars.tcl.local
Modified:
  trunk/doc/pod/news.pod
  trunk/perl/INN/Config.pm.in
  trunk/scripts/innshellvars.in
  trunk/scripts/innshellvars.pl.in
  trunk/scripts/innshellvars.tcl.in
  trunk/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        |    8 +++++++-
 scripts/innshellvars.pl.in     |    6 ++++++
 scripts/innshellvars.tcl.in    |    6 ++++++
 site/Makefile                  |   12 +++++++++++-
 9 files changed, 88 insertions(+), 2 deletions(-)

Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod	2010-09-14 20:24:43 UTC (rev 9108)
+++ doc/pod/news.pod	2010-09-24 17:16:09 UTC (rev 9109)
@@ -158,6 +158,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-14 20:24:43 UTC (rev 9108)
+++ perl/INN/Config.pm.in	2010-09-24 17:16:09 UTC (rev 9109)
@@ -186,6 +186,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;
 
@@ -205,6 +210,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';

Added: samples/innshellvars.local
===================================================================
--- samples/innshellvars.local	                        (rev 0)
+++ samples/innshellvars.local	2010-09-24 17:16:09 UTC (rev 9109)
@@ -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'


Property changes on: trunk/samples/innshellvars.local
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Added: samples/innshellvars.pl.local
===================================================================
--- samples/innshellvars.pl.local	                        (rev 0)
+++ samples/innshellvars.pl.local	2010-09-24 17:16:09 UTC (rev 9109)
@@ -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';


Property changes on: trunk/samples/innshellvars.pl.local
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Added: samples/innshellvars.tcl.local
===================================================================
--- samples/innshellvars.tcl.local	                        (rev 0)
+++ samples/innshellvars.tcl.local	2010-09-24 17:16:09 UTC (rev 9109)
@@ -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"


Property changes on: trunk/samples/innshellvars.tcl.local
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:keywords
   + Author Date Id Revision
Added: svn:eol-style
   + native

Modified: scripts/innshellvars.in
===================================================================
--- scripts/innshellvars.in	2010-09-14 20:24:43 UTC (rev 9108)
+++ scripts/innshellvars.in	2010-09-24 17:16:09 UTC (rev 9109)
@@ -123,4 +123,10 @@
 PATH=${NEWSLBIN}:${NEWSBIN}:${PATH}:/bin:/usr/bin
 export PATH
 
-# Do not override HOME.
+##  Do not override 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-14 20:24:43 UTC (rev 9108)
+++ scripts/innshellvars.pl.in	2010-09-24 17:16:09 UTC (rev 9109)
@@ -137,6 +137,12 @@
 $path = "${newslbin}:${newsbin}:${path}:/bin:/usr/bin";
 $ENV{'PATH'} = $path;
 
+
 $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-14 20:24:43 UTC (rev 9108)
+++ scripts/innshellvars.tcl.in	2010-09-24 17:16:09 UTC (rev 9109)
@@ -132,3 +132,9 @@
 set env(PATH) "$inn_path"
 
 set inn_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-14 20:24:43 UTC (rev 9108)
+++ site/Makefile	2010-09-24 17:16:09 UTC (rev 9109)
@@ -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) \
@@ -191,6 +195,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) $? $@
@@ -247,6 +254,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