-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xdeptree: List dependencies of package (or find closest link) #314
Comments
Comment: Now, you don't need to wonder any longer what the dependency chain is! ;-) |
I think the tool is useful, not sure about the implementation however. Perhaps the output of xbps-dgraph -f is more suitable to work on, perhaps even with gvpr(1). |
Happy to hear! This is an improved version by #!/bin/sh
set -eu
tmp="`mktemp -d`"
trap 'rm -rf "$tmp"' EXIT
trap 'exit 98' INT TERM HUP ALRM PIPE QUIT # ensure the EXIT trap is triggered on signals
tree="${tmp}/tree"
store="${tmp}/store"
test $# -ge 1
mkdir "${tree}" "${store}"
cd "${tree}"
handle() {
deps=$(xbps-query -Rx "${1}")
for d in ${deps:-} ; do
d=$(xbps-uhelper getpkgdepname "${d}" || xbps-uhelper getpkgname "$d")
test -n "${d:-}" || exit 99
if ! test -e "${store}/${d}"; then
mkdir "${d}"
ln -s "${PWD}/${d}" "${store}/${d}"
( cd "${d}"; handle "${d}"; )
else
ln -s "${store}/${d}" "${d}"
fi
done
}
handle "${1}"
if test -n "${2:-}" ; then
find . -name "${2}" -printf '%d %P\n' | sort -n | sed -E 's/^[0-9]+ //'
else
find . -mindepth 1 -printf '%P\n' | sort
fi |
prototype:
|
Nice, that one is quite fast. If you could now manage to show all dependencies in a tree I guess we can use that one instead of mine. |
Here is one with one or two arguments: https://l2.re/gmGaDF |
Script to either show a full dependency tree of a package or find the closest link between two dependencies.
Example:
This shows that ncurses-libs gets pulled in by libllvm15 and that's why it's a dependency of mesa-dri.
Another Example:
A third one (print the whole tree)
The text was updated successfully, but these errors were encountered: