| OLD | NEW |
| 1 #! /bin/sh | 1 #! /bin/sh |
| 2 | 2 |
| 3 config=$1 | 3 config=$1 |
| 4 | 4 |
| 5 die(){ | 5 die(){ |
| 6 echo "$@" | 6 echo "$@" |
| 7 exit 1 | 7 exit 1 |
| 8 } | 8 } |
| 9 | 9 |
| 10 test -r "$config" || die "usage: fate.sh <config>" | 10 test -r "$config" || die "usage: fate.sh <config>" |
| 11 | 11 |
| 12 workdir=$(dirname $config) | 12 workdir=$(cd $(dirname $config) && pwd) |
| 13 make=make | 13 make=make |
| 14 tar='tar c' | 14 tar='tar c' |
| 15 | 15 |
| 16 . "$config" | 16 . "$config" |
| 17 | 17 |
| 18 test -n "$slot" || die "slot not specified" | 18 test -n "$slot" || die "slot not specified" |
| 19 test -n "$repo" || die "repo not specified" | 19 test -n "$repo" || die "repo not specified" |
| 20 test -d "$samples" || die "samples location not specified" | 20 test -d "$samples" || die "samples location not specified" |
| 21 | 21 |
| 22 lock(){ | 22 lock(){ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 git:*) git pull ;; | 39 git:*) git pull ;; |
| 40 svn:*) svn up ;; | 40 svn:*) svn up ;; |
| 41 esac | 41 esac |
| 42 ) | 42 ) |
| 43 | 43 |
| 44 configure()( | 44 configure()( |
| 45 cd ${build} || return | 45 cd ${build} || return |
| 46 ${src}/configure \ | 46 ${src}/configure \ |
| 47 --prefix="${inst}" \ | 47 --prefix="${inst}" \ |
| 48 --samples="${samples}" \ | 48 --samples="${samples}" \ |
| 49 --enable-gpl \ |
| 49 ${arch:+--arch=$arch} \ | 50 ${arch:+--arch=$arch} \ |
| 50 ${cpu:+--cpu="$cpu"} \ | 51 ${cpu:+--cpu="$cpu"} \ |
| 51 ${cross_prefix:+--cross-prefix="$cross_prefix"} \ | 52 ${cross_prefix:+--cross-prefix="$cross_prefix"} \ |
| 52 ${cc:+--cc="$cc"} \ | 53 ${cc:+--cc="$cc"} \ |
| 53 ${target_os:+--target-os="$target_os"} \ | 54 ${target_os:+--target-os="$target_os"} \ |
| 54 ${sysroot:+--sysroot="$sysroot"} \ | 55 ${sysroot:+--sysroot="$sysroot"} \ |
| 55 ${target_exec:+--target-exec="$target_exec"} \ | 56 ${target_exec:+--target-exec="$target_exec"} \ |
| 56 ${target_path:+--target-path="$target_path"} \ | 57 ${target_path:+--target-path="$target_path"} \ |
| 57 ${extra_cflags:+--extra-cflags="$extra_cflags"} \ | 58 ${extra_cflags:+--extra-cflags="$extra_cflags"} \ |
| 58 ${extra_ldflags:+--extra-ldflags="$extra_ldflags"} \ | 59 ${extra_ldflags:+--extra-ldflags="$extra_ldflags"} \ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 87 exit | 88 exit |
| 88 } | 89 } |
| 89 | 90 |
| 90 mkdir -p ${workdir} || die "Error creating ${workdir}" | 91 mkdir -p ${workdir} || die "Error creating ${workdir}" |
| 91 lock ${workdir} || die "${workdir} locked" | 92 lock ${workdir} || die "${workdir} locked" |
| 92 cd ${workdir} || die "cd ${workdir} failed" | 93 cd ${workdir} || die "cd ${workdir} failed" |
| 93 | 94 |
| 94 src=${workdir}/src | 95 src=${workdir}/src |
| 95 build=${workdir}/build | 96 build=${workdir}/build |
| 96 inst=${workdir}/install | 97 inst=${workdir}/install |
| 97 report=tests/data/fate/report | |
| 98 | 98 |
| 99 test -d "$src" && update || checkout || die "Error fetching source" | 99 test -d "$src" && update || checkout || die "Error fetching source" |
| 100 | 100 |
| 101 cd ${workdir} | 101 cd ${workdir} |
| 102 | 102 |
| 103 version=$(${src}/version.sh ${src}) | 103 version=$(${src}/version.sh ${src}) |
| 104 test "$version" = "$(cat version 2>/dev/null)" && exit 0 | 104 test "$version" = "$(cat version-$slot 2>/dev/null)" && exit 0 |
| 105 echo ${version} >version | 105 echo ${version} >version-$slot |
| 106 | 106 |
| 107 rm -rf "${build}" | 107 rm -rf "${build}" *.log |
| 108 mkdir -p ${build} | 108 mkdir -p ${build} |
| 109 | 109 |
| 110 configure >configure.log 2>&1 || fail $? "error configuring" | 110 configure >configure.log 2>&1 || fail $? "error configuring" |
| 111 compile >compile.log 2>&1 || fail $? "error compiling" | 111 compile >compile.log 2>&1 || fail $? "error compiling" |
| 112 fate >test.log 2>&1 || fail $? "error testing" | 112 fate >test.log 2>&1 || fail $? "error testing" |
| 113 report 0 success | 113 report 0 success |
| 114 clean | 114 clean |
| OLD | NEW |