diskimage-builder/elements/pkg-map/extra-data.d/10-create-pkg-map-dir
Ian Wienand 3c6972a5c0 Turn down some low-value tracing output
There are a couple of loops identified here that output a lot of
tracing each iteration for little value.  Make them only trace at
higher levels (-x -x and above).

Points of actual interest within the loops are replaced with an
explicit "echo" statement.

Additionally, export DIB_DEBUG_TRACE explicitly and in all cases, not
just when tracing is turned on.

Change-Id: Id710c0b111fc1f5e1ae87fc35f6db28b24867bad
2017-02-07 15:26:11 +11:00

22 lines
525 B
Bash
Executable File

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 1 ]; then
set -x
fi
set -eu
set -o pipefail
echo "Copying pkg-map files to $TMP_MOUNT_PATH/usr/share/pkg-map"
sudo mkdir -p $TMP_MOUNT_PATH/usr/share/pkg-map/
for ELEMENT in $IMAGE_ELEMENT ; do
for DIR in ${ELEMENTS_PATH//:/ }; do
if [ -f "$DIR/$ELEMENT/pkg-map" ]; then
echo "Deploying pkg-map $DIR/$ELEMENT/pkg-map"
sudo cp "$DIR/$ELEMENT/pkg-map" \
"$TMP_MOUNT_PATH/usr/share/pkg-map/$ELEMENT"
fi
done
done