From 164d0127cec116aa7f4be7236144be2f0696f9a2 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Thu, 11 Nov 2021 10:06:43 -0300 Subject: image_zfs: Fix inverted logic `zpool list -Ho ${ZFS_POOL_NAME}` exits with `0` if the name exists. This prevents overwriting the existing pool. --- src/share/poudriere/image_zfs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/share') diff --git a/src/share/poudriere/image_zfs.sh b/src/share/poudriere/image_zfs.sh index d3b0fa88..a4af764d 100644 --- a/src/share/poudriere/image_zfs.sh +++ b/src/share/poudriere/image_zfs.sh @@ -41,7 +41,7 @@ zfs_check() [ -n "${IMAGESIZE}" ] || err 1 "Please specify the imagesize" [ -n "${ZFS_POOL_NAME}" ] || err 1 "Please specify a pool name" - zpool list -Ho name ${ZFS_POOL_NAME} >/dev/null 2>&1 || \ + zpool list -Ho name ${ZFS_POOL_NAME} >/dev/null 2>&1 && \ err 1 "Target pool name already exists" case "${IMAGENAME}" in ''|*[!A-Za-z0-9]*) -- cgit v1.2.3