opencv/platforms/maven/scripts/deb_package_check
Kerry Billingham b2dd128ec5 Creation of Maven POM project and documentation.
This commit introduces a POM.xml file to allow the build of OpenCV and Java bundles using Maven.

An additonal directory has been created  'platforms/maven' to contain the POM and scripts used during the build process. An additional Markdown file is included to give instructions on how to build with Maven.
2016-07-12 21:59:12 +01:00

43 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
###########################################################################################
#
# This script checks for the required Debian packages are installed
# to build OpenCV.
# Commandline parameters:
# $@ - These are the names of the packages to check with 'dpkg'
#
# Returns:
# 0 - All packages installed (success)
# 1 - One or more packages missing (failure)
#
# Kerry Billingham <contact (at) avionicengineers (d0t) com>
# 20 April 2016
#
###########################################################################################
red=$'\e[1;31m'
green=$'\e[1;32m'
end=$'\e[0m'
check_message="Checking for 'dpkg'"
dpkg -? &>/dev/null
if [ $? -ne 0 ]; then
printf "%-80s%s\n" "${check_message}" "${red} MISSING.${end}"
exit 1
else
printf "%-80s%s\n" "${check_message}" "${green} INSTALLED.${end}"
fi
declare -i packageMissing=0
packageArray=( "$@" )
for package in ${packageArray[@]}; do
check_message="Checking for package ${package}"
dpkg -s ${package} &>/dev/null
if [ $? -ne 0 ]; then
printf "%-80s%s\n" "${check_message}" "${red} MISSING.${end}"
packageMissing=1
else
printf "%-80s%s\n" "${check_message}" "${green} INSTALLED.${end}"
fi
done
exit $packageMissing