[gtk-mac-bundler] Filter list of binaries to exclude symlinks and files which are neither executable nor binary.
- From: John Ralls <jralls src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-mac-bundler] Filter list of binaries to exclude symlinks and files which are neither executable nor binary.
- Date: Sat, 8 Sep 2012 22:12:35 +0000 (UTC)
commit 0108ea7661aca908d2ed4dd1eb3593917a66f23b
Author: John Ralls <jralls ceridwen us>
Date: Sat Sep 8 14:54:57 2012 -0700
Filter list of binaries to exclude symlinks and files which are neither executable nor binary.
bundler/bundler.py | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/bundler/bundler.py b/bundler/bundler.py
index 6366a89..c8cc852 100644
--- a/bundler/bundler.py
+++ b/bundler/bundler.py
@@ -297,6 +297,12 @@ class Bundler:
# Lists all the binaries copied in so far. Used in the library
# dependency resolution and icon theme lookup.
def list_copied_binaries(self):
+ def filter_path(path):
+ if os.path.islink(path):
+ return False
+ if path.endswith(".so") or path.endswith(".dylib") or os.access(path, os.X_OK):
+ return True
+ return False
paths = []
for path in self.binary_paths:
if os.path.isdir(path):
@@ -305,11 +311,8 @@ class Bundler:
else:
paths.append(path)
- # FIXME: Should filter this list so it only contains .so,
- # .dylib, and executable binaries.
- #return filter(lambda l: l.endswith(".so") or l.endswith(".dylib") or os.access(l, os.X_OK), paths)
- paths = list(set(paths))
- return paths
+ paths = filter(filter_path, paths)
+ return list(set(paths))
def resolve_library_dependencies(self):
# Get the libraries we link to, filter out anything that
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]