mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
Ubuntu 22.04 integration: ShellCheck
- Add new SC2312 global exclude. ``` Consider invoking this command separately to avoid masking its return value (or use '|| true' to ignore). [SC2312] ``` - Correct errors detected by new ShellCheck version. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: szubersk <szuberskidamian@gmail.com> Closes #14148
This commit is contained in:
committed by
Brian Behlendorf
parent
c3b6fd3d59
commit
a5087965fe
+10
-10
@@ -8,15 +8,15 @@ export ZTS_DIR=
|
||||
export SCRIPT_DIR=
|
||||
|
||||
# General commands
|
||||
export ZDB=${ZDB:-$SBIN_DIR/zdb}
|
||||
export ZFS=${ZFS:-$SBIN_DIR/zfs}
|
||||
export ZPOOL=${ZPOOL:-$SBIN_DIR/zpool}
|
||||
export ZTEST=${ZTEST:-$SBIN_DIR/ztest}
|
||||
export ZFS_SH=${ZFS_SH:-$SCRIPT_DIR/zfs.sh}
|
||||
export ZDB="${ZDB:-$SBIN_DIR/zdb}"
|
||||
export ZFS="${ZFS:-$SBIN_DIR/zfs}"
|
||||
export ZPOOL="${ZPOOL:-$SBIN_DIR/zpool}"
|
||||
export ZTEST="${ZTEST:-$SBIN_DIR/ztest}"
|
||||
export ZFS_SH="${ZFS_SH:-$SCRIPT_DIR/zfs.sh}"
|
||||
|
||||
# Test Suite
|
||||
export RUNFILE_DIR=${RUNFILE_DIR:-$ZTS_DIR/runfiles}
|
||||
export TEST_RUNNER=${TEST_RUNNER:-$ZTS_DIR/test-runner/bin/test-runner.py}
|
||||
export ZTS_REPORT=${ZTS_REPORT:-$ZTS_DIR/test-runner/bin/zts-report.py}
|
||||
export STF_TOOLS=${STF_TOOLS:-$ZTS_DIR/test-runner}
|
||||
export STF_SUITE=${STF_SUITE:-$ZTS_DIR/zfs-tests}
|
||||
export RUNFILE_DIR="${RUNFILE_DIR:-$ZTS_DIR/runfiles}"
|
||||
export TEST_RUNNER="${TEST_RUNNER:-$ZTS_DIR/test-runner/bin/test-runner.py}"
|
||||
export ZTS_REPORT="${ZTS_REPORT:-$ZTS_DIR/test-runner/bin/zts-report.py}"
|
||||
export STF_TOOLS="${STF_TOOLS:-$ZTS_DIR/test-runner}"
|
||||
export STF_SUITE="${STF_SUITE:-$ZTS_DIR/zfs-tests}"
|
||||
|
||||
+37
-37
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# shellcheck disable=SC2086
|
||||
# shellcheck disable=SC2086,SC2295
|
||||
|
||||
# kmodtool - Helper script for building kernel module RPMs
|
||||
# Copyright (c) 2003-2012 Ville Skyttä <ville.skytta@iki.fi>,
|
||||
@@ -125,10 +125,10 @@ EOF
|
||||
|
||||
print_rpmtemplate_per_kmodpkg ()
|
||||
{
|
||||
if [ "${1}" = "--custom" ]; then
|
||||
if [[ "${1}" = "--custom" ]]; then
|
||||
shift
|
||||
local customkernel=true
|
||||
elif [ "${1}" = "--redhat" ]; then
|
||||
elif [[ "${1}" = "--redhat" ]]; then
|
||||
# this is needed for akmods
|
||||
shift
|
||||
local redhatkernel=true
|
||||
@@ -139,7 +139,7 @@ print_rpmtemplate_per_kmodpkg ()
|
||||
|
||||
# Detect depmod install location
|
||||
local depmod_path=/sbin/depmod
|
||||
if [ ! -f "${depmod_path}" ]; then
|
||||
if [[ ! -f "${depmod_path}" ]]; then
|
||||
depmod_path=/usr/sbin/depmod
|
||||
fi
|
||||
|
||||
@@ -163,24 +163,24 @@ Requires(postun): kmod
|
||||
EOF
|
||||
|
||||
# second part
|
||||
if [ -z "${customkernel}" ]; then
|
||||
if [[ -z "${customkernel}" ]]; then
|
||||
cat <<EOF
|
||||
Requires: kernel-uname-r = ${kernel_uname_r}
|
||||
BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
|
||||
%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
|
||||
%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
|
||||
%post -n kmod-${kmodname}-${kernel_uname_r}
|
||||
if [ -f "/boot/System.map-${kernel_uname_r}" ]; then
|
||||
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
|
||||
${prefix}${depmod_path} -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :
|
||||
elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then
|
||||
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
|
||||
${prefix}${depmod_path} -aeF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} > /dev/null || :
|
||||
else
|
||||
${prefix}${depmod_path} -ae ${kernel_uname_r} &> /dev/null || :
|
||||
fi
|
||||
%postun -n kmod-${kmodname}-${kernel_uname_r}
|
||||
if [ -f "/boot/System.map-${kernel_uname_r}" ]; then
|
||||
if [[ -f "/boot/System.map-${kernel_uname_r}" ]]; then
|
||||
${prefix}${depmod_path} -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || :
|
||||
elif [ -f "/lib/modules/${kernel_uname_r}/System.map" ]; then
|
||||
elif [[ -f "/lib/modules/${kernel_uname_r}/System.map" ]]; then
|
||||
${prefix}${depmod_path} -aF /lib/modules/${kernel_uname_r}/System.map ${kernel_uname_r} &> /dev/null || :
|
||||
else
|
||||
${prefix}${depmod_path} -a ${kernel_uname_r} &> /dev/null || :
|
||||
@@ -213,10 +213,10 @@ EOF
|
||||
|
||||
print_rpmtemplate_kmoddevelpkg ()
|
||||
{
|
||||
if [ "${1}" = "--custom" ]; then
|
||||
if [[ "${1}" = "--custom" ]]; then
|
||||
shift
|
||||
local customkernel=true
|
||||
elif [ "${1}" = "--redhat" ]; then
|
||||
elif [[ "${1}" = "--redhat" ]]; then
|
||||
shift
|
||||
local redhatkernel=true
|
||||
fi
|
||||
@@ -230,7 +230,7 @@ Group: System Environment/Kernel
|
||||
Provides: ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
EOF
|
||||
|
||||
if [ -z "${customkernel}" ] && [ -z "${redhatkernel}" ]; then
|
||||
if [[ -z "${customkernel}" ]] && [[ -z "${redhatkernel}" ]]; then
|
||||
echo "Requires: kmod-${kmodname}-devel-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}"
|
||||
fi
|
||||
|
||||
@@ -256,10 +256,10 @@ EOF
|
||||
|
||||
print_rpmtemplate_per_kmoddevelpkg ()
|
||||
{
|
||||
if [ "${1}" = "--custom" ]; then
|
||||
if [[ "${1}" = "--custom" ]]; then
|
||||
shift
|
||||
local customkernel=true
|
||||
elif [ "${1}" = "--redhat" ]; then
|
||||
elif [[ "${1}" = "--redhat" ]]; then
|
||||
# this is needed for akmods
|
||||
shift
|
||||
local redhatkernel=true
|
||||
@@ -279,7 +279,7 @@ Provides: kmod-${kmodname}-devel-uname-r = ${kernel_uname_r}
|
||||
EOF
|
||||
|
||||
# second part
|
||||
if [ -z "${customkernel}" ]; then
|
||||
if [[ -z "${customkernel}" ]]; then
|
||||
cat <<EOF
|
||||
Requires: kernel-devel-uname-r = ${kernel_uname_r}
|
||||
BuildRequires: kernel-devel-uname-r = ${kernel_uname_r}
|
||||
@@ -333,7 +333,7 @@ print_customrpmtemplate ()
|
||||
{
|
||||
for kernel in ${1}
|
||||
do
|
||||
if [ -e "${buildroot}/usr/src/kernels/${kernel}" ] ; then
|
||||
if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then
|
||||
# this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :)
|
||||
kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} "
|
||||
|
||||
@@ -342,14 +342,14 @@ print_customrpmtemplate ()
|
||||
print_rpmtemplate_per_kmodpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
||||
|
||||
# create development package
|
||||
if [ -n "${devel}" ]; then
|
||||
if [[ -n "${devel}" ]]; then
|
||||
# create devel package including common headers
|
||||
print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
||||
|
||||
# create devel package
|
||||
print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
|
||||
fi
|
||||
elif [ -e "${prefix}/lib/modules/${kernel}/build/Makefile" ]; then
|
||||
elif [[ -e "${prefix}/lib/modules/${kernel}/build/Makefile" ]]; then
|
||||
# likely a user-build-kernel with available buildfiles
|
||||
# fixme: we should check if uname from Makefile is the same as ${kernel}
|
||||
|
||||
@@ -357,7 +357,7 @@ print_customrpmtemplate ()
|
||||
print_rpmtemplate_per_kmodpkg --custom "${kernel}"
|
||||
|
||||
# create development package
|
||||
if [ -n "${devel}" ]; then
|
||||
if [[ -n "${devel}" ]]; then
|
||||
# create devel package including common headers
|
||||
print_rpmtemplate_kmoddevelpkg --custom "${kernel}"
|
||||
|
||||
@@ -396,7 +396,7 @@ print_rpmtemplate ()
|
||||
# create package
|
||||
print_rpmtemplate_per_kmodpkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
||||
|
||||
if [ -n "${devel}" ]; then
|
||||
if [[ -n "${devel}" ]]; then
|
||||
# create devel package including common headers
|
||||
print_rpmtemplate_kmoddevelpkg "${kernel}" "${kernel##${kernel_verrelarch}}"
|
||||
|
||||
@@ -423,13 +423,13 @@ myprog_help ()
|
||||
echo " --buildroot <dir> -- Build root (place to look for build files)"
|
||||
}
|
||||
|
||||
while [ -n "${1}" ] ; do
|
||||
while [[ -n "${1}" ]] ; do
|
||||
case "${1}" in
|
||||
--filterfile)
|
||||
shift
|
||||
if [ -z "${1}" ] ; then
|
||||
if [[ -z "${1}" ]] ; then
|
||||
error_out 2 "Please provide path to a filter-file together with --filterfile" >&2
|
||||
elif [ ! -e "${1}" ]; then
|
||||
elif [[ ! -e "${1}" ]]; then
|
||||
error_out 2 "Filterfile ${1} not found" >&2
|
||||
fi
|
||||
filterfile="${1}"
|
||||
@@ -437,7 +437,7 @@ while [ -n "${1}" ] ; do
|
||||
;;
|
||||
--kmodname)
|
||||
shift
|
||||
if [ -z "${1}" ] ; then
|
||||
if [[ -z "${1}" ]] ; then
|
||||
error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
|
||||
fi
|
||||
# strip pending -kmod
|
||||
@@ -450,7 +450,7 @@ while [ -n "${1}" ] ; do
|
||||
;;
|
||||
--prefix)
|
||||
shift
|
||||
if [ -z "${1}" ] ; then
|
||||
if [[ -z "${1}" ]] ; then
|
||||
error_out 2 "Please provide a prefix with --prefix" >&2
|
||||
fi
|
||||
prefix="${1}"
|
||||
@@ -458,7 +458,7 @@ while [ -n "${1}" ] ; do
|
||||
;;
|
||||
--repo)
|
||||
shift
|
||||
if [ -z "${1}" ] ; then
|
||||
if [[ -z "${1}" ]] ; then
|
||||
error_out 2 "Please provide the name of the repo together with --repo" >&2
|
||||
fi
|
||||
repo=${1}
|
||||
@@ -466,7 +466,7 @@ while [ -n "${1}" ] ; do
|
||||
;;
|
||||
--for-kernels)
|
||||
shift
|
||||
if [ -z "${1}" ] ; then
|
||||
if [[ -z "${1}" ]] ; then
|
||||
error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
|
||||
fi
|
||||
for_kernels="${1}"
|
||||
@@ -514,28 +514,28 @@ while [ -n "${1}" ] ; do
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -e ./kmodtool-kernel-variants ]; then
|
||||
if [[ -e ./kmodtool-kernel-variants ]]; then
|
||||
kernels_known_variants="$(cat ./kmodtool-kernel-variants)"
|
||||
elif [ -e /usr/share/kmodtool/kernel-variants ] ; then
|
||||
elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then
|
||||
kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)"
|
||||
else
|
||||
kernels_known_variants="@(smp?(-debug)|PAE?(-debug)|debug|kdump|xen|kirkwood|highbank|imx|omap|tegra)"
|
||||
fi
|
||||
|
||||
# general sanity checks
|
||||
if [ -z "${target}" ]; then
|
||||
if [[ -z "${target}" ]]; then
|
||||
error_out 2 "please pass target arch with --target"
|
||||
elif [ -z "${kmodname}" ]; then
|
||||
elif [[ -z "${kmodname}" ]]; then
|
||||
error_out 2 "please pass kmodname with --kmodname"
|
||||
elif [ -z "${kernels_known_variants}" ] ; then
|
||||
elif [[ -z "${kernels_known_variants}" ]] ; then
|
||||
error_out 2 "could not determine known variants"
|
||||
fi
|
||||
|
||||
# go
|
||||
if [ -n "${for_kernels}" ]; then
|
||||
if [[ -n "${for_kernels}" ]]; then
|
||||
# this is easy:
|
||||
print_customrpmtemplate "${for_kernels}"
|
||||
elif [ "${build_kernels}" = "akmod" ]; then
|
||||
elif [[ "${build_kernels}" = "akmod" ]]; then
|
||||
# do only a akmod package
|
||||
print_akmodtemplate
|
||||
print_akmodmeta
|
||||
@@ -543,7 +543,7 @@ else
|
||||
# seems we are on out own to decide for which kernels to build
|
||||
|
||||
# we need more sanity checks in this case
|
||||
if [ -z "${repo}" ]; then
|
||||
if [[ -z "${repo}" ]]; then
|
||||
error_out 2 "please provide repo name with --repo"
|
||||
elif ! command -v "buildsys-build-${repo}-kerneldevpkgs" > /dev/null 2>&1; then
|
||||
error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found"
|
||||
@@ -553,14 +553,14 @@ else
|
||||
cmdoptions="--target ${target}"
|
||||
|
||||
# filterfile to filter list of kernels?
|
||||
if [ -n "${filterfile}" ] ; then
|
||||
if [[ -n "${filterfile}" ]] ; then
|
||||
cmdoptions="${cmdoptions} --filterfile ${filterfile}"
|
||||
fi
|
||||
|
||||
kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdoptions}) ||
|
||||
error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: ${kernel_versions_to_build_for}"
|
||||
|
||||
if [ "${build_kernels}" = "current" ] && [ -z "${noakmod}" ]; then
|
||||
if [[ "${build_kernels}" = "current" ]] && [[ -z "${noakmod}" ]]; then
|
||||
print_akmodtemplate
|
||||
fi
|
||||
|
||||
|
||||
+23
-23
@@ -54,7 +54,7 @@
|
||||
|
||||
BASE_DIR=$(dirname "$0")
|
||||
SCRIPT_COMMON=common.sh
|
||||
if [ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]; then
|
||||
if [[ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]]; then
|
||||
. "${BASE_DIR}/${SCRIPT_COMMON}"
|
||||
else
|
||||
echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
|
||||
@@ -188,7 +188,7 @@ populate "$SRC_DIR" 10 100
|
||||
SRC_DIR="$TEST_DIR/src"
|
||||
SRC_DIR_ZFS="$SRC_DIR/zfs"
|
||||
|
||||
if [ "$COLOR" = "no" ]; then
|
||||
if [[ "$COLOR" = "no" ]]; then
|
||||
COLOR_GREEN=""
|
||||
COLOR_BROWN=""
|
||||
COLOR_RED=""
|
||||
@@ -230,7 +230,7 @@ src_set_vars() {
|
||||
ZFS_DIR="$SRC_DIR_ZFS/$ZFS_TAG"
|
||||
ZFS_URL="$REPO/zfs/tarball/$ZFS_TAG"
|
||||
|
||||
if [ "$TAG" = "installed" ]; then
|
||||
if [[ "$TAG" = "installed" ]]; then
|
||||
ZPOOL_CMD=$(command -v zpool)
|
||||
ZFS_CMD=$(command -v zfs)
|
||||
ZFS_SH="/usr/share/zfs/zfs.sh"
|
||||
@@ -273,7 +273,7 @@ pool_create() {
|
||||
pool_set_vars "$1"
|
||||
src_set_vars "$1"
|
||||
|
||||
if [ "$POOL_TAG" != "installed" ]; then
|
||||
if [[ "$POOL_TAG" != "installed" ]]; then
|
||||
cd "$POOL_DIR_SRC" || fail "Failed 'cd $POOL_DIR_SRC'"
|
||||
fi
|
||||
|
||||
@@ -319,7 +319,7 @@ pool_create() {
|
||||
|
||||
# If the zfs-images directory doesn't exist fetch a copy from Github then
|
||||
# cache it in the $TEST_DIR and update $IMAGES_DIR.
|
||||
if [ ! -d "$IMAGES_DIR" ]; then
|
||||
if [[ ! -d "$IMAGES_DIR" ]]; then
|
||||
IMAGES_DIR="$TEST_DIR/zfs-images"
|
||||
mkdir -p "$IMAGES_DIR"
|
||||
curl -sL "$IMAGES_TAR" | \
|
||||
@@ -331,7 +331,7 @@ fi
|
||||
# list of available images for the reserved keyword 'all'.
|
||||
for TAG in $POOL_TAGS; do
|
||||
|
||||
if [ "$TAG" = "all" ]; then
|
||||
if [[ "$TAG" = "all" ]]; then
|
||||
ALL_TAGS=$(echo "$IMAGES_DIR"/*.tar.bz2 | \
|
||||
sed "s|$IMAGES_DIR/||g;s|.tar.bz2||g")
|
||||
NEW_TAGS="$NEW_TAGS $ALL_TAGS"
|
||||
@@ -341,7 +341,7 @@ for TAG in $POOL_TAGS; do
|
||||
done
|
||||
POOL_TAGS="$NEW_TAGS"
|
||||
|
||||
if [ "$VERBOSE" = "yes" ]; then
|
||||
if [[ "$VERBOSE" = "yes" ]]; then
|
||||
echo "---------------------------- Options ----------------------------"
|
||||
echo "VERBOSE=$VERBOSE"
|
||||
echo "KEEP=$KEEP"
|
||||
@@ -353,11 +353,11 @@ if [ "$VERBOSE" = "yes" ]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [ ! -d "$TEST_DIR" ]; then
|
||||
if [[ ! -d "$TEST_DIR" ]]; then
|
||||
mkdir -p "$TEST_DIR"
|
||||
fi
|
||||
|
||||
if [ ! -d "$SRC_DIR" ]; then
|
||||
if [[ ! -d "$SRC_DIR" ]]; then
|
||||
mkdir -p "$SRC_DIR"
|
||||
fi
|
||||
|
||||
@@ -367,9 +367,9 @@ printf "%-16s" " "
|
||||
for TAG in $SRC_TAGS; do
|
||||
src_set_vars "$TAG"
|
||||
|
||||
if [ "$TAG" = "installed" ]; then
|
||||
if [[ "$TAG" = "installed" ]]; then
|
||||
ZFS_VERSION=$(modinfo zfs | awk '/version:/ { print $2; exit }')
|
||||
if [ -n "$ZFS_VERSION" ]; then
|
||||
if [[ -n "$ZFS_VERSION" ]]; then
|
||||
printf "%-16s" "$ZFS_VERSION"
|
||||
else
|
||||
fail "ZFS is not installed"
|
||||
@@ -388,21 +388,21 @@ printf "%-16s" "Clone ZFS"
|
||||
for TAG in $SRC_TAGS; do
|
||||
src_set_vars "$TAG"
|
||||
|
||||
if [ -d "$ZFS_DIR" ]; then
|
||||
if [[ -d "$ZFS_DIR" ]]; then
|
||||
skip_nonewline
|
||||
elif [ "$ZFS_TAG" = "installed" ]; then
|
||||
elif [[ "$ZFS_TAG" = "installed" ]]; then
|
||||
skip_nonewline
|
||||
else
|
||||
cd "$SRC_DIR" || fail "Failed 'cd $SRC_DIR'"
|
||||
|
||||
if [ ! -d "$SRC_DIR_ZFS" ]; then
|
||||
if [[ ! -d "$SRC_DIR_ZFS" ]]; then
|
||||
mkdir -p "$SRC_DIR_ZFS"
|
||||
fi
|
||||
|
||||
git archive --format=tar --prefix="$ZFS_TAG/ $ZFS_TAG" \
|
||||
-o "$SRC_DIR_ZFS/$ZFS_TAG.tar" &>/dev/null || \
|
||||
rm "$SRC_DIR_ZFS/$ZFS_TAG.tar"
|
||||
if [ -s "$SRC_DIR_ZFS/$ZFS_TAG.tar" ]; then
|
||||
if [[ -s "$SRC_DIR_ZFS/$ZFS_TAG.tar" ]]; then
|
||||
tar -xf "$SRC_DIR_ZFS/$ZFS_TAG.tar" -C "$SRC_DIR_ZFS"
|
||||
rm "$SRC_DIR_ZFS/$ZFS_TAG.tar"
|
||||
echo -n -e "${COLOR_GREEN}Local${COLOR_RESET}\t\t"
|
||||
@@ -422,9 +422,9 @@ printf "%-16s" "Build ZFS"
|
||||
for TAG in $SRC_TAGS; do
|
||||
src_set_vars "$TAG"
|
||||
|
||||
if [ -f "$ZFS_DIR/module/zfs/zfs.ko" ]; then
|
||||
if [[ -f "$ZFS_DIR/module/zfs/zfs.ko" ]]; then
|
||||
skip_nonewline
|
||||
elif [ "$ZFS_TAG" = "installed" ]; then
|
||||
elif [[ "$ZFS_TAG" = "installed" ]]; then
|
||||
skip_nonewline
|
||||
else
|
||||
cd "$ZFS_DIR" || fail "Failed 'cd $ZFS_DIR'"
|
||||
@@ -454,15 +454,15 @@ for TAG in $POOL_TAGS; do
|
||||
mkdir -p "$POOL_DIR_PRISTINE"
|
||||
|
||||
# Use the existing compressed image if available.
|
||||
if [ -f "$POOL_BZIP" ]; then
|
||||
if [[ -f "$POOL_BZIP" ]]; then
|
||||
tar -xjf "$POOL_BZIP" -C "$POOL_DIR_PRISTINE" \
|
||||
--strip-components=1 || \
|
||||
fail "Failed 'tar -xjf $POOL_BZIP"
|
||||
# Use the installed version to create the pool.
|
||||
elif [ "$TAG" = "installed" ]; then
|
||||
elif [[ "$TAG" = "installed" ]]; then
|
||||
pool_create "$TAG"
|
||||
# A source build is available to create the pool.
|
||||
elif [ -d "$POOL_DIR_SRC" ]; then
|
||||
elif [[ -d "$POOL_DIR_SRC" ]]; then
|
||||
pool_create "$TAG"
|
||||
else
|
||||
SKIP=1
|
||||
@@ -471,13 +471,13 @@ for TAG in $POOL_TAGS; do
|
||||
# Verify 'zpool import' works for all listed source versions.
|
||||
for SRC_TAG in $SRC_TAGS; do
|
||||
|
||||
if [ "$SKIP" -eq 1 ]; then
|
||||
if [[ "$SKIP" -eq 1 ]]; then
|
||||
skip_nonewline
|
||||
continue
|
||||
fi
|
||||
|
||||
src_set_vars "$SRC_TAG"
|
||||
if [ "$SRC_TAG" != "installed" ]; then
|
||||
if [[ "$SRC_TAG" != "installed" ]]; then
|
||||
cd "$ZFS_DIR" || fail "Failed 'cd $ZFS_DIR'"
|
||||
fi
|
||||
$ZFS_SH zfs="spa_config_path=$POOL_DIR_COPY"
|
||||
@@ -505,7 +505,7 @@ for TAG in $POOL_TAGS; do
|
||||
printf "\n"
|
||||
done
|
||||
|
||||
if [ "$KEEP" = "no" ]; then
|
||||
if [[ "$KEEP" = "no" ]]; then
|
||||
rm -Rf "$TEST_DIR"
|
||||
fi
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
|
||||
BASE_DIR=${0%/*}
|
||||
SCRIPT_COMMON=common.sh
|
||||
if [ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]; then
|
||||
if [[ -f "${BASE_DIR}/${SCRIPT_COMMON}" ]]; then
|
||||
. "${BASE_DIR}/${SCRIPT_COMMON}"
|
||||
else
|
||||
echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
|
||||
|
||||
Reference in New Issue
Block a user