From 6f426a11497e885f729a5b89749dedec0b3c8b71 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Mon, 14 Sep 2020 20:32:42 +0300 Subject: [PATCH] kiss: cleanup fixdeps --- kiss | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/kiss b/kiss index a7fee82..9602ee3 100755 --- a/kiss +++ b/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,34 +447,30 @@ 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}" |\ "${pkg_name%%-esr}" |\ "${pkg_name%%-esr-bin}" |\ "") - continue + 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 }