emmett1 / lfs-scripts

Automated script to build Multilib LFS system + livecd
GNU General Public License v3.0
98 stars 46 forks source link

Simple script for checking libraries #27

Open hyperclock opened 3 years ago

hyperclock commented 3 years ago

Here's a simple script I use to see if and where libgmp, libmpfr, libmpc, libxml2, libnettle & libzstd are installed. Also checks the python version.

create a file, I call it lib-check.sh and add this:

#!/bin/bash

# Check for some present, absent or missing libraries:
echo -e "\nThe (.la) and (.so) files identified by this script"
echo -e "\n should be all present or all absent,"
echo -e "\n but not only one or two present:"

echo ""
echo -e "\n###################################"
echo -e "\n### CHECKING THE (.la) FILES... ###"
echo -e "\n###################################"
sleep 1s
for lib in lib{gmp,mpfr,mpc,xml2,nettle,zstd}.la; do
  echo $lib: $(if find /usr/lib* -name $lib|
               grep -q $lib;then :;else echo not;fi) found:  /usr/lib* was searched. 
done
unset lib

echo ""
echo -e "\n###################################"
echo -e "\n### CHECKING THE (.so) FILES... ###"
echo -e "\n###################################"
sleep 1s
for lib in lib{gmp,mpfr,mpc,xml2,nettle,zstd}.so*; do
  echo $lib: $(if find /usr/lib* -name $lib|
               grep -q $lib;then :;else echo not;fi) found:  /usr/lib* was searched. 
done
unset lib

echo ""
echo -e "\n##################################"
echo -e "\n### CHECKING PYTHON VERSION... ###"
echo -e "\n##################################"
sleep 1s
python --version | head -n1

python3 --version | head -n1

echo ""
echo ""

then make it executable chmod a+x lib-check.sh

Not a pretty script, but works for me.