VPP-221 Improve doxygen dependency check

Only try to install packages if they're not installed.
Saves a trip through sudo which is useful when you have a
non-privileged account generating the docs.

Change-Id: I3709aceb15516a45ea2f9510d91c6d2e42c8c349
Signed-off-by: Chris Luke <chrisy@flirble.org>
This commit is contained in:
Chris Luke
2016-09-01 09:04:01 -04:00
committed by Dave Wallace
parent 406ab9d365
commit ee4743adf5

View File

@@ -63,7 +63,11 @@ SIPHON_DOCS = $(addprefix $(SIPHON_OUTPUT)/,$(addsuffix .md,$(SIPHONS)))
$(BR)/.doxygen-bootstrap.ok:
ifeq ($(OS_ID),ubuntu)
@sudo -E apt-get $(CONFIRM) $(FORCE) install $(DOC_DEB_DEPENDS)
@set -e; inst=; \
for i in $(DOC_DEB_DEPENDS); do \
dpkg-query --show $$i >/dev/null 2>&1 || inst="$$inst $$i"; \
done; \
[ "$$inst" ] && sudo apt-get $(CONFIRM) $(FORCE) install $$inst
else ifneq ("$(wildcard /etc/redhat-release)","")
@sudo yum install $(CONFIRM) $(DOC_RPM_DEPENDS)
else