| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -197,7 +197,7 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384): | |||
| 197 | 197 | | (GLIBC_([0-9.]+)) | |
| 198 | 198 | | (libc(_\w+)?\.so(?:\.(\d[0-9.]*))?) | |
| 199 | 199 | | (musl-([0-9.]+)) | |
| 200 | - | (libc.musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) | ||
| 200 | + | ((?:libc\.|ld-)musl(?:-\w+)?.so(?:\.(\d[0-9.]*))?) | ||
| 201 | 201 | """, | |
| 202 | 202 | re.ASCII | re.VERBOSE) | |
| 203 | 203 | ||
@@ -236,7 +236,7 @@ def libc_ver(executable=None, lib='', version='', chunksize=16384): | |||
| 236 | 236 | elif V(glibcversion) > V(ver): | |
| 237 | 237 | ver = glibcversion | |
| 238 | 238 | elif so: | |
| 239 | - if lib != 'glibc': | ||
| 239 | + if lib not in ('glibc', 'musl'): | ||
| 240 | 240 | lib = 'libc' | |
| 241 | 241 | if soversion and (not ver or V(soversion) > V(ver)): | |
| 242 | 242 | ver = soversion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -569,6 +569,8 @@ def test_libc_ver(self): | |||
| 569 | 569 | (b'/aports/main/musl/src/musl-1.2.5.7', ('musl', '1.2.5.7')), | |
| 570 | 570 | (b'libc.musl.so.1', ('musl', '1')), | |
| 571 | 571 | (b'libc.musl-x86_64.so.1.2.5', ('musl', '1.2.5')), | |
| 572 | + (b'ld-musl.so.1', ('musl', '1')), | ||
| 573 | + (b'ld-musl-x86_64.so.1.2.5', ('musl', '1.2.5')), | ||
| 572 | 574 | (b'', ('', '')), | |
| 573 | 575 | ): | |
| 574 | 576 | with open(filename, 'wb') as fp: | |
@@ -591,6 +593,10 @@ def test_libc_ver(self): | |||
| 591 | 593 | b'libc.musl-x86_64.so.1.4.1\0libc.musl-x86_64.so.2.1.1\0libc.musl-x86_64.so.2.0.1', | |
| 592 | 594 | ('musl', '2.1.1'), | |
| 593 | 595 | ), | |
| 596 | + ( | ||
| 597 | + b'ld-musl-x86_64.so.1.4.1\0ld-musl-x86_64.so.2.1.1\0ld-musl-x86_64.so.2.0.1', | ||
| 598 | + ('musl', '2.1.1'), | ||
| 599 | + ), | ||
| 594 | 600 | (b'no match here, so defaults are used', ('test', '100.1.0')), | |
| 595 | 601 | ): | |
| 596 | 602 | with open(filename, 'wb') as f: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -798,10 +798,10 @@ def test_linked_to_musl(self): | |||
| 798 | 798 | self.assertTrue(linked) | |
| 799 | 799 | # The value is cached, so make sure it returns the same value again. | |
| 800 | 800 | self.assertIs(linked, support.linked_to_musl()) | |
| 801 | - # The unlike libc, the musl version is a triple. | ||
| 801 | + # The musl version is either triple or just a major version number. | ||
| 802 | 802 | if linked: | |
| 803 | 803 | self.assertIsInstance(linked, tuple) | |
| 804 | - self.assertEqual(3, len(linked)) | ||
| 804 | + self.assertIn(len(linked), (1, 3)) | ||
| 805 | 805 | for v in linked: | |
| 806 | 806 | self.assertIsInstance(v, int) | |
| 807 | 807 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + Fix musl version detection on Void Linux. | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments