Advertising
- MacPorts recursive dependency re
- Tuesday, July 15th, 2008 at 5:47:36pm MDT
- #!/bin/bash
- #
- # Outputs dependencies for MacPorts recursivly, each port and its dependencies
- # in a separate line.
- #
- # Usage: ./deepdeps.sh <portname>
- #
- # (c) Thomas Keller <me@thomaskeller.biz>
- #
- # Licensed under GPLv3
- #
- if [ -z "$1" ]; then
- echo "No argument given"
- exit 1
- fi
- declare -a processed_deps
- function getDeps {
- processed_deps[${#processed_deps[*]}]=$i
- deps=`port deps $1 | egrep -v "^$1" | cut -f 2 | sort | uniq`
- if [[ -z "$deps" ]]; then
- echo "$(tput setaf 1)$1:$(tput setaf 9) none"
- return
- fi
- echo "$(tput setaf 1)$1:$(tput setaf 9) ${deps//
- / }"
- for i in $deps
- do
- j=0
- while [ "$j" -lt "${#processed_deps[*]}" ]
- do
- if [ "$i" = "${processed_deps[$j]}" ]; then
- return
- fi
- let "j = $j + 1"
- done
- getDeps $i;
- done
- }
- getDeps $1
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.