From 3e61a1e9cce6969a351a86a7a057b69d77325ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Wed, 26 Aug 2015 17:59:45 -0300 Subject: port db-repo-add from xbs and fix db-init --- src/bin/db-init | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/bin/db-init') diff --git a/src/bin/db-init b/src/bin/db-init index e63bf5a..37ad299 100755 --- a/src/bin/db-init +++ b/src/bin/db-init @@ -3,13 +3,19 @@ CONFIG_DIR="$(dirname "$(readlink -e "$0")")/etc" -source "${CONFIG_DIR}"/dbscripts{.d/{db-functions,main},}.cfg +source "${CONFIG_DIR}/dbscripts.d/db-functions.cfg" +source "${CONFIG_DIR}/dbscripts.d/main.cfg" +source "${CONFIG_DIR}/dbscripts.cfg" -db-init-usage() { - msg "Usage: %s [platform1 platform2 ... platformX]" "${0##*/}" +db-init_usage() { + msg "usage: %s [platform1 platform2 ... platformX]" "${0##*/}" exit 1 } +db-init_run() { + mkdir -p -- "${REPO_DIR}"/{"${PKG_MAIN_POOLS}","${SRC_MAIN_POOLS}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" +} + for 'platform' in "${PLATFORMS[@]}"; do if [ -n $1 ]; then for '_platform' in "$@"; do @@ -19,7 +25,7 @@ for 'platform' in "${PLATFORMS[@]}"; do if [ "${_platform_name}" == "${platform}" ]; then source "${CONFIG_DIR}/dbscripts.d/${_platform_name}.cfg" - mkdir -p -- "${REPO_DIR}"/{"${PKG_MAIN_POOLS}","${SRC_MAIN_POOLS}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + db-init_run else db-init-usage fi @@ -27,8 +33,8 @@ for 'platform' in "${PLATFORMS[@]}"; do else source "${CONFIG_DIR}/dbscripts.d/${platform}.cfg" - mkdir -p -- "${REPO_DIR}"/{"${PKG_MAIN_POOLS}","${SRC_MAIN_POOLS}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + db-init_run fi done -# "$(dirname "$(readlink -e "$0")")/db-repo-add" -p "${_platform}" "${PKG_REPOS[@]}" +# "${BIN_DIR}/db-repo-add" -p "${_platform}" "${PKG_REPOS[@]}" -- cgit v1.2.3-2-g168b