From 2af4c157d9872a4ce34a33ee6f8425643c584f93 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 24 Jun 2024 21:35:35 +0200 Subject: [PATCH] helpers/mongo: less noisy output when checking the avx flag is here in /proc/cpuinfo --- helpers/helpers.v1.d/mongodb | 2 +- helpers/helpers.v2.1.d/mongodb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/helpers.v1.d/mongodb b/helpers/helpers.v1.d/mongodb index d40d11bfe..8736aad31 100644 --- a/helpers/helpers.v1.d/mongodb +++ b/helpers/helpers.v1.d/mongodb @@ -310,7 +310,7 @@ ynh_install_mongo() { ynh_print_info --message="Installing MongoDB Community Edition ..." local mongo_debian_release=$(ynh_get_debian_release) - if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then + if [[ "$(grep '^flags' /proc/cpuinfo | uniq)" != *"avx"* && "$mongo_version" != "4.4" ]]; then ynh_print_warn --message="Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." mongo_version="4.4" fi diff --git a/helpers/helpers.v2.1.d/mongodb b/helpers/helpers.v2.1.d/mongodb index da4159bc8..b0d1fe981 100644 --- a/helpers/helpers.v2.1.d/mongodb +++ b/helpers/helpers.v2.1.d/mongodb @@ -226,7 +226,7 @@ ynh_install_mongo() { ynh_print_info "Installing MongoDB Community Edition ..." local mongo_debian_release=$YNH_DEBIAN_VERSION - if [[ $(cat /proc/cpuinfo) != *"avx"* && "$mongo_version" != "4.4" ]]; then + if [[ "$(grep '^flags' /proc/cpuinfo | uniq)" != *"avx"* && "$mongo_version" != "4.4" ]]; then ynh_print_warn "Installing Mongo 4.4 as $mongo_version is not compatible with your cpu (see https://docs.mongodb.com/manual/administration/production-notes/#x86_64)." mongo_version="4.4" fi