Merge pull request #797 from msehnout/master

Fedora bootstrap: Check if packages are already installed
This commit is contained in:
Jeremy Soller 2016-12-20 18:10:12 -07:00 committed by GitHub
commit b5a18e155f

View file

@ -224,8 +224,14 @@ fedora()
echo "Virtualbox already installed!"
fi
fi
echo "Installing necessary build tools..."
sudo dnf install gcc gcc-c++ glibc-devel.i686 nasm make fuse-devel
# Use rpm -q <package> to check if it's already installed
PKGS=$(for pkg in gcc gcc-c++ glibc-devel.i686 nasm make fuse-devel; do rpm -q $pkg > /dev/null; [ $? -ne 0 ] && echo $pkg; done)
# If the list of packages is not empty, install missing
COUNT=$(echo $PKGS | wc -w)
if [ $COUNT -ne 0 ]; then
echo "Installing necessary build tools..."
sudo dnf install $PKGS
fi
}
###############################################################################