The below code works in the ptxdist Makefile, but like to know if there is any better solution to check if all required packages are installed before proceeding the build?
ENV_VERIFICATION:
@echo ------------START ENV VERIFICATION---------------
if ! dpkg -s sudo | grep Status | grep -q installed; then \
echo ERROR: sudo package not installed!; \
exit 1; \
fi
if ! dpkg -s scons | grep Status | grep -q installed; then \
echo scons package not installed!; \
exit 1; \
fi
@echo ------------END ENV VERIFICATION---------------
I could run below command in my system, would be nice to print the same in make log, any help to improve the above code and print below output (if package is installed) to the log is appreciated. Thanks in advance!
$ dpkg-query -W -f='${Package} ${Status}\n' sudo
sudo install ok installed