damned-lies r693 - trunk



Author: claudep
Date: Sat Jan 12 14:46:23 2008
New Revision: 693
URL: http://svn.gnome.org/viewvc/damned-lies?rev=693&view=rev

Log:
2008-01-12  Claude Paroz  <claude 2xlibre net>

	* modules.py:
	* update-stats.py: Escaped paths in system commands.
	Fixes #475599.

Modified:
   trunk/ChangeLog
   trunk/modules.py
   trunk/update-stats.py

Modified: trunk/modules.py
==============================================================================
--- trunk/modules.py	(original)
+++ trunk/modules.py	Sat Jan 12 14:46:23 2008
@@ -103,26 +103,26 @@
         if os.access(modulepath, os.X_OK | os.W_OK):
             # Path exists, update repos
             if self.type == "cvs":
-                commandList.append("cd %(localdir)s && cvs -z4 up -Pd" % {
+                commandList.append("cd \"%(localdir)s\" && cvs -z4 up -Pd" % {
                     "localdir" : modulepath,
                     })
             elif self.type == "svn":
-                commandList.append("cd %(localdir)s && svn up --non-interactive" % {
+                commandList.append("cd \"%(localdir)s\" && svn up --non-interactive" % {
                     "localdir" : modulepath,
                     })
             elif self.type == "hg":
-                commandList.append("cd %(localdir)s && hg revert --all" % {
+                commandList.append("cd \"%(localdir)s\" && hg revert --all" % {
                     "localdir" : modulepath,
                     })
             elif self.type == "git":
-                commandList.append("cd %(localdir)s && git checkout %(branch)s && git reset --hard && git clean -d" % {
+                commandList.append("cd \"%(localdir)s\" && git checkout %(branch)s && git reset --hard && git clean -d" % {
                     "localdir" : modulepath,
                     "branch" : branch,
                     })
         else:
             # Checkout
             if self.type == "cvs":
-                commandList.append("cd %(localroot)s && cvs -d%(cvsroot)s -z4 co -d%(dir)s -r%(branch)s %(module)s" % {
+                commandList.append("cd \"%(localroot)s\" && cvs -d%(cvsroot)s -z4 co -d%(dir)s -r%(branch)s %(module)s" % {
                 "localroot" : localroot,
                 "cvsroot" : scmroot,
                 "dir" : moduledir,
@@ -135,30 +135,30 @@
                     svnpath += "/trunk"
                 else:
                     svnpath += "/branches/" + branch
-                commandList.append("cd %(localroot)s && svn co --non-interactive %(svnpath)s %(dir)s" % {
+                commandList.append("cd \"%(localroot)s\" && svn co --non-interactive %(svnpath)s \"%(dir)s\"" % {
                     "localroot" : localroot,
                     "svnpath" : svnpath,
                     "dir" : moduledir,
                     })
             elif self.type == "hg":
                 hgpath = scmroot + "/" + module
-                commandList.append("cd %(localroot)s && hg clone %(hgpath)s %(dir)s" % {
+                commandList.append("cd \"%(localroot)s\" && hg clone %(hgpath)s \"%(dir)s\"" % {
                     "localroot" : localroot,
                     "hgpath" : hgpath,
                     "dir" : moduledir,
                     })
-                commandList.append("cd %(localdir)s && hg update %(branch)s" % {
+                commandList.append("cd \"%(localdir)s\" && hg update %(branch)s" % {
                     "localdir" : modulepath,
                     "branch" : branch,
                     })
             elif self.type == "git":
                 gitpath = scmroot + "/" + module
-                commandList.append("cd %(localroot)s && git clone %(gitpath)s %(dir)s" % {
+                commandList.append("cd \"%(localroot)s\" && git clone %(gitpath)s \"%(dir)s\"" % {
                     "localroot" : localroot,
                     "gitpath" : gitpath,
                     "dir" : moduledir,
                     })
-                commandList.append("cd %(localdir)s && git checkout %(branch)s" % {
+                commandList.append("cd \"%(localdir)s\" && git checkout %(branch)s" % {
                     "localdir" : modulepath,
                     "branch" : branch,
                     })

Modified: trunk/update-stats.py
==============================================================================
--- trunk/update-stats.py	(original)
+++ trunk/update-stats.py	Sat Jan 12 14:46:23 2008
@@ -186,7 +186,7 @@
         errors = self.check_pot_regeneration(popath)
 
         # Generate PO template (POT) file
-        command = "cd %(dir)s && intltool-update -g '%(domain)s' -p" % {
+        command = "cd \"%(dir)s\" && intltool-update -g '%(domain)s' -p" % {
             "dir" : popath,
             "domain" : pot_base,
             }
@@ -361,7 +361,7 @@
         """Check if there were any problems regenerating a POT file."""
         errors = []
 
-        command = "cd %(dir)s && rm -f missing notexist && intltool-update -m" % { "dir" : po_path, }
+        command = "cd \"%(dir)s\" && rm -f missing notexist && intltool-update -m" % { "dir" : po_path, }
         if defaults.DEBUG: print >>sys.stderr, command
         (error, output) = commands.getstatusoutput(command)
         if defaults.DEBUG: print >> sys.stderr, output
@@ -558,7 +558,7 @@
         allfiles = ""
         for file in files:
             allfiles += " " + os.path.join("C", file)
-        command = "cd %s && xml2po -o %s -e %s" % (sourcedir, fullpot, allfiles)
+        command = "cd \"%s\" && xml2po -o %s -e %s" % (sourcedir, fullpot, allfiles)
 
         if defaults.DEBUG: print >>sys.stderr, command
         (error, output) = commands.getstatusoutput(command)
@@ -693,7 +693,7 @@
             files.append(file)
 
         for file in files:
-            command = "cd %(sourcedir)s && xml2po -e -l %(lang)s -p %(pofile)s -o %(outfile)s %(infile)s" % {
+            command = "cd \"%(sourcedir)s\" && xml2po -e -l %(lang)s -p %(pofile)s -o \"%(outfile)s\" \"%(infile)s\"" % {
                 'sourcedir' : sourcedir,
                 'pofile' : pofile,
                 'outfile' : os.path.join(os.path.join(out_dir, lang, file)),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]