Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
diff sbin/check-ports @ 706:45051412d0b8
check-ports: modernized somewhat: quoting and "read -r"
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 02 Oct 2024 12:59:44 +0200 |
| parents | 7cb17eaac812 |
| children | f19ae639e7ff |
line wrap: on
line diff
--- a/sbin/check-ports Wed Oct 02 12:48:41 2024 +0200 +++ b/sbin/check-ports Wed Oct 02 12:59:44 2024 +0200 @@ -45,15 +45,16 @@ # # Configuration directory # -: ${CONFIGDIR:=@@ETCDIR@@} +: ${CONFIGDIR:="@@ETCDIR@@"} -test -r "${CONFIGDIR}/pkgtools.conf" && . "${CONFIGDIR}/pkgtools.conf" + +[ -r "${CONFIGDIR}/pkgtools.conf" ] && . "${CONFIGDIR}/pkgtools.conf" # # Mapping configuration: installed package name -> original package name # Note: This is independent of any repo # -: ${PACKAGE_MAPPING:=${CONFIGDIR}/package-mapping.conf} +: ${PACKAGE_MAPPING:="${CONFIGDIR}"/package-mapping.conf} # # Local repository with non-public packages and/or ports with changed @@ -168,7 +169,7 @@ # character. See re_format(7). # _lines=$(/usr/bin/grep -G '^'"${_package}" "${_indexdir}/${_indexfile}") - while read _line ; do + while read -r _line ; do _fqpn="${_line%%|*}" _n=${_fqpn%-*} if [ "${_package}" = "${_n}" ] ; then @@ -212,12 +213,12 @@ _package="$1" if [ -r "${PACKAGE_MAPPING}" ] ; then - while read _n _mapped ; do + while read -r _n _mapped ; do if [ "${_n}" = "${_package}" ] ; then printf '%s' "${_mapped}" return 0 fi - done < ${PACKAGE_MAPPING} + done < "${PACKAGE_MAPPING}" fi return 1 }
