diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-01 17:56:20 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-05 20:01:05 -0600 |
commit | abac8a47a9e8bbccb7eb866c2fa0796cc5c39edc (patch) | |
tree | 2e9bb1b9b9fc5d1c5269d51dc1716281716f0699 /src/abslibre-tools | |
parent | fbed0b50c73f1ed06bc47d490ce8ab78428c8e78 (diff) |
librestage: use tabs to indent
Diffstat (limited to 'src/abslibre-tools')
-rwxr-xr-x | src/abslibre-tools/librestage | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/src/abslibre-tools/librestage b/src/abslibre-tools/librestage index e84c486..528a0be 100755 --- a/src/abslibre-tools/librestage +++ b/src/abslibre-tools/librestage @@ -28,15 +28,15 @@ load_files libretools check_vars libretools ARCHES WORKDIR || exit 1 if [ -w / ]; then - error "This script should be run as regular user" - exit 1 + error "This script should be run as regular user" + exit 1 fi # End Config usage() { - cat <<EOU + cat <<EOU LibreStage Copyright (C) 2011 Nicolás Reynolds This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it @@ -53,19 +53,19 @@ EOU repos=$@ while getopts 'h' arg; do - case $arg in - h) usage; exit 0 ;; - esac + case $arg in + h) usage; exit 0 ;; + esac done if [ ${#repos} -eq 0 ]; then - usage - exit 1; + usage + exit 1; fi [[ ! -e ./PKGBUILD ]] && { - error "PKGBUILD not found" - exit 1 + error "PKGBUILD not found" + exit 1 } # Source the needed files @@ -82,56 +82,56 @@ PKGEXT=".pkg.tar.?z" staged=false # Copies the packages to the specified repos inside staging for _arch in "${ARCHES[@]}"; do - for pkg in "${pkgname[@]}"; do - - pkgpath=$(find ${PKGDEST}/ -type f \ - -name "${pkg}-$(get_full_version "${pkg}")-${_arch}${PKGEXT}") - - [[ -z ${pkgpath} ]] && continue - - pkgfile=$(basename ${pkgpath}) - -# TODO refactor this - if [ -e "${pkgpath}" ]; then - msg "Found ${pkgfile}" - - canonical="" - for _repo in ${repos[@]}; do - - if [ ! -d "${WORKDIR}/staging/${_repo}" ]; then - warning "[${_repo}] didn't exist, creating..." - mkdir -p "${WORKDIR}/staging/${_repo}" - fi - - if [ -z "$canonical" ]; then - canonical="${WORKDIR}/staging/${_repo}/${pkgfile}" - - cp "${pkgpath}" "${WORKDIR}/staging/${_repo}/" || { - error "Can't put ${pkgfile} on [staging]" - exit 1 - } && { - msg2 "${pkg} staged on [${_repo}]" - staged=true - } - - else - ln "${canonical}" "${WORKDIR}/staging/${_repo}/${pkgfile}" || { - error "Can't put ${pkgfile} on [staging]" - exit 1 - } && { - msg2 "${pkg} staged on [${_repo}]" - staged=true - } - - fi - done - fi - done + for pkg in "${pkgname[@]}"; do + + pkgpath=$(find ${PKGDEST}/ -type f \ + -name "${pkg}-$(get_full_version "${pkg}")-${_arch}${PKGEXT}") + + [[ -z ${pkgpath} ]] && continue + + pkgfile=$(basename ${pkgpath}) + + # TODO refactor this + if [ -e "${pkgpath}" ]; then + msg "Found ${pkgfile}" + + canonical="" + for _repo in ${repos[@]}; do + + if [ ! -d "${WORKDIR}/staging/${_repo}" ]; then + warning "[${_repo}] didn't exist, creating..." + mkdir -p "${WORKDIR}/staging/${_repo}" + fi + + if [ -z "$canonical" ]; then + canonical="${WORKDIR}/staging/${_repo}/${pkgfile}" + + cp "${pkgpath}" "${WORKDIR}/staging/${_repo}/" || { + error "Can't put ${pkgfile} on [staging]" + exit 1 + } && { + msg2 "${pkg} staged on [${_repo}]" + staged=true + } + + else + ln "${canonical}" "${WORKDIR}/staging/${_repo}/${pkgfile}" || { + error "Can't put ${pkgfile} on [staging]" + exit 1 + } && { + msg2 "${pkg} staged on [${_repo}]" + staged=true + } + + fi + done + fi + done done if ! $staged ; then - error "No package was staged" - exit 1 + error "No package was staged" + exit 1 fi exit 0 |