diff options
author | Michał Masłowski <mtjm@mtjm.eu> | 2012-02-18 14:44:22 +0100 |
---|---|---|
committer | Michał Masłowski <mtjm@mtjm.eu> | 2012-02-18 14:44:22 +0100 |
commit | 54b6cb03b60d1834130fa289188e9f232fab5898 (patch) | |
tree | b0d04247e136d84e2be01eea91d44d00c68d174e | |
parent | ef12ca293c2a85fde729c39900fa2d481c8b42da (diff) |
Show a useful error message if a dependency is not found.
Should stop the build, somehow doesn't.
-rwxr-xr-x | fullpkg-find | 16 | ||||
-rwxr-xr-x | toru | 3 |
2 files changed, 6 insertions, 13 deletions
diff --git a/fullpkg-find b/fullpkg-find index 8c0c063..e38014e 100755 --- a/fullpkg-find +++ b/fullpkg-find @@ -80,17 +80,16 @@ find_deps() { local found=false # TODO change for where_is or toru-path - local pkgdir=$(toru -p ${_dep}) + local pkgdir=$(toru -p ${_dep} \ + || error "dependency %s of %s not found" "${_dep}" "${pkgbase}" \ + && exit 1) if [ -n "$pkgdir" -a -d "${pkgdir}" ]; then found=true pushd "${pkgdir}" > /dev/null # runs itself on dep's PKGBUILD dir - $0 -l ${next_level} ${build_dir} - -# probable circular deps - [ $? -eq 20 ] && return 20 + $0 -l ${next_level} ${build_dir} || return $? popd > /dev/null fi @@ -188,13 +187,8 @@ fi find_deps || { # Probable circular deps - if [ "$?" -eq 20 ]; then - -# Show error only on level 0 - if [ "$LEVEL" -eq 0 ]; then + if [ "$?" -eq 20 -a "$LEVEL" -eq 0 ]; then error "Check for circular deps on $build_dir/BUILDORDER"; - fi - fi # Pass message 20 exit 20 @@ -297,8 +297,7 @@ while getopts 'haqfpum' arg; do f) force=true ;; u) commands+=(update);; p) shift $(( OPTIND - 1 )) - where_is "$1" - exit $?;; + where_is "$1" || exit 1;; m) commands+=(missing);; esac |