21 lines
427 B
Python
21 lines
427 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
import sys
|
|
import re
|
|
|
|
|
|
_match = re.compile("^(?P<path>.*/[^.]*)\\.[0-9]*\\.so$")
|
|
|
|
|
|
def link_when_match(path):
|
|
tmp = _match.match(path)
|
|
if tmp:
|
|
tmp = tmp.groupdict()
|
|
os.symlink(path, tmp["path"] + ".so")
|
|
print("Link: " + tmp["path"] + ".so")
|
|
|
|
|
|
if __name__ == '__main__':
|
|
for i in os.listdir(sys.argv[1]):
|
|
link_when_match(os.path.join(sys.argv[1], i))
|