Last active
July 14, 2020 18:26
-
-
Save bashkirtsevich/2c589044a348a693436d7c2c043ce6d0 to your computer and use it in GitHub Desktop.
Copy libs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
libs=$(./lddtree -l $1 | grep -E "\.so$|\.so\..+$") | |
# find /usr/local/lib/python3.8/ \( -iname "*.so" -o -iname "*.so.*" \) -exec sh -c '~/lddtree -l {} | grep -E "\.so$|\.so\..+$" | grep -v "lib/python3.8/"' \; | sort -u | |
mkdir libs | |
for lib in $libs | |
do | |
real_path=$(readlink -f $lib) | |
cp $real_path libs/ | |
echo "Copy $(basename $real_path) to /libs" | |
if [[ $real_path != $lib ]]; | |
then | |
real_name=$(basename $real_path) | |
link_name=$(basename $lib) | |
ln -s $real_name libs/$link_name | |
echo "Create symlink $real_name => $link_name" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment