Skip to content

Commit

Permalink
Merge pull request #73 from reaperhulk/fix-72
Browse files Browse the repository at this point in the history
support versioned symbols with more underscores
  • Loading branch information
ehashman authored May 24, 2017
2 parents 5f72bc5 + 0e123ce commit 3163c09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion auditwheel/policy/versioned_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def policy_is_satisfied(policy_name: str,
required_vers = {} # type: Dict[str, Set[str]]
for symbols in versioned_symbols.values():
for symbol in symbols:
sym_name, _ = symbol.split("_", 2)
sym_name, _, _ = symbol.partition("_")
required_vers.setdefault(sym_name, set()).add(symbol)
matching_policies = [] # type: List[int]
for p in load_policies():
Expand Down
8 changes: 7 additions & 1 deletion tests/test_policy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from jsonschema import validate
from auditwheel.policy import (load_policies, _load_policy_schema,
versioned_symbols_policy, POLICY_PRIORITY_LOWEST)
versioned_symbols_policy,
POLICY_PRIORITY_HIGHEST,
POLICY_PRIORITY_LOWEST)


def test_policy():
Expand All @@ -14,3 +16,7 @@ def test_policy_checks_glibc():
assert policy > POLICY_PRIORITY_LOWEST
policy = versioned_symbols_policy({"some_library.so": {"GLIBC_999"}})
assert policy == POLICY_PRIORITY_LOWEST
policy = versioned_symbols_policy({"some_library.so": {"OPENSSL_1_1_0"}})
assert policy == POLICY_PRIORITY_HIGHEST
policy = versioned_symbols_policy({"some_library.so": {"IAMALIBRARY"}})
assert policy == POLICY_PRIORITY_HIGHEST

0 comments on commit 3163c09

Please sign in to comment.