diff fetch.py @ 47:72d461e2ccbd

more stubbing of copytree
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 15 Nov 2011 15:00:10 -0800
parents fb05b7616bd8
children bedef9761af9
line wrap: on
line diff
--- a/fetch.py	Tue Nov 15 14:53:08 2011 -0800
+++ b/fetch.py	Tue Nov 15 15:00:10 2011 -0800
@@ -25,6 +25,8 @@
       "The destination directory must not already exist."
     """
 
+    assert os.path.exists(src), "'%s' does not exist" % src
+
     # if its a file, just copy it
     if os.path.isfile(src):
         shutil.copy2(src, dst)
@@ -37,7 +39,15 @@
     else:
         os.makedirs(dst)
 
+    src = os.path.realpath(src)
     for dirpath, dirnames, filenames in os.walk(src):
+        for d in dirnames:
+            pass
+        for f in filenames:
+            path = os.path.join(dirpath, f)
+            _dst = os.path.join(dst, os.path.relpath(path, src))
+            import pdb; pdb.set_trace()
+#            shutil.copy2(path
         import pdb; pdb.set_trace()
 
 class Fetcher(object):
@@ -174,6 +184,8 @@
         dest = os.path.abspath(dest)
         tmpdir = tempfile.mkdtemp()
         self.clone(tmpdir)
+        if self.vcs_dir:
+            shutil.rmtree(os.path.join(tmpdir, self.vcs_dir))
         path = tmpdir
         if self.subpath:
             path = os.path.join([tmpdir] + self.subpath)