SF.net SVN: tmda: [2150] trunk/tmda/bin

[email protected] Fri, 23 Feb 2007 19:10:58 -0800
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Revision: 2150
          http://svn.sourceforge.net/tmda/?rev=2150&view=rev
Author:   srwarren
Date:     2007-02-23 19:10:42 -0800 (Fri, 23 Feb 2007)

Log Message:
-----------
tmda-rfilter: Patch from Bernard Johnson: Allow multiple -e options on the cmdline

Modified Paths:
--------------
    trunk/tmda/bin/ChangeLog
    trunk/tmda/bin/tmda-rfilter

Modified: trunk/tmda/bin/ChangeLog
===================================================================
--- trunk/tmda/bin/ChangeLog	2007-02-24 03:06:47 UTC (rev 2149)
+++ trunk/tmda/bin/ChangeLog	2007-02-24 03:10:42 UTC (rev 2150)
@@ -1,3 +1,8 @@
+2007-02-23  Stephen Warren  <[email protected]>
+
+	* tmda-rfilter: Add fix from Bernard Johnson that enables multiple
+	-e options to be used.
+
 2006-12-19  Stephen Warren  <[email protected]>
 
 	* tmda-ofmipd: Fix option parsing related issue when using default

Modified: trunk/tmda/bin/tmda-rfilter
===================================================================
--- trunk/tmda/bin/tmda-rfilter	2007-02-24 03:06:47 UTC (rev 2149)
+++ trunk/tmda/bin/tmda-rfilter	2007-02-24 03:10:42 UTC (rev 2150)
@@ -81,7 +81,7 @@
 FILTER_INCOMING in ~/.tmda/config."""),
 
     make_option("-e", "--environ",
-                metavar="VAR=VAL", dest="environ",
+                metavar="VAR=VAL", dest="environ", action="append",
                 help= \
 """Add an environment variable on the command line.  VAR is the name
 of the variable, and VAL, separated by an '=', is its value.  There
@@ -141,11 +141,12 @@
 if opts.filter_incoming:
     os.environ['TMDA_FILTER_INCOMING'] = opts.filter_incoming
 if opts.environ:
-    try:
-        key, value = opts.environ.split('=', 1)
-        os.environ[key] = value
-    except (KeyError, ValueError):
-        parser.error('bad environment key-value pair - "%s"' % opts.environ)
+    for pair in opts.environ:
+        try:
+            key, value = pair.split('=', 1)
+            os.environ[key] = value
+        except (KeyError, ValueError):
+            parser.error('bad environment key-value pair - "%s"' % pair)
 if opts.vhomescript:
     if os.environ.has_key('EXT') and os.environ.has_key('HOST'):
         setvuserhomedir(opts.vhomescript)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.