#!/bin/bash doKeepassFix() ( # check os #. /etc/os-release #[[ ${ID_LIKE} = "debian" ]] || { # : ${EXCEPTION:?$(echo -e "\e[41mThis script is intended to run on ${ID_LIKE} line os\e[0m")} #} # if libgdiplus exists and does not embeds pango then skip process libgdiplus="/usr/lib/libgdiplus.so" [[ ! -e ${libgdiplus} ]] || [[ $(strings ${libgdiplus} | grep pango | wc -l) -gt 0 ]] || { echo "Nothing to do - libgdiplus already patched" >&2 return 0 } # Perform downgrade arch=$(dpkg --print-architecture) baseUrl="http://ftp.de.debian.org/debian/pool/main" pkgs=( libj/libjpeg-turbo/libjpeg62-turbo_2.1.5-4 libw/libwebp/libwebp6_0.6.1-2.1+deb11u2 t/tiff/libtiff5_4.2.0-1+deb11u5 libg/libgdiplus/libgdiplus_6.0.4+dfsg-2 ) cd $(mktemp -d) retCode=0 for pkg in ${pkgs[@]}; do url="${baseUrl%/}/${pkg#/}_${arch}.deb" curl -sSLfO "${url}" && sudo dpkg -i ./${url##*/} || { # Raise error code retCode=${?} # Display debug echo -e "\t\ e[1;4mcwd\e[0m: $(pwd)" >&2 echo -e "\t\ e[1;4murl\e[0m: ${url}" >&2 echo -e "\t\e[1;4mpackage\e[0m: ./${url##*/}" >&2 break } done # Lock package if no error occured [[ ${retCode} -gt 0 ]] || sudo apt-mark hold libgdiplus ) doKeepassFix