logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git
commit: fd07937887e0e99840785719e86e42162fe5e798
parent 10f757d836f8ae42623f6cad2379930939aa0e75
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Thu,  3 Mar 2022 22:01:47 +0100

fix shellcheck issues

Diffstat:

MMakefile2+-
Mtest-bin/shellcheck2+-
Mtest-bin/tee2++
Mtest-bin/tty2--
Mtest_functions.sh1+
5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile @@ -10,7 +10,7 @@ test: all .PHONY: lint lint: - $(SHELLCHECK) ./configure test_all.sh + $(SHELLCHECK) ./configure test_all.sh test_functions.sh SHELLCHECK=${SHELLCHECK} ./test-bin/shellcheck cd bin ; $(MAKE) lint cd sbin ; $(MAKE) lint diff --git a/test-bin/shellcheck b/test-bin/shellcheck @@ -8,4 +8,4 @@ ${SHELLCHECK} "$0" cd "$(dirname "$0")" # shellcheck disable=SC2046 -${SHELLCHECK} --shell=sh $(grep atf_test_program ./Kyuafile | sed -E 's;^atf_test_program\{name="([^"]*)".*;./\1;') +${SHELLCHECK} --shell=sh -x $(grep atf_test_program ./Kyuafile | sed -E 's;^atf_test_program\{name="([^"]*)".*;./\1;') diff --git a/test-bin/tee b/test-bin/tee @@ -43,7 +43,9 @@ devfull_body() { [ "$(uname -s)" = "NetBSD" ] && atf_expect_fail "NetBSD ignoring write errors for fputs()" [ "$(uname -s)" = "FreeBSD" ] && atf_expect_fail "FreeBSD ignoring write errors for fputs()" + # shellcheck disable=SC1112 atf_check -s exit:1 -e 'inline:Error writing ‘<stdout>’: No space left on device\n' sh -c '../bin/tee <inputs/all_bytes >/dev/full' + # shellcheck disable=SC1112 atf_check -s exit:1 -e 'inline:Error writing ‘<stdout>’: No space left on device\n' sh -c '../bin/tee - <inputs/all_bytes >/dev/full' } diff --git a/test-bin/tty b/test-bin/tty @@ -25,8 +25,6 @@ out_devfull_body() { [ "$(uname -s)" = "NetBSD" ] && atf_expect_fail "NetBSD ignoring write errors for puts()" [ "$(uname -s)" = "FreeBSD" ] && atf_expect_fail "FreeBSD ignoring write errors for puts()" - tty_out="$(tty)" - atf_check -s "exit:2" sh -c '../bin/tty >/dev/full' } diff --git a/test_functions.sh b/test_functions.sh @@ -1,3 +1,4 @@ +#!/bin/sh has_glibc() { test -f /usr/include/features.h && grep -q '#define\W__GLIBC__' /usr/include/features.h }