From 0edfc746d407de9bed91a81fa2c4e0d820173d9c Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 8 Jun 2021 17:55:40 +0200 Subject: [PATCH] script: improve dependency checks on klipper/moonraker update --- scripts/update.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/update.sh b/scripts/update.sh index 616a541..f3f27fc 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -72,18 +72,23 @@ update_klipper(){ save_klipper_state status_msg "Updating $GET_BRANCH" cd $KLIPPER_DIR - KLIPPER_OLDREQ_MD5SUM="$(md5sum $KLIPPER_DIR/scripts/klippy-requirements.txt | cut -d " " -f1)" if [ "$DETACHED_HEAD" == "true" ]; then git checkout $GET_BRANCH unset DETACHED_HEAD fi + ### get current klippy-requirements.txt md5sum + KLIPPER_OLDREQ_MD5SUM="$(md5sum $KLIPPER_DIR/scripts/klippy-requirements.txt | cut -d " " -f1)" ### pull latest files from github - git pull && ok_msg "Update successfull!" + git pull + ### read PKGLIST and install possible new dependencies + install_klipper_packages + ### get possible new klippy-requirements.txt md5sum + KLIPPER_NEWREQ_MD5SUM="$(md5sum $KLIPPER_DIR/scripts/klippy-requirements.txt | cut -d " " -f1)" ### check for possible new dependencies and install them - if [[ $(md5sum $KLIPPER_DIR/scripts/klippy-requirements.txt | cut -d " " -f1) != $KLIPPER_OLDREQ_MD5SUM ]]; then + if [[ $KLIPPER_NEWREQ_MD5SUM != $KLIPPER_OLDREQ_MD5SUM ]]; then PYTHONDIR="${HOME}/klippy-env" status_msg "New dependecies detected..." @@ -132,13 +137,18 @@ update_moonraker(){ bb4u "moonraker" status_msg "Updating Moonraker ..." cd $MOONRAKER_DIR - MOONRAKER_OLDREQ_MD5SUM=$(md5sum $MOONRAKER_DIR/scripts/moonraker-requirements.txt | cut -d " " -f1) + ### get current moonraker-requirements.txt md5sum + MOONRAKER_OLDREQ_MD5SUM=$(md5sum $MOONRAKER_DIR/scripts/moonraker-requirements.txt | cut -d " " -f1) ### pull latest files from github - git pull && ok_msg "Update successfull!" + git pull + ### read PKGLIST and install possible new dependencies + install_moonraker_packages + ### get possible new moonraker-requirements.txt md5sum + MOONRAKER_NEWREQ_MD5SUM=$(md5sum $MOONRAKER_DIR/scripts/moonraker-requirements.txt | cut -d " " -f1) ### check for possible new dependencies and install them - if [[ $(md5sum $MOONRAKER_DIR/scripts/moonraker-requirements.txt | cut -d " " -f1) != $MOONRAKER_OLDREQ_MD5SUM ]]; then + if [[ $MOONRAKER_NEWREQ_MD5SUM != $MOONRAKER_OLDREQ_MD5SUM ]]; then PYTHONDIR="${HOME}/moonraker-env" status_msg "New dependecies detected..." ### always rebuild the pythondir from scratch if new dependencies were detected