Skip to content
Newer
Older
100755 49 lines (38 sloc) 945 Bytes
a63cea8 @trofi Initial commit.
authored Mar 17, 2012
1 #!/bin/bash
2
3 # parse args
4
5 be_verbose=
6 dump_errors=
7 get_opt() {
8 local result=0
9 case "$1" in
10 --verbose) be_verbose=yes ;;
11 --dump-errors) dump_errors=yes ;;
12 --) result=1 ;;
13 --) echo "WARN: unknown option '$1'"; result=1 ;;
14 *) result=1 ;;
15 esac
16
17 return $result
18 }
19
20 v() { [[ -n $be_verbose ]] && echo "$@"; }
21
22 while get_opt "$1"; do
23 shift
24 done
25
26 [[ -z $1 ]] && {
27 echo "usage: $0 [--verbose] [--dump-errors] <ebuild-tree>..."
28 exit 1
29 }
30
31 # real work
32
33 errors_file=$(mktemp)
34 for ebuild_tree in "$@"; do
35
36 find "$ebuild_tree" -type f -name '*.ebuild' | while read e
37 do
38 v "TEST: $e"
39 ebuild "$e" clean
40
41 NO_GITIFY=yes FEATURES=noauto \
42 ebuild "$e" fetch unpack prepare \
43 >"$errors_file" 2>&1 \
44 || { echo "FAILED: $e"; [[ -n $dump_errors ]] && cat "$errors_file"; }
45 ebuild "$e" clean
46 done
47 done
48 rm -f "$errors_file"
Something went wrong with that request. Please try again.