mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
42 lines
1.2 KiB
#!/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
|
|
|