WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Script for checking dependencies  (Read 232 times)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10418
Script for checking dependencies
« on: December 17, 2022, 10:42:12 PM »
This script checks which libraries a binary is linked to and checks which
extensions provide them. It then creates a .dep file that contains the
minimum list of extensions required to satisfy that requirement:
Code: [Select]
tc@E310:~/Scripting/LddCheck$ ./LddCheck.sh $(which mc)
Created dependency file 10.x-x86/Result.dep
tc@E310:~/Scripting/LddCheck$ cat 10.x-x86/Result.dep

If I check the same binary against the 13.x repo:
Code: [Select]
tc@E310:~/Scripting/LddCheck$ ./LddCheck.sh -TC=13.x $(which mc)
Created dependency file 13.x-x86/Result.dep
tc@E310:~/Scripting/LddCheck$ cat 13.x-x86/Result.dep
an extra dependency (libgcrypt.tcz) shows up because libssh2.tcz,dep no
longer includes it.

This is the help message:
Code: [Select]
Script to build a dependency file for an executables or libraries.
 It will find which extensions contain the libraries the executable
 requires and create a minimal list that satisfies that requirement.
 This will only pick up linked in library.so files. Optional libraries
 are not linked in and won't show up. Neither will icons and modules.

 Usage: (Path/To/Executable must be the last entry in the command)
        ./LddCheck.sh [ -TC= ][ -ARCH= ] Path/To/Executable

        ./LddCheck.sh -ARCH=x86 -TC=10.x /usr/local/bin/ffplay
        ./LddCheck.sh -ARCH=x86_64 -TC=13.x $(which mpg123)

 Optional Arguments:
        -TC=    Override which version of TC to use.
        -ARCH=  Override which architecture to use.
                Valid values x86  x86_64  armv6  armv7  armv7l  aarch64
        -ADDR=  Override which mirror to use.

 Current values in this script are:
        TC=10.x  ARCH=x86  ADDR=http://repo.tinycorelinux.net

The values for  TC,  ARCH, and  ADDR  are set near the beginning of the
script if you wish to change their default values. As the help message
shows, you can also override any of those values from the command line.