summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2022-12-03 13:55:42 -0800
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2022-12-03 13:59:29 -0800
commit2d475f8a7b560fe09d760d56ce9787688d848390 (patch)
tree433ccfe33a12e0b30d44c3c80947fbe74e8d27cf /sys-fs
parentsys-fs/zfs-kmod: clean up old modules in live ebuild (diff)
downloadgentoo-2d475f8a7b560fe09d760d56ce9787688d848390.tar.gz
gentoo-2d475f8a7b560fe09d760d56ce9787688d848390.tar.bz2
gentoo-2d475f8a7b560fe09d760d56ce9787688d848390.zip
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@gentoo.org>
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/zfs-kmod/zfs-kmod-9999.ebuild6
1 files 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