Matti Picus avatar Matti Picus committed 5e24c1b

use copytree to fix recursive copying of headers

Comments (0)

Files changed (1)


     builddir = udir.ensure("build", dir=True)
     pypydir = builddir.ensure(name, dir=True)
     includedir = basedir.join('include')
+    # Recursively copy all headers, shutil has only ignore
+    # so we do a double-negative to include what we want
+    def copyonly(dirpath, contents):
+        return set(contents) - set(
+            shutil.ignore_patterns('*.h', '*.incl')(dirpath, contents),
+        )
+    shutil.copytree(str(includedir), str(pypydir.join('include')))
     pypydir.ensure('include', dir=True)
     if sys.platform == 'win32':
             # modules for windows, has the lib moved or are there no
             # exported functions in the dll so no import library is created?
-    # Careful: to copy lib_pypy, copying just the svn-tracked files
+    # Careful: to copy lib_pypy, copying just the hg-tracked files
     # would not be enough: there are also ctypes_config_cache/_*
                                            '*.c', '*.o'))
     for file in ['LICENSE', 'README.rst']:
         shutil.copy(str(basedir.join(file)), str(pypydir))
-    headers = includedir.listdir('*.h') + includedir.listdir('*.inl')
-    for n in headers:
-        # we want to put there all *.h and *.inl from trunk/include
-        # and from pypy/_interfaces
-        shutil.copy(str(n), str(pypydir.join('include')))
     spdir = pypydir.ensure('site-packages', dir=True)
     shutil.copy(str(basedir.join('site-packages', 'README')), str(spdir))
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.