aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-04-25 13:06:02 +0200
committerGuido Günther <agx@sigxcpu.org>2014-04-25 21:35:17 +0200
commit2829d848a04a7400a9cc71a1b1f24841c99018c8 (patch)
tree4edb5d0f14f7871e8f46c6f7424debd28d33bda8
parentd3dfd1ae7f09128893ccec1bfe7e1bb076d33b0a (diff)
Also look for shared objects without a version
While this will add all -dev packages to the checks we need this in order to also pick up dlopen'd objects.
-rw-r--r--tests/test_pkg.py8
-rw-r--r--whatmaps/pkg.py2
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_pkg.py b/tests/test_pkg.py
index a8b4182..eca789b 100644
--- a/tests/test_pkg.py
+++ b/tests/test_pkg.py
@@ -63,14 +63,18 @@ class TestPkg(unittest.TestCase):
p = Pkg('doesnotmatter')
p._list_contents = '/does/not/matter'
PopenMock = mock.return_value
- PopenMock.communicate.return_value = [
+ PopenMock.communicate.return_value = ['\n'.join([
'/lib/foo.so.1',
+ '/lib/bar.so',
'/not/a/shared/object',
- ]
+ '/not/a/shared/object.soeither',
+ ])]
PopenMock.returncode = 0
result = p.shared_objects
self.assertIn('/lib/foo.so.1', result)
+ self.assertIn('/lib/bar.so', result)
self.assertNotIn('/not/a/shred/object', result)
+ self.assertNotIn('/not/a/shred/object.soeither', result)
# We want to check that we don't invoke Popen on
# a second call so let it fail.
diff --git a/whatmaps/pkg.py b/whatmaps/pkg.py
index b69dd27..ab9088d 100644
--- a/whatmaps/pkg.py
+++ b/whatmaps/pkg.py
@@ -38,7 +38,7 @@ class Pkg(object):
type = None
services = None
- _so_regex = re.compile(r'(?P<so>/.*\.so(\.[^/]*)$)')
+ _so_regex = re.compile(r'(?P<so>/.*\.so(\.[^/]*)?$)')
_list_contents = None
def __init__(self, name):