diff options
Diffstat (limited to 'extra/coadde/createrepos')
-rwxr-xr-x | extra/coadde/createrepos | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/extra/coadde/createrepos b/extra/coadde/createrepos new file mode 100755 index 0000000..4416196 --- /dev/null +++ b/extra/coadde/createrepos @@ -0,0 +1,36 @@ +#!/bin/bash +# Creates the repo structure defined in config + +source "$(dirname "$(readlink -e "$0")")/config_platforms" +source "$(dirname "$(readlink -e "$0")")/db-functions" + +createrepos-usage() { + msg "Usage: %s [platform1 platform2 ... platformX]" "${0##*/}" + exit 1 +} + +for 'platform' in "${PLATFORMS[@]}"; do + if [ -n $1 ]; then + for '_platform' in "$@"; do + # Rename plataform name ($_platform) to easily script usage + _platform_name="${_platform/\//+}" _platform_name="${_platform_name,,}" + + if [ "${_platform_name}" == "${platform}" ]; then + source "$(dirname "$(readlink -e "$0")")/config_${_platform}" + + mkdir -p -- "${REPO_DIR}"/{"${PKG_POOL}","${SRC_POOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + + "$(dirname "$(readlink -e "$0")")/create-repo" -p "${_platform}" "${PKG_REPOS[@]}" + else + createrepos-usage + fi + done + else + source "$(dirname "$(readlink -e "$0")")/config_${platform}" + + mkdir -p -- "${REPO_DIR}"/{"${PKG_POOL}","${SRC_POOL}"} "${CLEANUP_DESTDIR}" "${SOURCE_CLEANUP_DESTDIR}" "${STAGING}" + + "$(dirname "$(readlink -e "$0")")/create-repo" "${PKG_REPOS[@]}" + ;; + fi +done |