[Zope-CVS] CVS: Packages/zpkgtools/bin - zpkg:1.10

Fred L. Drake, Jr. fred at zope.com
Tue Mar 16 11:00:29 EST 2004


Update of /cvs-repository/Packages/zpkgtools/bin
In directory cvs.zope.org:/tmp/cvs-serv5731/bin

Modified Files:
	zpkg 
Log Message:
add command line option to suppress reading of the default configuration file


=== Packages/zpkgtools/bin/zpkg 1.9 => 1.10 ===
--- Packages/zpkgtools/bin/zpkg:1.9	Tue Mar 16 10:42:19 2004
+++ Packages/zpkgtools/bin/zpkg	Tue Mar 16 10:59:58 2004
@@ -46,7 +46,15 @@
         self.tmpdir = tempfile.mkdtemp(prefix=program + "-")
         tempfile.tempdir = self.tmpdir
         self.loader = cvsloader.CvsLoader()
-        cf = config.Configuration(options.configfile)
+        cf = config.Configuration()
+        path = options.configfile
+        if path is None:
+            path = config.defaultConfigurationPath()
+            if os.path.exists(path):
+                cf.loadPath(path)
+        elif path:
+            cf.loadPath(path)
+
         if options.location_maps:
             cf.location_maps[:0] = options.location_maps
         cf.finalize()
@@ -169,6 +177,10 @@
     parser.add_option(
         "-C", "--configure", dest="configfile",
         help="path or URL to the configuration file")
+    parser.add_option(
+        "-f", dest="configfile",
+        action="store_const", const="",
+        help="don't read a configuration file")
     parser.add_option(
         "-m", "--resource-map", dest="location_maps",
         action="append",




More information about the Zope-CVS mailing list