Changeset 85b41bc in mainline for tools/toolchain.sh


Ignore:
Timestamp:
2023-10-24T17:07:29Z (14 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
59d469b
Parents:
29ed06d
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-24 17:06:42)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-24 17:07:29)
Message:

toolchain.sh: Fix directory check bug introduced previously

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r29ed06d r85b41bc  
    256256
    257257check_dirs() {
    258         OUTSIDE="$1"
    259         BASE="$2"
    260         ORIGINAL="$PWD"
    261 
    262         cd "${BASE}"
    263         check_error $? "Unable to change directory to ${BASE}."
     258        cd "${BASEDIR}"
     259        check_error $? "Unable to change directory to ${BASEDIR}."
    264260        ABS_BASE="$PWD"
    265         cd "${ORIGINAL}"
    266         check_error $? "Unable to change directory to ${ORIGINAL}."
    267 
    268         if $SYSTEM_INSTALL && [ ! -d "${OUTSIDE}" ]; then
     261
     262        if $SYSTEM_INSTALL && [ ! -d "${CROSS_PREFIX}" ]; then
    269263                ring_bell
    270                 ( set -x ; sudo -k mkdir -p "${OUTSIDE}" )
     264                ( set -x ; sudo -k mkdir -p "${CROSS_PREFIX}" )
    271265        else
    272                 mkdir -p "${OUTSIDE}"
    273         fi
    274 
    275         cd "${OUTSIDE}"
    276         check_error $? "Unable to change directory to ${OUTSIDE}."
     266                mkdir -p "${CROSS_PREFIX}"
     267        fi
     268
     269        cd "${CROSS_PREFIX}"
     270        check_error $? "Unable to change directory to ${CROSS_PREFIX}."
    277271
    278272        while [ "${#PWD}" -gt "${#ABS_BASE}" ]; do
     
    287281        fi
    288282
    289         cd "${ORIGINAL}"
    290         check_error $? "Unable to change directory to ${ORIGINAL}."
     283        cd "${BASEDIR}"
    291284}
    292285
     
    328321
    329322        DESTDIR_SPEC="DESTDIR=${INSTALL_DIR}"
     323
     324        check_dirs
    330325}
    331326
     
    368363        cleanup_dir "${WORKDIR}"
    369364        mkdir -p "${WORKDIR}"
    370         check_dirs "${CROSS_PREFIX}" "${WORKDIR}"
    371365
    372366        echo ">>> Processing binutils (${PLATFORM})"
     
    407401        cleanup_dir "${WORKDIR}"
    408402        mkdir -p "${WORKDIR}"
    409         check_dirs "${CROSS_PREFIX}" "${WORKDIR}"
    410403
    411404        echo ">>> Processing GCC (${PLATFORM})"
     
    482475        cleanup_dir "${WORKDIR}"
    483476        mkdir -p "${WORKDIR}"
    484         check_dirs "${CROSS_PREFIX}" "${WORKDIR}"
    485477
    486478        echo ">>> Processing GDB (${PLATFORM})"
Note: See TracChangeset for help on using the changeset viewer.