From 0fdfcd64bbe4c1edc8f71cae1f3add0c49104c1d Mon Sep 17 00:00:00 2001 From: Jan Houben Date: Thu, 14 Dec 2017 20:22:31 +0100 Subject: [PATCH] Warn about zfs-import.target --- build.sh | 4 ++-- src/kernels/common.sh | 2 +- src/zfs-utils/zfs-utils.install | 14 -------------- src/zfs-utils/zfs-utils.install.sh | 23 +++++++++++++++++++++++ 4 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 src/zfs-utils/zfs-utils.install create mode 100644 src/zfs-utils/zfs-utils.install.sh diff --git a/build.sh b/build.sh index 4032e3c..ee9d802 100755 --- a/build.sh +++ b/build.sh @@ -148,8 +148,8 @@ generate_package_files() { msg2 "Creating zfs-utils PKGBUILD" run_cmd_no_output "source ${script_dir}/src/zfs-utils/PKGBUILD.sh" - msg2 "Copying zfs-utils.install" - run_cmd_no_output "cp ${script_dir}/src/zfs-utils/zfs-utils.install ${zfs_utils_pkgbuild_path}/zfs-utils.install" + msg2 "Creating zfs-utils.install" + run_cmd_no_output "source ${script_dir}/src/zfs-utils/zfs-utils.install.sh" msg2 "Copying zfs-utils.bash-completion" run_cmd_no_output "cp ${script_dir}/src/zfs-utils/zfs-utils.bash-completion-r1 ${zfs_utils_pkgbuild_path}/zfs-utils.bash-completion-r1" diff --git a/src/kernels/common.sh b/src/kernels/common.sh index 37e2238..be129f8 100644 --- a/src/kernels/common.sh +++ b/src/kernels/common.sh @@ -3,7 +3,7 @@ mode_name="common" mode_desc="Select and use the packages that are common between all kernels" # version -pkgrel="1" +pkgrel="2" header="\ # Maintainer: Jesus Alvarez diff --git a/src/zfs-utils/zfs-utils.install b/src/zfs-utils/zfs-utils.install deleted file mode 100644 index ba23cb0..0000000 --- a/src/zfs-utils/zfs-utils.install +++ /dev/null @@ -1,14 +0,0 @@ -show_warning() { - echo ">>> WARNING: The systemd unit files for archzfs have changed!" - echo ">>> You may need re-enable the zfs systemd service." - echo ">>> See https://github.com/archzfs/archzfs/issues/72" -} - -post_install() { - show_warning -} - -post_upgrade() { - show_warning -} - diff --git a/src/zfs-utils/zfs-utils.install.sh b/src/zfs-utils/zfs-utils.install.sh new file mode 100644 index 0000000..55f17a6 --- /dev/null +++ b/src/zfs-utils/zfs-utils.install.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +old_version="0.7.4-1" +if [[ ${archzfs_package_group} =~ -git$ ]]; then + old_version="2017.12.08.r3208.4e9b15696-1" +fi + +cat << EOF > ${zfs_utils_pkgbuild_path}/zfs-utils.install + +show_zfs_import_warning() { + echo ">>> WARNING: A new systemd unit file was added to archzfs!" + echo ">>> You may need enable zfs-import.target" + echo ">>> See https://github.com/archzfs/archzfs/issues/186" +} + +post_upgrade() { + # If upgrading from $old_version or older + # display zfs-import warning + if [[ \$(vercmp \$2 $old_version) -le 0 ]]; then + show_zfs_import_warning + fi +} +EOF