Comments (6)
Comment:
This is to be used in combination with xbps-query --fulldeptree -Rx <pkgname>
.
Now, you don't need to wonder any longer what the dependency chain is! ;-)
from xtools.
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).
from xtools.
Happy to hear!
This is an improved version by feranur
:
#!/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
from xtools.
prototype:
xbps-dgraph mesa -f | gvpr '
BEGIN {
node_t stack[int];
int depth = 0;
void traverse(node_t n, edge_t e) {
stack[depth++] = n;
if (n.label == "ncurses-libs-6.4_2") {
int i;
for (i = 0; i < depth; i++) {
printf("%s", stack[i].label);
if (i < depth-1)
printf(" -> ");
}
printf("\n");
}
e = fstout(n);
while (e != NULL) {
traverse(e.head, NULL);
if (e == NULL)
break;
e = nxtout(e);
}
depth--;
}
}
BEG_G {
traverse(node($,"31"), NULL);
}
'
from xtools.
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.
from xtools.
Here is one with one or two arguments: https://l2.re/gmGaDF
from xtools.
Related Issues (20)
- xtools.1 breaks apropos output HOT 1
- xetcchanges lists files not modified HOT 3
- cannot pass arguments to `xq`
- xcheckrestart reports random stuff? HOT 6
- xlint: check for `-D$opt=$(vopt_if $opt true false)` instead of `$(vopt_bool $opt)`
- xnew <URL> shouldn't replace $pkgname in $distfiles HOT 2
- Silence vopt_if etc. spam for all scripts sourcing template
- helix support for xnew HOT 2
- [idea] xsi HOT 2
- xlint: remove trailing whitespace HOT 4
- xbloat: Script to find packages with a lot of dependencies HOT 3
- xlint: check if desc_option_<optname> is already covered by options.description
- xrevshlib: add option to consider only given package/subpackage
- xlint: lint update files too HOT 2
- xcheckrestart: reports docker/podman processes HOT 1
- xlint: add lint for `${pkgname}` in subpackage's `depends` (should use `${sourcepkg}` instead)
- bougus ask to update database even though its not outdated HOT 5
- Add Fish completions HOT 2
- `xbump` thinks that subpackage with + in its name is not a subpackage HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xtools.