summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-11-11 03:12:23 +0000
committerSam James <sam@gentoo.org>2021-11-11 03:12:23 +0000
commit0372bbf13c029d77b6e3f2abe538c06b1648b5b2 (patch)
treee3cb6a2a434e45ed3b4bc27f52bd0e0c42026e4d /sys-apps
parentmedia-libs/openh264: Stabilize 2.1.1_p20190331 ppc64, #822960 (diff)
downloadgentoo-0372bbf13c029d77b6e3f2abe538c06b1648b5b2.tar.gz
gentoo-0372bbf13c029d77b6e3f2abe538c06b1648b5b2.tar.bz2
gentoo-0372bbf13c029d77b6e3f2abe538c06b1648b5b2.zip
sys-apps/coreutils: add check for running zfs(-kmod) version in coreutils 9
We need to make sure people reboot to avoid data corruption, not just upgrade the module but fail to restart. Bug: https://bugs.gentoo.org/815469 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/coreutils/coreutils-9.0-r1.ebuild37
1 files changed, 37 insertions, 0 deletions
diff --git a/sys-apps/coreutils/coreutils-9.0-r1.ebuild b/sys-apps/coreutils/coreutils-9.0-r1.ebuild
index 1a47a1aacc83..394f624522d0 100644
--- a/sys-apps/coreutils/coreutils-9.0-r1.ebuild
+++ b/sys-apps/coreutils/coreutils-9.0-r1.ebuild
@@ -58,6 +58,43 @@ RDEPEND+="
!<app-forensics/tct-1.18-r1
!<net-fs/netatalk-2.0.3-r4"
+pkg_pretend() {
+ if has_version sys-fs/zfs; then
+ einfo "Checking for compatible ZFS version"
+
+ local kmodv minver
+ kmodv="$(grep kmod <(zfs -V 2>/dev/null))"
+ # Convert zfs-kmod-2.1.1-r3-gentoo -> 2.1.1-r3
+ kmodv="${kmodv//zfs-kmod-}"
+ kmodv="${kmodv%%-gentoo}"
+
+ minver="$(ver_cut 2 ${kmodv})"
+ local diemsg=$(cat <<-EOF
+ Attempted installation of ${P} on unsupported version of zfs-kmod!
+ Please reboot to a newer version of zfs-kmod first:
+ zfs-kmod >=2.0.7 or zfs-kmod >=2.1.1-r3
+ EOF
+ )
+
+ case "${minver}" in
+ # 2.0.x
+ 0)
+ ver_test "${kmodv}" -lt 2.0.7 && die "${diemsg}"
+ ;;
+ # 2.1.x
+ 1)
+ ver_test "${kmodv}" -lt 2.1.1-r3 && die "${diemsg}"
+ ;;
+ # 0.8.x/9999
+ *)
+ # We can't really cover this case realistically
+ # 9999 is too hard to check and 0.8.x isn't being supported anymore.
+ ;;
+ esac
+ fi
+
+}
+
pkg_setup() {
if use test ; then
python-any-r1_pkg_setup