commit: 2d475f8a7b560fe09d760d56ce9787688d848390 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> AuthorDate: Sat Dec 3 21:55:42 2022 +0000 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org> CommitDate: Sat Dec 3 21:59:29 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d475f8a
sys-fs/zfs-kmod: improve new module check in live ebuild Closes: https://github.com/gentoo/gentoo/pull/28498 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org> sys-fs/zfs-kmod/zfs-kmod-9999.ebuild | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild index 3e4508af22fc..b31dd845873c 100644 --- a/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild +++ b/sys-fs/zfs-kmod/zfs-kmod-9999.ebuild @@ -210,8 +210,10 @@ _old_layout_cleanup() { pkg_postinst() { # check for old module layout before doing anything else. # only attempt layout cleanup if new .ko location is used. - [[ -f "${EROOT}/lib/modules/${KV_FULL}/extra/zfs.ko" ]] && _old_layout_cleanup - + local newko=( "${EROOT}/lib/modules/${KV_FULL}/extra"/{zfs,spl}.ko* ) + # we check first array member, if glob above did not exand, it will be "zfs.ko*" and -f will return false. + # if glob expanded -f will do correct file precense check. + [[ -f ${newko[0]} ]] && _old_layout_cleanup linux-mod_pkg_postinst if [[ -z ${ROOT} ]] && use dist-kernel; then
