From 4d57e0a8dab2139a631a21aab862487481548702 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 22:32:59 +0200 Subject: Adding upstream version 2.23.7. Signed-off-by: Daniel Baumann --- scripts/whodepends.sh | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100755 scripts/whodepends.sh (limited to 'scripts/whodepends.sh') diff --git a/scripts/whodepends.sh b/scripts/whodepends.sh new file mode 100755 index 0000000..e0b6441 --- /dev/null +++ b/scripts/whodepends.sh @@ -0,0 +1,56 @@ +#!/bin/bash +# whodepends - show maintainers a package depends upon +# by Moshe Zadka and +# modified by Joshua Kwan +# This script is in the public domain. + +set -e + +PROGNAME=${0##*/} + +usage() { + cat <, and is in the public domain. +EOF +} + +if [ -z "$1" ]; then + usage + exit 1 +fi + +while [ -n "$1" ]; do + case "$1" in + -s | --source) source=true ;; + -h | --help) usage; exit 0 ;; + --version) version; exit 0 ;; + *) + echo "Dependent maintainers for $1:" + for package in $(apt-cache showpkg $1 | sed -n '/Reverse Depends:/,/Dependencies/p' | grep '^ '|sed 's/,.*//'); do + if [ $source ]; then + apt-cache showsrc $package | + awk '/^Maintainer:/ {maint=$0} /^Package:/ {pkg=$0} END {print maint, pkg}' | + sed 's/Maintainer: //;s/Package: //' + else + apt-cache show $package | + awk '/^Maintainer:/ {maint=$0} END {print maint, "'$package'"}' | + sed 's/Maintainer: //' + fi + done | sort -u | awk -F'>' '{ pack[$1]=pack[$1] $2 } END {for (val in pack) print val ">", "(" pack[val] ")"}' | sed 's/( /(/' + echo + ;; + esac + shift +done -- cgit v1.2.3