mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-24 16:10:05 -07:00
kiss: cleanup fixdeps
This commit is contained in:
parent
dd37c86f71
commit
6f426a1149
24
kiss
24
kiss
@ -412,25 +412,19 @@ pkg_fixdeps() {
|
||||
|
||||
pkg_name=$1
|
||||
|
||||
# Go to the built package directory to simplify path building.
|
||||
cd "$pkg_dir/$1/$pkg_db/$1"
|
||||
|
||||
# Generate a list of all installed manifests.
|
||||
set +f
|
||||
set -f -- "$sys_db/"*/manifest
|
||||
|
||||
# Create the depends file if it doesn't exist to have something to
|
||||
# compare against (even if empty). We will remove this blank file
|
||||
# later if needed.
|
||||
: >> depends
|
||||
|
||||
# Get a list of binaries and libraries, false files will be found,
|
||||
# however it's faster to get 'ldd' to check them anyway than to filter
|
||||
# them out.
|
||||
find "$pkg_dir/${PWD##*/}/" -type f 2>/dev/null |
|
||||
|
||||
while read -r file; do
|
||||
ldd "$file" 2>/dev/null | while read -r _ _ dep _; do
|
||||
ldd "$file" 2>/dev/null |
|
||||
|
||||
while read -r _ _ dep _; do
|
||||
# Resolve path symlinks to find the real location to the library.
|
||||
cd -P "${dep%/*}" 2>/dev/null || continue
|
||||
|
||||
@ -453,8 +447,8 @@ pkg_fixdeps() {
|
||||
dep=${dep%/*}
|
||||
dep=${dep##*/}
|
||||
|
||||
# Skip listing some packages as dependencies.
|
||||
case $dep in
|
||||
# Skip listing these packages as dependencies.
|
||||
gcc |\
|
||||
llvm |\
|
||||
"${pkg_name%%-bin}" |\
|
||||
@ -464,23 +458,19 @@ pkg_fixdeps() {
|
||||
continue
|
||||
;;
|
||||
|
||||
|
||||
*) printf '%s\n' "$dep"
|
||||
*)
|
||||
printf '%s\n' "$dep"
|
||||
;;
|
||||
esac
|
||||
done ||:
|
||||
done |
|
||||
|
||||
sort -uk1,1 depends - > "$mak_dir/d"
|
||||
|
||||
# Display a 'diff' of the new dependencies against the old ones.
|
||||
diff -U 3 depends - < "$mak_dir/d" ||:
|
||||
|
||||
# Swap out the old depends file for the new one which contains
|
||||
# an amended dependency list.
|
||||
mv -f "$mak_dir/d" depends
|
||||
|
||||
# Remove the package's depends file if it's empty. (The package has
|
||||
# no dependencies, automatically detected or otherwise).
|
||||
[ -s depends ] || rm -f depends
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user