From 82df70eff06e7b44ee84283070d7f801f7fc1d92 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sat, 6 Nov 2021 20:25:45 -0400 Subject: initial commit --- .local/bin/who-depends | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 .local/bin/who-depends (limited to '.local/bin/who-depends') diff --git a/.local/bin/who-depends b/.local/bin/who-depends new file mode 100755 index 0000000..d1fb0c2 --- /dev/null +++ b/.local/bin/who-depends @@ -0,0 +1,13 @@ +#!/bin/sh + +# Script that takes a package as an argument and returns installed packages +# that are dependent on it + +[ $# -eq 1 ] || echo "usage: who-depends package" +apt list --installed | tail -n+2 | cut -d '/' -f 1 > /tmp/whodepends +pkg="$1" +deps_all=$(apt-cache rdepends $pkg | tail -n+3 | sed "s/^\s*//") +for dep in $deps_all +do + grep -lq "$dep" /tmp/whodepends && echo "$dep" +done -- cgit v1.2.3