diff --git a/Makefile b/Makefile index 0981e01..f4cf846 100644 --- a/Makefile +++ b/Makefile @@ -40,13 +40,17 @@ help: # Setup commands check-deps: @echo "Checking system dependencies..." - @which python3 >/dev/null 2>&1 || (echo "Installing python3..." && sudo apt-get install -y python3) - @which pip3 >/dev/null 2>&1 || (echo "Installing pip3..." && sudo apt-get install -y python3-pip) - @python3 -c "import cryptography" 2>/dev/null || \ - (echo "Installing python3-cryptography..." && \ - (sudo apt-get install -y python3-cryptography 2>/dev/null || \ - pip3 install --break-system-packages cryptography 2>/dev/null || \ - pip3 install cryptography)) + @which python3 >/dev/null 2>&1 || \ + { echo "Installing python3..." && sudo -n apt-get install -y python3 2>/dev/null || \ + { echo "ERROR: python3 not found. Run: sudo apt-get install -y python3" ; exit 1 ; } ; } + @python3 -c "import cryptography" 2>/dev/null || { \ + echo "Installing python3-cryptography..." ; \ + sudo -n apt-get install -y python3-cryptography 2>/dev/null || \ + python3 -m pip install --user cryptography 2>/dev/null || \ + { python3 -m ensurepip --upgrade 2>/dev/null && python3 -m pip install --user cryptography 2>/dev/null ; } || \ + { echo "ERROR: Cannot install python3-cryptography. Run: sudo apt-get install python3-cryptography" ; exit 1 ; } ; } + @python3 -c "import cryptography" >/dev/null 2>&1 || \ + { echo "ERROR: python3-cryptography still not found. Run: sudo apt-get install python3-cryptography" ; exit 1 ; } @echo "Dependencies OK." setup: check-deps