From 72476e07b536e7cada545b5bf7578412f1a1c670 Mon Sep 17 00:00:00 2001 From: shenxiangwei Date: Mon, 24 Oct 2022 20:13:47 +0800 Subject: [PATCH] uidgid:simplifytableformatbyproperlycommentinglines --- ...-table-format-by-properly-commenting.patch | 61 +++++++++++++++++++ setup.spec | 6 +- 2 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 backport-uidgid-simplify-table-format-by-properly-commenting.patch diff --git a/backport-uidgid-simplify-table-format-by-properly-commenting.patch b/backport-uidgid-simplify-table-format-by-properly-commenting.patch new file mode 100644 index 0000000..0a87878 --- /dev/null +++ b/backport-uidgid-simplify-table-format-by-properly-commenting.patch @@ -0,0 +1,61 @@ +From c2d8d46b12679490896a795111919d18c8faa089 Mon Sep 17 00:00:00 2001 +From: Luca BRUNO +Date: Mon, 30 May 2022 09:41:18 +0000 +Subject: [PATCH] uidgid: simplify table format by properly commenting lines + +This tweaks the `uidgid` table by commenting out some lines which +do not actually hold any UID/GID. +The goal is to have this data in a more structured format, in order +to be more machine-friendly and easier to parse. +--- + uidgid | 6 +++--- + uidgidlint | 8 ++++---- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/uidgid b/uidgid +index 3396364..8381b88 100644 +--- a/uidgid ++++ b/uidgid +@@ -1,4 +1,4 @@ +-NAME UID GID HOME SHELL PACKAGES ++#NAME UID GID HOME SHELL PACKAGES + root 0 0 /root /bin/bash setup + bin 1 1 /bin /sbin/nologin setup + daemon 2 2 /sbin /sbin/nologin setup +@@ -164,6 +164,6 @@ systemd-journal - 190 - - systemd + #systemd-journal-gateway 191 191 / /sbin/nologin systemd #dynamic on new systems, removed Dec2014, can be freed if necessary later + systemd-network 192 192 / /sbin/nologin systemd + systemd-resolve 193 193 / /sbin/nologin systemd +-gnats ? ? ? ? gnats, gnats-db +-listar ? ? ? ? listar ++#gnats ? ? ? ? gnats, gnats-db ++#listar ? ? ? ? listar + nobody 65534 65534 / /sbin/nologin setup +diff --git a/uidgidlint b/uidgidlint +index 9c88ab8..902f55e 100755 +--- a/uidgidlint ++++ b/uidgidlint +@@ -7,16 +7,16 @@ fi + error=0 + # The format of the file is (currently) + for infile in "$@" ; do +- uidlist=`tail -n +2 "$infile" | awk '{print $2}' | grep -v '?' | grep -v -e - | sort -nu` +- gidlist=`tail -n +2 "$infile" | awk '{print $3}' | grep -v '?' | grep -v -e - | sort -nu` ++ 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 `tail -n +2 "$infile" | awk '{print $2}' | grep '^'"$uid"'$' | wc -l` -ne 1 ; then ++ if test `grep -v '^#' "$infile" | awk '{print $2}' | grep '^'"$uid"'$' | wc -l` -ne 1 ; then + echo Duplicate UID: $uid + error=1 + fi + done + for gid in $gidlist ; do +- if test `tail -n +2 "$infile" | awk '{print $3}' | grep '^'"$gid"'$' | wc -l` -ne 1 ; then ++ if test `grep -v '^#' "$infile" | awk '{print $3}' | grep '^'"$gid"'$' | wc -l` -ne 1 ; then + echo Duplicate GID: $gid + error=1 + fi +-- +2.27.0 + diff --git a/setup.spec b/setup.spec index 6654dca..3dd7c8d 100644 --- a/setup.spec +++ b/setup.spec @@ -1,13 +1,14 @@ Summary: A set of system configuration and setup files Name: setup Version: 2.13.9.1 -Release: 1 +Release: 2 License: Public Domain Group: System Environment/Base URL: https://pagure.io/setup/ Source0: http://releases.pagure.org/%{name}/%{name}-%{version}.tar.bz2 Patch0: support-filesystems-xfs.patch Patch1: source-cshlocal-when-login.patch +Patch2: backport-uidgid-simplify-table-format-by-properly-commenting.patch BuildArch: noarch BuildRequires: systemd BuildRequires: bash tcsh perl-interpreter @@ -117,6 +118,9 @@ end %{_tmpfilesdir}/%{name}.conf %changelog +* Mon Oct 24 2022 hongjinghao - 2.13.9.1-2 +- uidgid:simplify table format by properly commenting lines + * Tue Feb 8 2022 yangzhuangzhuang - 2.13.9.1-1 - Type:enhancement - ID:NA