diff options
author | Mark Ferrell <major@homeonderanged.org> | 2014-04-08 09:23:25 -0700 |
---|---|---|
committer | Mark Ferrell <major@homeonderanged.org> | 2014-04-08 09:29:58 -0700 |
commit | a985643421cbf2fe12e51d593749424d43b52cdc (patch) | |
tree | e8fc44d1bd182548710d8170a79dd0c68ffdf851 | |
parent | 89b051323f6c46335c5f8c8e1f5d0837f7fabb92 (diff) |
Better handling of '*/all' and 'all'
-rwxr-xr-x | libexec/build-make | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libexec/build-make b/libexec/build-make index 07c2634..3b07545 100755 --- a/libexec/build-make +++ b/libexec/build-make @@ -30,11 +30,15 @@ done # If no target is given, then base our target on the current working directory, # falling back to "${PROJECT}/all" as our default. if test "$#" -eq '0'; then + case "${BUILDER_MAKE_ACTION}" in + (*clean) NAME='all/all';; + (*) NAME="${TARGET}";; + esac + # Are we somewhere within the pkg structure. If this test succeeds # then we are at least in a category directory within the pkgdir. Just # being in pkgdir is not enough to change our default argument list # handling. - NAME="${TARGET}" if [ "${PWD##${BUILDER_PKGDIR}/}" != "${PWD}" ]; then category="${PWD##${BUILDER_PKGDIR}/}" if [ "${category%%/*}" != "${category}" ]; then @@ -55,19 +59,16 @@ for package in "$@"; do # If all is specified anywhere in the argument list than just discard # everything else. case "${package}" in - (-*|all) continue;; + (-*|*/all|all) continue;; esac - # FIXME we need a resolver for things like all/all and <category>/all CATEGORY="${package%%/*}" if [ "${CATEGORY}" != 'all' ]; then if [ ! -d "${BUILDER_PKGDIR}/${CATEGORY}" ]; then die "invalid package category '${CATEGORY}'" fi - if [ "${package##*/}" != "all" ]; then - if ! build-query --exists "${package}"; then - exit 1 - fi + if ! build-query --exists "${package}"; then + exit 1 fi fi done @@ -90,7 +91,7 @@ export BUILDER_MAKEFILE packages= for package in "$@"; do case "${package}" in - (*/all);; + (all|*/all);; (*) package="$(build-query --pkgname "${package}")";; esac package="$(echo "${package}"|tr '/-' '__')" |