From 4bb78cbf899358ec57450d19a02fff45efe85924 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Fri, 24 Sep 2010 18:53:11 +0200 Subject: Rewrite the revdeps fetching script. The new script allows to set the DEPTH variable to execute recursive revdeps resolution, useful for gtk+ and glib packages for instance. --- fetch-reverse-deps.sh | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/fetch-reverse-deps.sh b/fetch-reverse-deps.sh index cb3a16c..d71b529 100755 --- a/fetch-reverse-deps.sh +++ b/fetch-reverse-deps.sh @@ -15,13 +15,34 @@ # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS # SOFTWARE. -( - source /etc/make.tinderbox.private.conf - for atom in $@; do - curl --fail ${TINDERBOX_PROXY+--proxy ${TINDERBOX_PROXY}} http://tinderbox.dev.gentoo.org/misc/{r,d}index/${atom} - done -) | egrep -v '^\[B\]' | sort -u | \ - xargs -n1 qatom | \ - cut -d ' ' -f 1-2 | \ - tr ' ' '/' | \ - uniq +DEPTH=${DEPTH:-1} + +script="$0" + +source /etc/make.tinderbox.private.conf + +fetchrevdeps() { + curl --fail ${TINDERBOX_PROXY+--proxy ${TINDERBOX_PROXY}} http://tinderbox.dev.gentoo.org/misc/{r,d}index/$1 2>/dev/null +} + +filterrevdeps() { + egrep -v '^\[B\]' | sort -u | \ + xargs -r -n1 qatom | \ + cut -d ' ' -f 1-2 | \ + tr ' ' '/' | \ + uniq | tee +} + +moreornot() { + if [ ${DEPTH} -gt 1 ]; then + DEPTH=$((${DEPTH}-1)) + xargs "$script" + else + cat - + fi +} + +for atom in "$@"; do + echo $atom + fetchrevdeps $atom +done | filterrevdeps | moreornot -- cgit v1.2.3-65-gdbad