public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/setup] update_services: uidgidlint: make the script shellcheck-clean
@ 2026-06-22 15:56 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-06-22 15:56 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/setup
            Branch : update_services
            Commit : b760dd5ee7dd8721541d178784ed77a8209a2d2d
            Author : Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
            Date   : 2025-03-15T16:00:50+01:00
            Stats  : +9/-9 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/setup/c/b760dd5ee7dd8721541d178784ed77a8209a2d2d?branch=update_services

            Log:
            uidgidlint: make the script shellcheck-clean

[skip changelog]

---
diff --git a/uidgidlint b/uidgidlint
index c45beb3..997cc43 100755
--- a/uidgidlint
+++ b/uidgidlint
@@ -4,23 +4,23 @@ set -o pipefail
 
 # We need a file to look at.
 if [ -z "$*" ] ; then
-	echo Usage: `basename $0` uidgid
+	echo "Usage: $0 uidgid"
 	exit 1
 fi
 error=0
 # The format of the file is (currently)
 for infile in "$@" ; do
-	uidlist=`grep -v '^#' "$infile" | awk '{print $2}' | grep -v -e - | sort -nu`
-	gidlist=`grep -v '^#' "$infile" | awk '{print $3}' | grep -v -e - | sort -nu`
-	for uid in $uidlist ; do
-		if test `grep -v '^#' "$infile" | awk '{print $2}' | grep '^'"$uid"'$' | wc -l` -ne 1 ; then
-			echo Duplicate UID: $uid
+	uidlist=$(grep -v '^#' "$infile" | awk '{print $2}' | grep -v -e - | sort -nu)
+	gidlist=$(grep -v '^#' "$infile" | awk '{print $3}' | grep -v -e - | sort -nu)
+	for uid in $uidlist; do
+		if test "$(grep -v '^#' "$infile" | awk '{print $2}' | grep -c '^'"$uid"'$')" -ne 1 ; then
+			echo "Duplicate UID: $uid"
 			error=1
 		fi
 	done
-	for gid in $gidlist ; do
-		if test `grep -v '^#' "$infile" | awk '{print $3}' | grep '^'"$gid"'$' | wc -l` -ne 1 ; then
-			echo Duplicate GID: $gid
+	for gid in $gidlist; do
+		if test "$(grep -v '^#' "$infile" | awk '{print $3}' | grep -c '^'"$gid"'$')" -ne 1 ; then
+			echo "Duplicate GID: $gid"
 			error=1
 		fi
 	done

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

only message in thread, other threads:[~2026-06-22 15:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-22 15:56 [rpms/setup] update_services: uidgidlint: make the script shellcheck-clean 

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