From 331e07254fd3d05ce1428ba46b93b1f7d22fe032 Mon Sep 17 00:00:00 2001 From: Jason McKenna Date: Tue, 30 Oct 2018 11:16:04 -0400 Subject: [PATCH] Handle multiple optional dependancies and copy list RPMs which are built from a build_srpm.data file may have optional COPY_LIST_TO_TAR and OPT_DEP_LIST items listed in the file. These variables are assumed to be single items by the md5sums_from_input_vars function used by build-srpms during build-avoidance. What this means is that listing multiple items are not currently handled by build-srpms during build-avoidance. This change handles each item in the variables independently. Change-Id: I57494d23680b726eb8dca712444c45879897ca50 Signed-off-by: Jason McKenna Closes-Bug: 1800675 --- build-tools/build-srpms-common.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build-tools/build-srpms-common.sh b/build-tools/build-srpms-common.sh index d83e6545..1b5826ad 100644 --- a/build-tools/build-srpms-common.sh +++ b/build-tools/build-srpms-common.sh @@ -135,20 +135,20 @@ md5sums_from_input_vars () { fi if [ "x$COPY_LIST_TO_TAR" != "x" ]; then - find $(readlink -f "$COPY_LIST_TO_TAR") -type f >> $INPUT_FILES - if [ $? -ne 0 ]; then - >&2 echo "ERROR: $FUNCNAME (${LINENO}): find '$COPY_LIST_TO_TAR' -type f" - return 1 - fi + for x in $COPY_LIST_TO_TAR; do + find $(readlink -f $x) -type f >> $INPUT_FILES + if [ $? -ne 0 ]; then + >&2 echo "ERROR: $FUNCNAME (${LINENO}): find '$x' -type f" + return 1 + fi + done fi fi if [ "x$OPT_DEP_LIST" != "x" ]; then - find $(readlink -f "$OPT_DEP_LIST") -type f >> $INPUT_FILES 2> /dev/null - if [ $? -ne 0 ]; then - >&2 echo "ERROR: $FUNCNAME (${LINENO}): find '$OPT_DEP_LIST' -type f" - return 1 - fi + for x in $OPT_DEP_LIST; do + find $(readlink -f $x) -type f >> $INPUT_FILES 2> /dev/null || true + done fi ) if [ $? -eq 1 ]; then