From: Ian Kelling Date: Sat, 11 Feb 2017 08:45:35 +0000 (-0800) Subject: improve code style X-Git-Url: https://iankelling.org/git/?p=automated-distro-installer;a=commitdiff_plain;h=b8ba20ee90ec04b90a294ffc145e204b7e8fdc6c improve code style --- diff --git a/fai/config/hooks/partition.DEFAULT b/fai/config/hooks/partition.DEFAULT index 8dffd82..9914a45 100755 --- a/fai/config/hooks/partition.DEFAULT +++ b/fai/config/hooks/partition.DEFAULT @@ -65,20 +65,21 @@ add-part() { # add partition suffix to $dev echo $ret } -bootdev() { add-part $@ $bootn; } +# Functions here are commented because they are unused, but left +# intentionally because they follow the pattern and could be useful in +# the future. +#bootdev() { add-part $@ $bootn; } rootdev() { add-part $@ $rootn; } swapdev() { add-part $@ $swapn; } grub_extdev() { add-part $@ $grub_extn; } -# Commented because it's not used, but left because it -# finishes the pattern and if we ever do need to use it, it's here. #bios_grubdev() { add-part $@ $bios_grubn; } crypt-dev() { echo /dev/mapper/crypt_dev_${1##*/}; } crypt-name() { echo crypt_dev_${1##*/}; } root-cryptdev() { crypt-dev $(rootdev $@); } -swap-cryptdev() { crypt-dev $(swapdev $@); } -root-cryptname() { crypt-name $(rootdev $@); } -swap-cryptname() { crypt-name $(swapdev $@); } +#swap-cryptdev() { crypt-dev $(swapdev $@); } +#root-cryptname() { crypt-name $(rootdev $@); } +#swap-cryptname() { crypt-name $(swapdev $@); } ##### end function defs @@ -115,8 +116,8 @@ fi for dev in ${short_devs[@]}; do if $partition; then break; fi y=$(readlink -f $dev) - x=($y[0-9]) - [[ ${#x[@]} == "${lastn}" ]] || partition=true + arr=($y[0-9]) + [[ ${#arr[@]} == "${lastn}" ]] || partition=true for (( i=1; i <= lastn; i++ )); do [[ -e ${dev}$i ]] || partition=true done