mirror of
https://github.com/dw-0/kiauh.git
synced 2025-12-14 11:04:29 +05:00
script: improve dependency checks on klipper/moonraker update
This commit is contained in:
@@ -72,18 +72,23 @@ update_klipper(){
|
|||||||
save_klipper_state
|
save_klipper_state
|
||||||
status_msg "Updating $GET_BRANCH"
|
status_msg "Updating $GET_BRANCH"
|
||||||
cd $KLIPPER_DIR
|
cd $KLIPPER_DIR
|
||||||
KLIPPER_OLDREQ_MD5SUM="$(md5sum $KLIPPER_DIR/scripts/klippy-requirements.txt | cut -d " " -f1)"
|
|
||||||
|
|
||||||
if [ "$DETACHED_HEAD" == "true" ]; then
|
if [ "$DETACHED_HEAD" == "true" ]; then
|
||||||
git checkout $GET_BRANCH
|
git checkout $GET_BRANCH
|
||||||
unset DETACHED_HEAD
|
unset DETACHED_HEAD
|
||||||
fi
|
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
|
### 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
|
### 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"
|
PYTHONDIR="${HOME}/klippy-env"
|
||||||
status_msg "New dependecies detected..."
|
status_msg "New dependecies detected..."
|
||||||
|
|
||||||
@@ -132,13 +137,18 @@ update_moonraker(){
|
|||||||
bb4u "moonraker"
|
bb4u "moonraker"
|
||||||
status_msg "Updating Moonraker ..."
|
status_msg "Updating Moonraker ..."
|
||||||
cd $MOONRAKER_DIR
|
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
|
### 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
|
### 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"
|
PYTHONDIR="${HOME}/moonraker-env"
|
||||||
status_msg "New dependecies detected..."
|
status_msg "New dependecies detected..."
|
||||||
### always rebuild the pythondir from scratch if new dependencies were detected
|
### always rebuild the pythondir from scratch if new dependencies were detected
|
||||||
|
|||||||
Reference in New Issue
Block a user