Date: Sat, 20 May 2023 11:21:36 GMT From: "Bjoern A. Zeeb" <bz@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 5138ffa87716 - main - fwget: remove logging redirects Message-ID: <202305201121.34KBLaGL096849@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=5138ffa877161ddfe3a690a45cf716e09c5e865a commit 5138ffa877161ddfe3a690a45cf716e09c5e865a Author: Bjoern A. Zeeb <bz@FreeBSD.org> AuthorDate: 2023-05-12 11:47:49 +0000 Commit: Bjoern A. Zeeb <bz@FreeBSD.org> CommitDate: 2023-05-20 11:20:41 +0000 fwget: remove logging redirects After adding addpkg() in 10aa369afd9946da18ae51b07aeadc3314fba56d the redirects are no longer needed. We can now log directly so simplify the code. Reported by: manu Reviewed by: manu Differential Revision: https://reviews.freebsd.org/D40077 --- usr.sbin/fwget/fwget.sh | 11 ++--------- usr.sbin/fwget/pci/pci | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/usr.sbin/fwget/fwget.sh b/usr.sbin/fwget/fwget.sh index 5e50569c3991..89177d936107 100644 --- a/usr.sbin/fwget/fwget.sh +++ b/usr.sbin/fwget/fwget.sh @@ -44,14 +44,9 @@ EOF exit 1 } -log_start() -{ - exec 3>&1 4>&2 -} - log() { - echo $@ 1>&3 + echo $@ } log_verbose() @@ -60,7 +55,7 @@ log_verbose() return fi - echo $@ 1>&3 + echo $@ } addpkg() @@ -82,8 +77,6 @@ addpkg() DRY_RUN=n VERBOSE=n -log_start - while [ $# -gt 0 ]; do case $1 in -n) diff --git a/usr.sbin/fwget/pci/pci b/usr.sbin/fwget/pci/pci index b3514c3ab43d..6a66049842e2 100644 --- a/usr.sbin/fwget/pci/pci +++ b/usr.sbin/fwget/pci/pci @@ -94,13 +94,13 @@ pci_search_packages() fi device=$(pci_get_device "${fulldevice}") - log_verbose "Trying to match device ${device} in class ${class} and vendor ${vendor} with pci_${class}_${vendor}" 1>&3 + log_verbose "Trying to match device ${device} in class ${class} and vendor ${vendor} with pci_${class}_${vendor}" if [ ! -f ${LIBEXEC_PATH}/pci_${class}_${vendor} ]; then class=$(pci_fixup_class ${class} ${vendor}) if [ -z "${class}" ]; then continue fi - log_verbose "Trying to match device ${device} in fixed up class ${class} and vendor ${vendor} with pci_${class}_${vendor}" 1>&3 + log_verbose "Trying to match device ${device} in fixed up class ${class} and vendor ${vendor} with pci_${class}_${vendor}" if [ ! -f ${LIBEXEC_PATH}/pci_${class}_${vendor} ]; then continue fi
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202305201121.34KBLaGL096849>