#!/bin/bash # analog of %preun RPM scriptlet # For details see: # 1. https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#summary-of-ways-maintainer-scripts-are-called # 2. https://www.debian.org/doc/debian-policy/ap-flowcharts.html # Arguments in short: # "$1" == "upgrade" - DEB package manager will upgrade package # "$1" == "remove" - DEB package manager will remove package # "$1" == "failed-upgrade" - previous prerm upgrade was finished with error # "$2" == "package_version" - DEB package new version (only for upgrade/failed-upgrade command) # "python-cllib DEBIAN PRERM STARTED" python_sitelib="$(/opt/cloudlinux/venv/bin/python3 -c "import sysconfig, sys; sys.stdout.write(sysconfig.get_path('purelib'))")" bundled_hooks_inuse_tmp='/usr/share/cloudlinux/hooks/.inuse.tmp' /usr/share/python-cllib/scriptlets/rpm_preun.sh "$1" "$python_sitelib" "$bundled_hooks_inuse_tmp" # "python-cllib DEBIAN PRERM FINISHED" exit 0