summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2010-09-24 18:53:11 +0200
committerDiego Elio Pettenò <flameeyes@gmail.com>2010-09-24 18:53:11 +0200
commit4bb78cbf899358ec57450d19a02fff45efe85924 (patch)
tree573769022280174a742bc318ff41937cde8ffe0e
parentUse long options for emerge to be more verbose in the script. (diff)
downloadflameeyes-tinderbox-4bb78cbf899358ec57450d19a02fff45efe85924.tar.gz
flameeyes-tinderbox-4bb78cbf899358ec57450d19a02fff45efe85924.tar.bz2
flameeyes-tinderbox-4bb78cbf899358ec57450d19a02fff45efe85924.zip
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.
-rwxr-xr-xfetch-reverse-deps.sh41
1 files 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