mirror of https://github.com/ArduPilot/ardupilot
Tools: install-prereqs-ubuntu : fix package_is_installed
This commit is contained in:
parent
d08e9b3363
commit
e40480a0ed
|
@ -41,11 +41,11 @@ fi
|
||||||
$APT_GET update
|
$APT_GET update
|
||||||
|
|
||||||
function package_is_installed() {
|
function package_is_installed() {
|
||||||
return $(dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed")
|
dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -c "ok installed"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install lsb-release as it is needed to check Ubuntu version
|
# Install lsb-release as it is needed to check Ubuntu version
|
||||||
if package_is_installed "lsb-release" -ne 1; then
|
if package_is_installed "lsb-release" -eq 1; then
|
||||||
echo "$sep"
|
echo "$sep"
|
||||||
echo "Installing lsb-release"
|
echo "Installing lsb-release"
|
||||||
echo "$sep"
|
echo "$sep"
|
||||||
|
@ -154,7 +154,7 @@ echo "Done!"
|
||||||
echo "$sep"
|
echo "$sep"
|
||||||
echo "Removing modemmanager package that could conflict with firmware uploading"
|
echo "Removing modemmanager package that could conflict with firmware uploading"
|
||||||
echo "$sep"
|
echo "$sep"
|
||||||
if package_is_installed "modemmanager" -ne 1; then
|
if package_is_installed "modemmanager" -eq 1; then
|
||||||
$APT_GET remove modemmanager
|
$APT_GET remove modemmanager
|
||||||
fi
|
fi
|
||||||
echo "Done!"
|
echo "Done!"
|
||||||
|
|
Loading…
Reference in New Issue