misc: do not use "tar cf - |tar xf -"
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jan 02 18:00:54 2010 +0100 (2010-01-02)
changeset 1678ac247da318a1
parent 1675 2ad2cbc1f709
child 1679 6b1e8a28dc60
misc: do not use "tar cf - |tar xf -"

Using this: tar cf - -C "/some/place" |tar xf - -C "/some/other/place"
to copy a directory to another place does not properly fail (when it does).

Using this instead: cp -av "/some/place" "/some/other/place"
makes it easy to see why and how it failed.

Impacted:
libc/uClibc
debug/ltrace
tools/sstrip
scripts/populate
scripts/build/debug/400-ltrace.sh
scripts/build/libc/uClibc.sh
scripts/build/tools/200-sstrip.sh
scripts/populate.in
     1.1 --- a/scripts/build/debug/400-ltrace.sh	Fri Jan 01 16:52:55 2010 +0100
     1.2 +++ b/scripts/build/debug/400-ltrace.sh	Sat Jan 02 18:00:54 2010 +0100
     1.3 @@ -20,11 +20,11 @@
     1.4  
     1.5  do_debug_ltrace_build() {
     1.6      CT_DoStep INFO "Installing ltrace"
     1.7 -    mkdir -p "${CT_BUILD_DIR}/build-ltrace"
     1.8 -    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
     1.9  
    1.10      CT_DoLog EXTRA "Copying sources to build dir"
    1.11 -    (cd "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}"; tar cf - .)| tar xvf - |CT_DoLog ALL
    1.12 +    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ltrace-${CT_LTRACE_VERSION}" \
    1.13 +                            "${CT_BUILD_DIR}/build-ltrace"
    1.14 +    CT_Pushd "${CT_BUILD_DIR}/build-ltrace"
    1.15  
    1.16      CT_DoLog EXTRA "Configuring ltrace"
    1.17      CT_DoExecLog ALL        \
     2.1 --- a/scripts/build/libc/uClibc.sh	Fri Jan 01 16:52:55 2010 +0100
     2.2 +++ b/scripts/build/libc/uClibc.sh	Sat Jan 02 18:00:54 2010 +0100
     2.3 @@ -58,15 +58,14 @@
     2.4  
     2.5      CT_DoStep INFO "Installing C library headers"
     2.6  
     2.7 -    mkdir -p "${CT_BUILD_DIR}/build-libc-headers"
     2.8 +    # Simply copy files until uClibc has the ability to build out-of-tree
     2.9 +    CT_DoLog EXTRA "Copying sources to build dir"
    2.10 +    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}"   \
    2.11 +                            "${CT_BUILD_DIR}/build-libc-headers"
    2.12      cd "${CT_BUILD_DIR}/build-libc-headers"
    2.13  
    2.14 -    # Simply copy files until uClibc has the ablity to build out-of-tree
    2.15 -    CT_DoLog EXTRA "Copying sources to build dir"
    2.16 -    tar cf - -C "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" . |tar xf -
    2.17 -
    2.18      # Retrieve the config file
    2.19 -    cp "${CT_CONFIG_DIR}/uClibc.config" .config
    2.20 +    CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config
    2.21  
    2.22      # uClibc uses the CROSS environment variable as a prefix to the
    2.23      # compiler tools to use.  Setting it to the empty string forces
    2.24 @@ -99,15 +98,14 @@
    2.25  do_libc() {
    2.26      CT_DoStep INFO "Installing C library"
    2.27  
    2.28 -    mkdir -p "${CT_BUILD_DIR}/build-libc"
    2.29 +    # Simply copy files until uClibc has the ability to build out-of-tree
    2.30 +    CT_DoLog EXTRA "Copying sources to build dir"
    2.31 +    CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}"   \
    2.32 +                            "${CT_BUILD_DIR}/build-libc"
    2.33      cd "${CT_BUILD_DIR}/build-libc"
    2.34  
    2.35 -    # Simply copy files until uClibc has the ablity to build out-of-tree
    2.36 -    CT_DoLog EXTRA "Copying sources to build dir"
    2.37 -    tar cf - -C "${CT_SRC_DIR}/uClibc-${CT_LIBC_VERSION}" . |tar xf -
    2.38 -
    2.39      # Retrieve the config file
    2.40 -    cp "${CT_CONFIG_DIR}/uClibc.config" .config
    2.41 +    CT_DoExecLog ALL cp "${CT_CONFIG_DIR}/uClibc.config" .config
    2.42  
    2.43      # uClibc uses the CROSS environment variable as a prefix to the compiler
    2.44      # tools to use.  The newly built tools should be in our path, so we need
     3.1 --- a/scripts/build/tools/200-sstrip.sh	Fri Jan 01 16:52:55 2010 +0100
     3.2 +++ b/scripts/build/tools/200-sstrip.sh	Sat Jan 02 18:00:54 2010 +0100
     3.3 @@ -12,9 +12,9 @@
     3.4          }
     3.5          do_tools_sstrip_build() {
     3.6              CT_DoStep INFO "Installing sstrip"
     3.7 -            mkdir -p "${CT_BUILD_DIR}/build-strip"
     3.8 +            CT_DoExecLog ALL cp -av "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"   \
     3.9 +                                    "${CT_BUILD_DIR}/build-strip"
    3.10              cd "${CT_BUILD_DIR}/build-strip"
    3.11 -            ( cd "${CT_SRC_DIR}/ELFkickers-${CT_SSTRIP_ELFKICKERS_VERSION}/sstrip"; tar cf - . ) |tar xf -
    3.12  
    3.13              CT_DoLog EXTRA "Building sstrip"
    3.14              CT_DoExecLog ALL make CC="${CT_HOST}-gcc" sstrip
     4.1 --- a/scripts/populate.in	Fri Jan 01 16:52:55 2010 +0100
     4.2 +++ b/scripts/populate.in	Sat Jan 02 18:00:54 2010 +0100
     4.3 @@ -127,9 +127,9 @@
     4.4  CT_ROOT_SRC_DIR=$(cd "${CT_ROOT_SRC_DIR}"; pwd)
     4.5  CT_ROOT_DST_DIR=$(cd "${CT_ROOT_DST_DIR}"; pwd)
     4.6  
     4.7 -# Populate the destination directory with files form the source directory
     4.8 +# Populate the destination directory with files from the source directory
     4.9  pushd "${CT_ROOT_SRC_DIR}" >/dev/null
    4.10 -tar cf - . |tar xf - -C "${CT_ROOT_DST_DIR}"
    4.11 +cp -a . "${CT_ROOT_DST_DIR}"
    4.12  popd >/dev/null
    4.13  
    4.14  # A function do search for a library