Changeset 113fb4f in mainline


Ignore:
Timestamp:
2025-08-12T18:11:57Z (2 months ago)
Author:
Martin Decky <martin@…>
Branches:
master
Children:
0a9b918, 1b8dc3d, 2d77f73, 3686bda, 4c2cb33, 6c894b47, 7b9282b, 8ad4ccfc, 96daa1c, cf8555fa, db9a8464, f9c4c433, fc19a08
Parents:
a36c4aa
Message:

Use tar to install toolchains into the destination

Using a pair of tar invocations (reading the source path by one
instance and piping the data to a second instance that writes into
the target path) has the benefit of better preserving certain file
attributes and especially the hard links (even if the source and the
target paths reside on different physical file systems).

Preserving the hard links is important to avoid needlessly wasting
storage space.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    ra36c4aa r113fb4f  
    258258                ( set -x ; sudo -k mkdir -p "${CROSS_PREFIX}" )
    259259        else
    260                 mkdir -p "${CROSS_PREFIX}"
     260                ( set -x ; mkdir -p "${CROSS_PREFIX}" )
    261261        fi
    262262
     
    459459        if $SYSTEM_INSTALL ; then
    460460                ring_bell
    461                 ( set -x ; sudo -k cp -r -t "${CROSS_PREFIX}" "${INSTALL_DIR}${CROSS_PREFIX}/"* )
     461                ( set -x ; tar -C "${INSTALL_DIR}${CROSS_PREFIX}" -cpf - . | sudo -k tar -C "${CROSS_PREFIX}" -xpf - )
    462462        else
    463                 ( set -x ; cp -r -t "${CROSS_PREFIX}" "${INSTALL_DIR}${CROSS_PREFIX}/"* )
     463                ( set -x ; tar -C "${INSTALL_DIR}${CROSS_PREFIX}" -cpf - . | tar -C "${CROSS_PREFIX}" -xpf - )
    464464        fi
    465465}
Note: See TracChangeset for help on using the changeset viewer.