Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5fa256434e
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 49 lines (38 sloc) 0.945 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/bin/bash

# parse args

be_verbose=
dump_errors=
get_opt() {
    local result=0
    case "$1" in
        --verbose) be_verbose=yes ;;
        --dump-errors) dump_errors=yes ;;
        --) result=1 ;;
        --) echo "WARN: unknown option '$1'"; result=1 ;;
        *) result=1 ;;
    esac

return $result
}

v() { [[ -n $be_verbose ]] && echo "$@"; }

while get_opt "$1"; do
shift
done

[[ -z $1 ]] && {
    echo "usage: $0 [--verbose] [--dump-errors] <ebuild-tree>..."
    exit 1
}

# real work

errors_file=$(mktemp)
for ebuild_tree in "$@"; do

find "$ebuild_tree" -type f -name '*.ebuild' | while read e
    do
v "TEST: $e"
        ebuild "$e" clean

        NO_GITIFY=yes FEATURES=noauto \
        ebuild "$e" fetch unpack prepare \
             >"$errors_file" 2>&1 \
          || { echo "FAILED: $e"; [[ -n $dump_errors ]] && cat "$errors_file"; }
        ebuild "$e" clean
    done
done
rm -f "$errors_file"
Something went wrong with that request. Please try again.