diff options
author | Ting-Wei Lan <lantw44@gmail.com> | 2019-02-28 21:32:07 +0800 |
---|---|---|
committer | Ting-Wei Lan <lantw44@gmail.com> | 2019-02-28 21:32:07 +0800 |
commit | a2c0986133d8c5ff2bb94c9b1322f61650a1fccb (patch) | |
tree | d0f997903c1364d14be5d0024c17c648218e40b7 /arch | |
parent | f6d5ca1dc86fbd387e898a47f75d945ae79227c5 (diff) | |
download | wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar.gz wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar.bz2 wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar.lz wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar.xz wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.tar.zst wspkg-a2c0986133d8c5ff2bb94c9b1322f61650a1fccb.zip |
Fix all warnings reported by shellcheck
Diffstat (limited to 'arch')
-rwxr-xr-x | arch/arch.deps.sh | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/arch.deps.sh b/arch/arch.deps.sh index f7162ae..c2ddd28 100755 --- a/arch/arch.deps.sh +++ b/arch/arch.deps.sh @@ -9,9 +9,9 @@ quote () { } list_file="$1" -: ${list_file:="arch.list"} -: ${TAR:="tar"} -: ${ARCH_DBPATH:="/var/lib/pacman"} +: "${list_file:="arch.list"}" +: "${TAR:="tar"}" +: "${ARCH_DBPATH:="/var/lib/pacman"}" dbpath_sync="${ARCH_DBPATH}/sync" newline=' @@ -37,15 +37,15 @@ pkg_groups_find () { # Build the list of groups for db in "${dbpath_sync}"/*.db; do msg "==> Loading package database ${db}" - tmpdir="`mktemp -d`" - if [ -z "${tmpdir}" ] || [ "`dirname "${tmpdir}"`" = "/" ]; then + tmpdir="$(mktemp -d)" + if [ -z "${tmpdir}" ] || [ "$(dirname "${tmpdir}")" = "/" ]; then msg "==> Invalid temporary directory ${tmpdir}" exit 1 fi - ${TAR} -xf "${db}" -C "${tmpdir}" + "${TAR}" -xf "${db}" -C "${tmpdir}" for desc in "${tmpdir}"/*/desc; do have_groups=0 - case "`cat "${desc}"`" in + case "$(cat "${desc}")" in *%GROUPS%*) have_groups=1 ;; @@ -91,13 +91,13 @@ for db in "${dbpath_sync}"/*.db; do fi done < "${desc}" done - rm -rf "${tmpdir}" + rm -r -- "${tmpdir}" done loop_first=1 msg "==> Expanding all groups" -for pkg_or_group in `cat "${list_file}"`; do - pkgs="`pkg_groups_find "${pkg_or_group}"`" +while read -r pkg_or_group; do + pkgs="$(pkg_groups_find "${pkg_or_group}")" if [ -z "${pkgs}" ]; then pkgs="${pkg_or_group}" fi @@ -109,4 +109,4 @@ for pkg_or_group in `cat "${list_file}"`; do fi loop_first=0 done -done +done < "${list_file}" |