From ddf3094cc0d609901bc84a8b77885723dec707cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?coadde=20=5BM=C3=A1rcio=20Alexandre=20Silva=20Delgado=5D?= Date: Tue, 25 Aug 2015 22:26:09 -0300 Subject: fix create-repo variables --- create-repo | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/create-repo b/create-repo index 7905a0a..0c0f2f9 100755 --- a/create-repo +++ b/create-repo @@ -14,19 +14,24 @@ if [ "$#" -eq '0' ]; then fi for 'platform' in "${PLATFORMS[@]}"; do - case $1 in + case "$1" in --platform|-platform|-p) + + # Don't create [--platform], [-platform] or [-p] and [] repos _repos=($@) && unset _repos[0] _repos[1] - if [ "$2" == "${platform}" ]; then + # Rename plataform name ($2) to easily script usage + _platform="${2/\//+}" _platform="${_platform,,}" + + if [ "${_platform}" == "${platform}" ]; then source "$(dirname "$(readlink -e "$0")")/config_${2}" - msg "Creating repos... from $2 platform" + msg "Creating repos... from ${PLATFORM_NAME} platform" for '_repo' in "${_repos[@]}"; do msg2 "Creating [%s]" "${_repo_all}" for '_arch' in "${ARCHES[@]}"; do mkdir -p "${REPO_DIR}/${_repo}/os/${_arch}" || \ - error "Failed creating %s dir" "${_arch}" "from $2 platform" + error "Failed creating %s dir" "${_arch}" "from ${PLATFORM_NAME} platform" done done -- cgit v1.2.3