Merge "Stop using bash arrays for whitelisting in yum"
This commit is contained in:
commit
ce85042b9c
@ -34,16 +34,16 @@ fi
|
|||||||
# Packages that aren't available in the distro but requested for installation
|
# Packages that aren't available in the distro but requested for installation
|
||||||
# can be ignored by adding them to the exclude list
|
# can be ignored by adding them to the exclude list
|
||||||
BLACKLIST=$(cat /tmp/yum-blacklist 2>/dev/null || echo "")
|
BLACKLIST=$(cat /tmp/yum-blacklist 2>/dev/null || echo "")
|
||||||
WHITELIST=()
|
WHITELIST=
|
||||||
for i in "$@"
|
for i in "$@"
|
||||||
do
|
do
|
||||||
if [[ ! ${BLACKLIST[*]} =~ $i ]]; then
|
if [[ ! ${BLACKLIST[*]} =~ $i ]]; then
|
||||||
WHITELIST+="$i "
|
WHITELIST="$WHITELIST $i"
|
||||||
else
|
else
|
||||||
echo "The package $i is not available and will not be installed"
|
echo "The package $i is not available and will not be installed"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
if [ ${#WHITELIST[@]} -eq 0 ]; then
|
if [ -n "$WHITELIST" ]; then
|
||||||
if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then
|
if [ -f /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release ]; then
|
||||||
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
|
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user