diff options
author | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 17:59:45 -0300 |
---|---|---|
committer | coadde [Márcio Alexandre Silva Delgado] <coadde@parabola.nu> | 2015-08-26 17:59:45 -0300 |
commit | 3e61a1e9cce6969a351a86a7a057b69d77325ffc (patch) | |
tree | 6915cd4d6ff0bcc8b887ae3334ddcc7531dfb876 /src/bin/db-init | |
parent | 2dd7ba09177bf279d6517329439d7531982de25c (diff) |
port db-repo-add from xbs and fix db-init
Diffstat (limited to 'src/bin/db-init')
-rwxr-xr-x | src/bin/db-init | 18 |
1 files changed, 12 insertions, 6 deletions
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[@]}" |