From: W. Trevor King Date: Wed, 29 Jan 2014 20:31:26 +0000 (-0800) Subject: build.sh: Add [--help] {build|missing} support X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3cce8b79a317b5b71da55a8af46c7ba00e9d9538;p=dockerfile.git build.sh: Add [--help] {build|missing} support The 'missing' command show which repos remain unbuilt. I use this to setup the REPOS environtment variable for subsequent build calls, if on of the repos is giving me trouble. --- diff --git a/build.sh b/build.sh index ecb77b6..78eb33b 100755 --- a/build.sh +++ b/build.sh @@ -199,10 +199,31 @@ build_repo() "${DOCKER}" tag -f "${NAMESPACE}/${REPO}:${DATE}" "${NAMESPACE}/${REPO}:latest" || die "failed to tag" } -import_stage3 -import_portage -extract_busybox +build() +{ + import_stage3 + import_portage + extract_busybox + + for REPO in ${REPOS}; do + build_repo "${REPO}" + done +} + +missing() +{ + for REPO in gentoo portage-import ${REPOS}; do + if ! repo_exists "${REPO}"; then + msg "${REPO}" + fi + done +} + +ACTION="${1:-build}" -for REPO in ${REPOS}; do - build_repo "${REPO}" -done +case "${ACTION}" in +build) build ;; +missing) missing ;; +--help) msg "usage: ${0} [--help] {build|missing}" ;; +*) die "invalid action '${ACTION}'" ;; +esac