diskimage-builder/elements/yum/cleanup.d/99-remove-yum-repo-conf
James Slagle aee9cc0ce6 Make $DIB_YUM_REPO_CONF accept a list of repo files
It's useful to be able to pass in multiple yum repo configuration files
via $DIB_YUM_REPO_CONF, not just a single one.

Change-Id: I43722229a2df58be55bdb2b50c253e957b18e6fe
2015-05-22 19:37:29 -07:00

17 lines
400 B
Bash
Executable file

#!/bin/bash
if [ ${DIB_DEBUG_TRACE:-1} -gt 0 ]; then
set -x
fi
set -eu
set -o pipefail
# exit directly if DIB_YUM_REPO_CONF is not defined properly
if [ -z "${DIB_YUM_REPO_CONF:-}" ] ; then
echo "DIB_YUM_REPO_CONF is not set - no repo configurations will be cleaned up"
exit 0
fi
for file in $DIB_YUM_REPO_CONF; do
sudo rm -f $TMP_MOUNT_PATH/etc/yum.repos.d/$(basename $file)
done