Skip to content

Instantly share code, notes, and snippets.

@bashkirtsevich
Last active July 14, 2020 18:26
Show Gist options
  • Save bashkirtsevich/2c589044a348a693436d7c2c043ce6d0 to your computer and use it in GitHub Desktop.
Save bashkirtsevich/2c589044a348a693436d7c2c043ce6d0 to your computer and use it in GitHub Desktop.
Copy libs
#!/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