From c90586aacfe1c026de0f41c61c4161f095290425 Mon Sep 17 00:00:00 2001 From: "1.21 Gigasats" <164770505+1-21gigasats@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:29:30 +0200 Subject: [PATCH 1/3] fix: venv dependency check on debian --- depends.txt | 1 - device_specific/flash_the_ttgo_tdisplay | 10 +++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/depends.txt b/depends.txt index e18d998..625f15a 100644 --- a/depends.txt +++ b/depends.txt @@ -2,4 +2,3 @@ cmake curl git pip -virtualenv diff --git a/device_specific/flash_the_ttgo_tdisplay b/device_specific/flash_the_ttgo_tdisplay index d9e4db1..aa7afa0 100755 --- a/device_specific/flash_the_ttgo_tdisplay +++ b/device_specific/flash_the_ttgo_tdisplay @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..." while read -r dependency; do if ! command -v "${dependency}" &> /dev/null; then echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n" - if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then + if [ "${dependency}" == "pip" ]; then echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n" else echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n" @@ -61,6 +61,14 @@ while read -r dependency; do fi done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) +if grep -qEi '(debian|ubuntu)' /etc/os-release; then + if ! dpkg -s python3-venv &>/dev/null; then + echo -en "Package python3-venv is missing, please install by running:\n\n" + echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" + exit 1 + fi +fi + if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}" cd "${esp_idf_temp_directory}"/ From 2d8d7fa7f3a82f5c9288a9b8ca62099ac21e5a24 Mon Sep 17 00:00:00 2001 From: "1.21 Gigasats" <164770505+1-21gigasats@users.noreply.github.com> Date: Tue, 9 Apr 2024 22:35:18 +0200 Subject: [PATCH 2/3] fix shfmt --- device_specific/flash_the_ttgo_tdisplay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device_specific/flash_the_ttgo_tdisplay b/device_specific/flash_the_ttgo_tdisplay index aa7afa0..dcc05f3 100755 --- a/device_specific/flash_the_ttgo_tdisplay +++ b/device_specific/flash_the_ttgo_tdisplay @@ -62,7 +62,7 @@ while read -r dependency; do done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) if grep -qEi '(debian|ubuntu)' /etc/os-release; then - if ! dpkg -s python3-venv &>/dev/null; then + if ! dpkg -s python3-venv &> /dev/null; then echo -en "Package python3-venv is missing, please install by running:\n\n" echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" exit 1 From 3691626b6e525378bdf77c064c4e01d1ba2b18b2 Mon Sep 17 00:00:00 2001 From: "1.21 Gigasats" <164770505+1-21gigasats@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:52:24 +0200 Subject: [PATCH 3/3] fix: add venv dependency check to all scripts --- device_specific/flash_the_m5stack_core_basic | 10 +++++++++- device_specific/flash_the_m5stack_fire | 10 +++++++++- device_specific/flash_the_m5stack_m5stickc_plus | 10 +++++++++- flash_your_device | 11 ++++++++++- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/device_specific/flash_the_m5stack_core_basic b/device_specific/flash_the_m5stack_core_basic index fee9a68..6ad0396 100755 --- a/device_specific/flash_the_m5stack_core_basic +++ b/device_specific/flash_the_m5stack_core_basic @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..." while read -r dependency; do if ! command -v "${dependency}" &> /dev/null; then echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n" - if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then + if [ "${dependency}" == "pip" ]; then echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n" else echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n" @@ -61,6 +61,14 @@ while read -r dependency; do fi done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) +if grep -qEi '(debian|ubuntu)' /etc/os-release; then + if ! dpkg -s python3-venv &> /dev/null; then + echo -en "Package python3-venv is missing, please install by running:\n\n" + echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" + exit 1 + fi +fi + if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}" cd "${esp_idf_temp_directory}"/ diff --git a/device_specific/flash_the_m5stack_fire b/device_specific/flash_the_m5stack_fire index e5c94f8..55b2709 100755 --- a/device_specific/flash_the_m5stack_fire +++ b/device_specific/flash_the_m5stack_fire @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..." while read -r dependency; do if ! command -v "${dependency}" &> /dev/null; then echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n" - if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then + if [ "${dependency}" == "pip" ]; then echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n" else echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n" @@ -61,6 +61,14 @@ while read -r dependency; do fi done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) +if grep -qEi '(debian|ubuntu)' /etc/os-release; then + if ! dpkg -s python3-venv &> /dev/null; then + echo -en "Package python3-venv is missing, please install by running:\n\n" + echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" + exit 1 + fi +fi + if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}" cd "${esp_idf_temp_directory}"/ diff --git a/device_specific/flash_the_m5stack_m5stickc_plus b/device_specific/flash_the_m5stack_m5stickc_plus index c884960..2899cb1 100755 --- a/device_specific/flash_the_m5stack_m5stickc_plus +++ b/device_specific/flash_the_m5stack_m5stickc_plus @@ -52,7 +52,7 @@ echo "Flashing the ${chosen_device}..." while read -r dependency; do if ! command -v "${dependency}" &> /dev/null; then echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n" - if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then + if [ "${dependency}" == "pip" ]; then echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n" else echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n" @@ -61,6 +61,14 @@ while read -r dependency; do fi done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) +if grep -qEi '(debian|ubuntu)' /etc/os-release; then + if ! dpkg -s python3-venv &> /dev/null; then + echo -en "Package python3-venv is missing, please install by running:\n\n" + echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" + exit 1 + fi +fi + if [ ! -f "${esp_idf_save_directory}"/export.sh ]; then git clone --branch "${esp_idf_git_tag}" --single-branch --depth 1 "${esp_idf_repo_url}" "${esp_idf_temp_directory}" cd "${esp_idf_temp_directory}"/ diff --git a/flash_your_device b/flash_your_device index a07a849..e1364a1 100755 --- a/flash_your_device +++ b/flash_your_device @@ -53,7 +53,7 @@ Linux*) while read -r dependency; do if ! command -v "${dependency}" &> /dev/null; then echo -en "\n\nERROR:\n${dependency} was not found on your system.\nPlease install ${dependency} by running:\n\n" - if [ "${dependency}" == "pip" ] || [ "${dependency}" == "virtualenv" ]; then + if [ "${dependency}" == "pip" ]; then echo -en "sudo apt update && sudo apt install -y python3-${dependency}\n\n" else echo -en "sudo apt update && sudo apt install -y ${dependency}\n\n" @@ -62,6 +62,15 @@ Linux*) fi done < <(curl -fsSL https://github.com/bitcoin-tools/diyjade/raw/master/depends.txt) echo "ok." + + if grep -qEi '(debian|ubuntu)' /etc/os-release; then + if ! dpkg -s python3-venv &> /dev/null; then + echo -en "Package python3-venv is missing, please install by running:\n\n" + echo -en "sudo apt update && sudo apt install -y python3-venv\n\n" + exit 1 + fi + fi + ;; Darwin*) machine="macOS"