Browse Source

Merge pull request #41 from raphaelm/exclude-platform

Fix a bug in the exclude option in cross-platform environments
Thomas Kluyver 10 years ago
parent
commit
f8136a0683
2 changed files with 4 additions and 3 deletions
  1. 2 1
      nsist/__init__.py
  2. 2 2
      nsist/copymodules.py

+ 2 - 1
nsist/__init__.py

@@ -89,7 +89,7 @@ class InstallerBuilder(object):
         self.shortcuts = shortcuts
         self.icon = icon
         self.packages = packages or []
-        self.exclude = exclude or []
+        self.exclude = [os.path.normpath(p) for p in (exclude or [])]
         self.extra_files = extra_files or []
         self.py_version = py_version
         if not self._py_version_pattern.match(py_version):
@@ -268,6 +268,7 @@ if __name__ == '__main__':
         ignored = set()
 
         # Filter by file names relative to the build directory
+        directory = os.path.normpath(directory)
         files = [os.path.join(directory, fname) for fname in files]
 
         # Execute all patterns

+ 2 - 2
nsist/copymodules.py

@@ -73,8 +73,8 @@ def copytree_ignore_callback(excludes, pkgdir, modname, directory, files):
 
     # Filter by file names relative to the build directory
     reldir = os.path.relpath(directory, pkgdir)
-    target = os.path.join('pkgs/', modname, reldir)
-    files = [os.path.join(target, fname) for fname in files]
+    target = os.path.join('pkgs', modname, reldir)
+    files = [os.path.normpath(os.path.join(target, fname)) for fname in files]
 
     # Execute all patterns
     for pattern in excludes + ['*.pyc']: