From 1531d364c34c8d3fd5015c0d0c3f9de4dbd26efe Mon Sep 17 00:00:00 2001 From: Jondy Zhao Date: Tue, 7 Jul 2020 14:47:26 +0800 Subject: [PATCH] Rename platname alpine.* to musl.* --- docs/change-logs.rst | 1 + src/pytransform.py | 2 +- src/utils.py | 13 ++++++------- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/change-logs.rst b/docs/change-logs.rst index 6c91991d..bf6720d7 100644 --- a/docs/change-logs.rst +++ b/docs/change-logs.rst @@ -21,6 +21,7 @@ Most of the algorithm are refined to improve the security. Refer to https://pyarmor.readthedocs.io/en/latest/performance.html * Add platform `musl.mips32` for MIPS32 with `musl` * Add common options `--boot` for special cross platform obfuscating +* Rename platform names `alpine.*` to `musl.*` 6.2.9 ----- diff --git a/src/pytransform.py b/src/pytransform.py index 96a6e05a..fffb6e76 100644 --- a/src/pytransform.py +++ b/src/pytransform.py @@ -253,7 +253,7 @@ def format_platform(platid=None): if plat == 'linux': cname, cver = platform.libc_ver() if cname == 'musl': - plat = 'alpine' + plat = 'musl' elif cname == 'libc': plat = 'android' elif cname == 'glibc': diff --git a/src/utils.py b/src/utils.py index 72aacdcd..c87e715c 100755 --- a/src/utils.py +++ b/src/utils.py @@ -999,9 +999,9 @@ def _get_preferred_platid(platname, features=None): nlist = platname.split('.') name = '.'.join(nlist[:2]) - if name in ('linux.arm', 'linux.armv6', 'linux.ppc64', 'linux.mips32', + if name in ('linux.arm', 'linux.armv6', 'linux.ppc64', 'darwin.arm64', 'freebsd.x86_64', 'android.aarch64', - 'alpine.x86_64', 'alpine.arm', + 'musl.x86_64', 'musl.arm', 'musl.mips32', 'poky.x86', 'vs2015.x86_64', 'vs2015.x86'): if features and '0' not in features: raise RuntimeError('No feature %s for platform %s', features, name) @@ -1013,10 +1013,7 @@ def _get_preferred_platid(platname, features=None): features = nlist[2:3] elif features is None: - n = pytransform.version_info()[2] - features = ['21', '25'] if (n & FEATURE_VM) \ - else ['3', '7'] if (n & FEATURE_JIT) \ - else ['0'] + features = ['7', '3', '0'] pyver = None if '8' in features or '11' in features or '25' in features: @@ -1101,7 +1098,9 @@ def compatible_platform_names(platforms): 'ppc64le': 'linux.ppc64', 'ios.arm64': 'darwin.arm64', 'freebsd': 'freebsd.x86_64', - 'alpine': 'alpine.x86_64', + 'alpine': 'musl.x86_64', + 'alpine.arm': 'musl.arm', + 'alpine.x86_64': 'musl.x86_64', 'poky-i586': 'poky.x86', }