public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/fonts] rhel9: default_fonts: Fix shellcheck error
@ 2026-08-13 10:29 Akira TAGOH
  0 siblings, 0 replies; only message in thread
From: Akira TAGOH @ 2026-08-13 10:29 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : tests/fonts
Branch : rhel9
Commit : 26a4cb291c1007434d15108cf5100209058042b9
Author : Akira TAGOH <akira@tagoh.org>
Date   : 2024-11-15T18:01:44+09:00
Stats  : +11/-6 in 1 file(s)
URL    : https://src.fedoraproject.org/tests/fonts/c/26a4cb291c1007434d15108cf5100209058042b9?branch=rhel9

Log:
default_fonts: Fix shellcheck error

---
diff --git a/tests/default_fonts/test.sh b/tests/default_fonts/test.sh
index 1c3a381..45a43ca 100755
--- a/tests/default_fonts/test.sh
+++ b/tests/default_fonts/test.sh
@@ -4,6 +4,7 @@
 
 . /usr/share/beakerlib/beakerlib.sh || exit 1
 
+PACKAGE=${PACKAGE:-"blahblah-fonts"}
 DEFAULT_SANS=${DEFAULT_SANS:-0}
 DEFAULT_SERIF=${DEFAULT_SERIF:-0}
 DEFAULT_MONO=${DEFAULT_MONO:-0}
@@ -17,10 +18,15 @@ function test_default_fonts {
     local pkg=${1:-"unknown package"}
     local fcfamily=${2:-"unknown family"}
     local fclang=${3:-"en"}
+    # shellcheck disable=SC2034
     local defaultsans=${4:-0}
+    # shellcheck disable=SC2034
     local defaultserif=${5:-0}
+    # shellcheck disable=SC2034
     local defaultmono=${6:-0}
+    # shellcheck disable=SC2034
     local defaultemoji=${7:-0}
+    # shellcheck disable=SC2034
     local defaultmath=${8:-0}
 
     if [ "$fclang" == "-" ]; then
@@ -34,8 +40,7 @@ function test_default_fonts {
                 v="default$g"
                 rlRun "fc-match -f \"%{family[0]}\\n\" \":family=$g:lang=${l/und*/en}\" | tee output" 0 "Checking $g default font for lang ${l/und*/en}"
                 if [ ${!v} -eq 1 ]; then
-                    rlAssertGrep "^$FONT_FAMILY\$" "output"
-                    if [ $? -ne 0 ]; then
+                    if ! rlAssertGrep "^$fcfamily\$" "output"; then
                         rlLogInfo "    Hints:"
                         rlLogInfo "      This failed because of:"
                         rlLogInfo "        1) The actual result of font may have higher priority."
@@ -43,8 +48,7 @@ function test_default_fonts {
                         rlLogInfo "        3) The value of DEFAULT_${g^^} may be wrong."
                     fi
                 elif [ ${!v} -eq 0 ]; then
-                    rlAssertNotGrep "^$FONT_FAMILY\$" "output"
-                    if [ $? -ne 0 ]; then
+                    if ! rlAssertNotGrep "^$fcfamily\$" "output"; then
                         rlLogInfo "    Hints:"
                         rlLogInfo "      This failed because of:"
                         rlLogInfo "        1) The actual result of font may have higher priority."
@@ -64,6 +68,7 @@ rlJournalStart
     rlPhaseStartSetup
     {
         rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+        # shellcheck disable=SC2154
         rlRun "pushd $tmp"
         rlRun "set -o pipefail"
     }
@@ -71,8 +76,8 @@ rlJournalStart
 
     if [ -n "$VARLIST" ] && [ -f "$TMT_TREE/plans/$VARLIST" ]; then
         rlLogInfo "Reading variables from $VARLIST"
-        cat "$TMT_TREE/plans/$VARLIST" | grep -E -v "^#" | while IFS=";" read -r PACKAGE FONT_ALIAS FONT_LANG FONT_WIDTH FONT_FAMILY DEFAULT_SANS DEFAULT_SERIF DEFAULT_MONO DEFAULT_EMOJI DEFAULT_MATH dummy; do
-            test_default_fonts "$PACKAGE" "$FONT_FAMILY" "$FONT_LANG" "$DEFAULT_SANS" "$DEFAULT_SERIF" "$DEFAULT_MONO" "$DEFAULT_EMOJI" "$DEFAULT_MATH"
+        grep -E -v "^#" "$TMT_TREE/plans/$VARLIST" | while IFS=";" read -r _PACKAGE _FONT_ALIAS _FONT_LANG _FONT_WIDTH _FONT_FAMILY _DEFAULT_SANS _DEFAULT_SERIF _DEFAULT_MONO _DEFAULT_EMOJI _DEFAULT_MATH dummy; do
+            test_default_fonts "$_PACKAGE" "$_FONT_FAMILY" "$_FONT_LANG" "$_DEFAULT_SANS" "$_DEFAULT_SERIF" "$_DEFAULT_MONO" "$_DEFAULT_EMOJI" "$_DEFAULT_MATH"
         done
     else
         test_default_fonts "$PACKAGE" "$FONT_FAMILY" "$FONT_LANG" "$DEFAULT_SANS" "$DEFAULT_SERIF" "$DEFAULT_MONO" "$DEFAULT_EMOJI" "$DEFAULT_MATH"

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-13 10:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-13 10:29 [tests/fonts] rhel9: default_fonts: Fix shellcheck error Akira TAGOH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox