public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [tests/fonts] rhel9: lang_coverage: 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 : 65b75aa0d06f65da08fbf07a9eb5ce4dd53fc2fd
Author : Akira TAGOH <akira@tagoh.org>
Date : 2024-11-15T18:42:40+09:00
Stats : +14/-14 in 1 file(s)
URL : https://src.fedoraproject.org/tests/fonts/c/65b75aa0d06f65da08fbf07a9eb5ce4dd53fc2fd?branch=rhel9
Log:
lang_coverage: fix shellcheck error
---
diff --git a/tests/lang_coverage/test.sh b/tests/lang_coverage/test.sh
index 447b935..da82202 100755
--- a/tests/lang_coverage/test.sh
+++ b/tests/lang_coverage/test.sh
@@ -12,19 +12,18 @@ VARLIST=${VARLIST:-}
function get_font_path {
local pkg=$1
- rpm -ql $pkg|grep /usr/share/fonts/
+ rpm -ql "$pkg" | grep /usr/share/fonts/
}
function check_exception {
local exregex=$1
local file=$2
- if [ "x$exregex" == "x" ]; then
- echo -n 1
- else
- echo $file | grep -E "$exregex" 2>&1 > /dev/null
- echo -n $?
+ if [ "$exregex" == "" ]; then
+ return 1
fi
+ echo "$file" | grep -E "$exregex" > /dev/null 2>&1
+ return $?
}
function test_pkg {
@@ -32,7 +31,7 @@ function test_pkg {
rlPhaseStartTest "Package installation test for $pkg"
{
- rlAssertRpm $pkg
+ rlAssertRpm "$pkg"
}
rlPhaseEnd
}
@@ -42,19 +41,19 @@ function test_lang_coverage {
local fclang=${2:-"en"}
local fcexpat=${3:-}
- test_pkg $pkg
+ test_pkg "$pkg"
rlPhaseStartTest "Language coverage test for $pkg"
{
- for f in $(get_font_path $pkg); do
- if echo $f|grep -Eq "\.(t1|ttf|otf|ttc|otc|pcf.*|pfa)$"; then
+ for f in $(get_font_path "$pkg"); do
+ if echo "$f"|grep -Eq "\.(t1|ttf|otf|ttc|otc|pcf.*|pfa)$"; then
set -f
if [ "$fclang" == "-" ]; then
rlLogInfo "Skipping $f (no language provided)"
- elif [ $(check_exception $fcexpat $f) -ne 0 ] && [ -f $f ]; then
+ elif ! check_exception "$fcexpat" "$f" && [ -f "$f" ]; then
IFS=, read -ra langlist <<< "$fclang"
for l in "${langlist[@]}"; do
- rlRun "fc-validate -l $l $f" 0 "$pkg:$(basename $f): Check language coverage for $l"
+ rlRun "fc-validate -l $l $f" 0 "$pkg:$(basename "$f"): Check language coverage for $l"
done
else
rlLogInfo "Skipping $f (according to FONT_LANG_EXCLUDE_FILES)"
@@ -73,6 +72,7 @@ rlJournalStart
rlPhaseStartSetup
{
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
+ # shellcheck disable=SC2154
rlRun "pushd $tmp"
rlRun "set -o pipefail"
}
@@ -80,8 +80,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 SANS SERIF MONO EMOJI MATH FONT_LANG_EXCLUDE_FILES dummy; do
- test_lang_coverage "$PACKAGE" "$FONT_LANG" "$FONT_LANG_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 dummy; do
+ test_lang_coverage "$_PACKAGE" "$_FONT_LANG" "$_FONT_LANG_EXCLUDE_FILES"
done
else
test_lang_coverage "$PACKAGE" "$FONT_LANG" "$FONT_LANG_EXCLUDE_FILES"
^ 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: lang_coverage: 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