#------------------------------------------------------------------------------
# Modified Calculate Utilities 3.7.6.8
# Processed template files:
# /var/db/repos/calculate/profiles/templates/2_ac_install_merge/sys-apps/calculate-utils/profile.bashrc.d/40-pack-modules
#------------------------------------------------------------------------------
# vim: set syntax=sh
#
# Copyright 2020 Calculate Ltd. http://www.calculate-linux.org
#
#  Licensed under the Apache License, Version 2.0 (the "License");
#  you may not use this file except in compliance with the License.
#  You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0

if [[ -d ${D}/lib/modules ]] && [[ ${EBUILD_PHASE} == "preinst" ]]
then
    if linux_chkconfig_builtin MODULE_COMPRESS_ZSTD
    then
        find ${D}/lib/modules -name "*.ko" -exec zstd --rm {} \;
    fi
    if linux_chkconfig_builtin MODULE_COMPRESS_XZ
    then
        find ${D}/lib/modules -name "*.ko" -exec xz {} \;
    fi
fi
