public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Akira TAGOH <akira@tagoh.org>
To: git-commits@fedoraproject.org
Subject: [tests/fonts] rhel9: generic_alias: fix shellcheck error
Date: Thu, 13 Aug 2026 10:29:25 GMT	[thread overview]
Message-ID: <178661696578.1.6266979056384181148.tests-fonts-22d3ffb43faa@fedoraproject.org> (raw)

A new commit has been pushed.

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

Log:
generic_alias: fix shellcheck error

---
diff --git a/tests/generic_alias/test.sh b/tests/generic_alias/test.sh
index 4e0d2c6..24d5967 100755
--- a/tests/generic_alias/test.sh
+++ b/tests/generic_alias/test.sh
@@ -16,10 +16,10 @@ function check_exception {
     local exregex=$1
     local file=$2
 
-    if [ "x$exregex" == "x" ]; then
+    if [ "$exregex" == "" ]; then
         echo -n 1
     else
-        echo $file | grep -E "$exregex" 2>&1 > /dev/null
+        echo "$file" | grep -E "$exregex" > /dev/null 2>&1
         echo -n $?
     fi
 }
@@ -29,11 +29,12 @@ function prepare_test {
     local fcexpat=${2:-}
     local conffiles=()
 
-    for f in $(rpm -ql $pkg | grep conf.d | tr '\n' ' '); do
-        [[ $(check_exception $fcexpat $f) -ne 0 ]] && conffiles+=($f)
+    for f in $(rpm -ql "$pkg" | grep conf.d | tr '\n' ' '); do
+        [[ $(check_exception "$fcexpat" "$f") -ne 0 ]] && conffiles+=("$f")
     done
     rlAssertNotEquals "Check if config is available" ${#conffiles[@]} 0
     rlRun "conf=\$(for i in \${conffiles[@]}; do echo \"  <include>\$i</include>\"; done)"
+    # shellcheck disable=SC2154
     rlRun "cat <<_E_> $tmpconfd/$pkg.conf
 <fontconfig>
   <dir>/usr/share/fonts</dir>
@@ -48,7 +49,7 @@ function test_pkg {
 
     rlPhaseStartTest "Package installation test for $pkg"
     {
-        rlAssertRpm $pkg
+        rlAssertRpm "$pkg"
     }
     rlPhaseEnd
 }
@@ -63,19 +64,19 @@ function test_generic_alias {
 
     rlPhaseStartTest "Generic alias test for $pkg"
     {
-        prepare_test $pkg $fcexpat
+        prepare_test "$pkg" "$fcexpat"
         rlRun "cat $tmpconfd/$pkg.conf"
         if [ "$fclang" == "-" ]; then
             rlLogInfo "$pkg:$fcfamily: Skipped."
         else
             rlRun "FONTCONFIG_FILE=$tmpconfd/$pkg.conf fc-match -f \"%{family[0]}\\n\" \":family=$fcfamily:lang=$fclang:width=$fcwidth\" > output" 0 "Matching a font"
             rlLogInfo "    Actual result: $(cat output)"
-            rlAssertGrep "^$fcresult\$" "output"
-            if [ $? -ne 0 ]; then
+            if ! rlAssertGrep "^$fcresult\$" "output"; then
                 rlLogInfo "    Hints:"
                 rlLogInfo "      This failed because of:"
                 rlLogInfo "        1) There are no generic alias rule in fontconfig file."
             fi
+        fi
     }
     rlPhaseEnd
 }
@@ -85,6 +86,7 @@ rlJournalStart
     rlPhaseStartSetup
     {
         rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+        # shellcheck disable=SC2154
         rlRun "pushd $tmp"
         rlRun "set -o pipefail"
         rlRun "cachedir=\$(pkg-config --variable cachedir fontconfig)" 0 "Set cachedir"
@@ -94,9 +96,9 @@ 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 SANS SERIF MONO EMOJI MATH FONT_LANG_EXCLUDE_FILES FONT_VALIDATE_EXCLUDE_FILES FONT_CONF_EXCLUDE_FILES dummy; do
-            test_pkg "$PACKAGE"
-            test_generic_alias "$PACKAGE" "$FONT_ALIAS" "$FONT_LANG" "$FONT_WIDTH" "$FONT_FAMILY" "$FONT_CONF_EXCLUDE_FILES"
+        grep -E -v "^#" "$TMT_TREE/plans/$VARLIST" | while IFS=";" read -r _PACKAGE _FONT_ALIAS _FONT_LANG _FONT_WIDTH _FONT_FAMILY SANS SERIF MONO EMOJI MATH FONT_LANG_EXCLUDE_FILES FONT_VALIDATE_EXCLUDE_FILES _FONT_CONF_EXCLUDE_FILES dummy; do
+            test_pkg "$_PACKAGE"
+            test_generic_alias "$_PACKAGE" "$_FONT_ALIAS" "$_FONT_LANG" "$_FONT_WIDTH" "$_FONT_FAMILY" "$_FONT_CONF_EXCLUDE_FILES"
         done
     else
         test_pkg "$PACKAGE"

                 reply	other threads:[~2026-08-13 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178661696578.1.6266979056384181148.tests-fonts-22d3ffb43faa@fedoraproject.org \
    --to=akira@tagoh.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox