[csw-devel] SF.net SVN: gar:[11217] csw/mgar/gar/v2/lib/python/sharedlib_utils.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sun Oct 10 22:34:53 CEST 2010


Revision: 11217
          http://gar.svn.sourceforge.net/gar/?rev=11217&view=rev
Author:   wahwah
Date:     2010-10-10 20:34:52 +0000 (Sun, 10 Oct 2010)

Log Message:
-----------
mGAR v2: Using blacklists to rule out some private shared objects.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/sharedlib_utils.py

Modified: csw/mgar/gar/v2/lib/python/sharedlib_utils.py
===================================================================
--- csw/mgar/gar/v2/lib/python/sharedlib_utils.py	2010-10-10 20:34:27 UTC (rev 11216)
+++ csw/mgar/gar/v2/lib/python/sharedlib_utils.py	2010-10-10 20:34:52 UTC (rev 11217)
@@ -21,10 +21,19 @@
                   + INTEL_386_PATHS + AMD64_PATHS)
   # Need to escape the plus signs because of the regex usage below.
   arch_subdirs = [x.replace(r"+", r"\+") for x in arch_subdirs]
-  linkable_re = re.compile(r"^opt/csw(/([^\/]+(?!lib)))*/lib(/(%s))?$"
+  linkable_re = re.compile(r"^opt/csw(/([^\/]+))*/lib(/(%s))?$"
                            % "|".join(arch_subdirs))
+  blacklist = [
+      # If it has two lib components, it's a private lib.
+      re.compile(r"^opt/csw/.*lib.*lib.*"),
+  ]
   file_dir, file_basename = os.path.split(file_path)
-  return bool(linkable_re.match(file_dir))
+  if linkable_re.match(file_dir):
+    for regex in blacklist:
+      if regex.match(file_dir):
+        return False
+    return True
+  return False
 
 
 def SanitizeWithChar(s, c):


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list