[Zope3-checkins] CVS: Zope3/utilities/fssync - update.py:1.6

Guido van Rossum guido@python.org
Tue, 6 May 2003 14:35:01 -0400


Update of /cvs-repository/Zope3/utilities/fssync
In directory cvs.zope.org:/tmp/cvs-serv15757

Modified Files:
	update.py 
Log Message:
Use commands.mkarg() to properly quote shell argument.


=== Zope3/utilities/fssync/update.py 1.5 => 1.6 ===
--- Zope3/utilities/fssync/update.py:1.5	Tue May  6 14:10:36 2003
+++ Zope3/utilities/fssync/update.py	Tue May  6 14:35:00 2003
@@ -71,24 +71,8 @@
             if not isNewObject(sandbox_path):
                 mappings[zopedb_path] = sandbox_path
 
-                fmt_sandbox_path = ''
-                fmt_original_path = ''
-                for dir in sandbox_path.split(os.sep):
-                    if ' ' in dir:
-                        fmt_sandbox_path = os.path.join(fmt_sandbox_path,
-                                                        "'"+dir+"'")
-                    else:
-                        fmt_sandbox_path = os.path.join(fmt_sandbox_path, dir)
-
-                for dir in original_path.split(os.sep):
-                    if ' ' in dir:
-                        fmt_original_path = os.path.join(fmt_original_path,
-                                                         "'"+dir+"'")
-                    else:
-                        fmt_original_path = os.path.join(fmt_original_path,
-                                                         dir)
-                fmt_sandbox_path = os.sep + fmt_sandbox_path
-                fmt_original_path = os.sep + fmt_original_path
+                fmt_sandbox_path = commands.mkarg(sandbox_path)
+                fmt_original_path = commands.mkarg(original_path)
 
                 ob = getObject(zopedb_path, root)
                 zopedb_temp_file = createTempfile(ob, zopedb_path)