[cig-commits] r18535 - cs/buildbot/trunk/buildbot/scripts

brad at geodynamics.org brad at geodynamics.org
Fri Jun 3 10:06:05 PDT 2011


Author: brad
Date: 2011-06-03 10:06:05 -0700 (Fri, 03 Jun 2011)
New Revision: 18535

Modified:
   cs/buildbot/trunk/buildbot/scripts/packager.py
Log:
Fixed small bug. Can't use shutil.copy() when src is a dir (revert to os.system(cp -r).

Modified: cs/buildbot/trunk/buildbot/scripts/packager.py
===================================================================
--- cs/buildbot/trunk/buildbot/scripts/packager.py	2011-06-03 16:54:43 UTC (rev 18534)
+++ cs/buildbot/trunk/buildbot/scripts/packager.py	2011-06-03 17:06:05 UTC (rev 18535)
@@ -232,8 +232,11 @@
             src = join(prefix, src)
         if not isdir(dest):
             os.makedirs(dest)
-        shutil.copy(src, dest)
-        #os.system("cp -r %s %s" % (src, dest))
+
+        if not isdir(src):
+            shutil.copy(src, dest) # faster than os.system() for small files
+        else:
+            os.system("cp -r %s %s" % (src, dest))
     return
 
 



More information about the CIG-COMMITS mailing list