check_install_pkgs - check if pkgs is installed if not installs it.
apt_update_skip - Skips 'apt update' if cache not older than one Hour
check_install_pkgs accepts multiple words in Variable.
As example:
Your module needs many dependencies.
Place an Variable in your config file like:
[ -n "$KLIPPER_DEPS" ] || KLIPPER_DEPS="wget git gpiod \
virtualenv python-dev \
libffi-dev build-essential \
libncurses-dev libusb-dev \
avrdude gcc-avr binutils-avr avr-libc \
stm32flash dfu-util libnewlib-arm-none-eabi \
gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0-0"
in your start_chroot_script, you can use:
apt_update_skip
check_install_pkgs $KLIPPER_DEPS
This will check your apt cache is present and if, then its time since last 'apt update'
If it is older than 1 Hour it will run 'apt update'
After that it checks for your set Packages if is one or more missing it will install them.
This could be Handy if you use multiple Modules with similar Dependencies.
check_install_pkgs accepts multiple words in Variable. As example: Your module needs many dependencies. Place an Variable in your config file like: [ -n "$KLIPPER_DEPS" ] || KLIPPER_DEPS="wget git gpiod \ virtualenv python-dev \ libffi-dev build-essential \ libncurses-dev libusb-dev \ avrdude gcc-avr binutils-avr avr-libc \ stm32flash dfu-util libnewlib-arm-none-eabi \ gcc-arm-none-eabi binutils-arm-none-eabi libusb-1.0-0"
in your start_chroot_script, you can use:
apt_update_skip check_install_pkgs $KLIPPER_DEPS
This will check your apt cache is present and if, then its time since last 'apt update' If it is older than 1 Hour it will run 'apt update' After that it checks for your set Packages if is one or more missing it will install them.
This could be Handy if you use multiple Modules with similar Dependencies.
Regards