1
0
forked from pool/sysuser-tools

Accepting request 901701 from Base:System

- Bump version up to 3.1. The --replace parameter only appeared in
  systemd 238, so we need to ensure to get the update order correct
  for sysuser-generate when using the 3rd command line parameters:
  * systemd -> sysuser-tools -> system-{user|group}-FOO.
- Add dependency on systemd >=238 if systemd is installed to
  sysuser-shadow
- update sysuser_requires to request sysuser-shadow 3.1

- Support systemd-sysusers --replace=/usr/lib/sysusers.d/ option
- sysusers-generate-pre: only use first argument for grep
- sysusers2shadow.sh: use "run" prefix for systemd-sysusers call
- macros.sysusers: fix typo

OBS-URL: https://build.opensuse.org/request/show/901701
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/sysuser-tools?expand=0&rev=18
This commit is contained in:
Dominique Leuenberger 2021-07-01 05:05:26 +00:00 committed by Git OBS Bridge
commit 42ef6462ef
5 changed files with 32 additions and 7 deletions

View File

@ -10,7 +10,7 @@
# add "%sysusers_generate_pre <source file> <account> [<config>]" to build section
#
## <source file> is the source file as defined in the spec file header
## <account> is just a random name, th output file will be "<account>.pre"
## <account> is just a random name, the output file will be "<account>.pre"
## <config> is the name of the configuration file as stored in
## /usr/lib/sysusers.d/<config>
#
@ -18,7 +18,7 @@
#
###
%sysusers_requires Requires(pre): sysuser-shadow
%sysusers_requires Requires(pre): sysuser-shadow >= 3.1
%sysusers_generate_pre() \
%{_prefix}/lib/rpm/sysusers-generate-pre "%1" "%3" > "%2".pre

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Mon Jun 21 09:56:17 UTC 2021 - Dominique Leuenberger <dimstar@opensuse.org>
- Bump version up to 3.1. The --replace parameter only appeared in
systemd 238, so we need to ensure to get the update order correct
for sysuser-generate when using the 3rd command line parameters:
* systemd -> sysuser-tools -> system-{user|group}-FOO.
- Add dependency on systemd >=238 if systemd is installed to
sysuser-shadow
- update sysuser_requires to request sysuser-shadow 3.1
-------------------------------------------------------------------
Mon Jun 7 11:11:27 UTC 2021 - Thorsten Kukuk <kukuk@suse.com>
- Support systemd-sysusers --replace=/usr/lib/sysusers.d/ option
- sysusers-generate-pre: only use first argument for grep
- sysusers2shadow.sh: use "run" prefix for systemd-sysusers call
- macros.sysusers: fix typo
-------------------------------------------------------------------
Sat May 8 13:19:03 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>

View File

@ -17,7 +17,7 @@
Name: sysuser-tools
Version: 3.0
Version: 3.1
Release: 0
Summary: Auto provides for system users
License: MIT
@ -41,6 +41,12 @@ Group: System/Packages
Requires(pre): (/usr/sbin/useradd or busybox)
# prefer original shadow over busybox by default
Suggests: shadow
# sysusers2shdow uses sysusers2shadow uses systemd-sysusers if available. And we might pass --replace to it
# --replace only appeared in systemd 238,so we want to ensure: if we have systemd, it must be recent enough
# the Requires(pre) statement is to ensure we get it at any moment recent enough, not only at the end of
# transactions, otherwise upgrades might randomly fail
Requires(pre): (systemd >= 238 if systemd)
Requires: (systemd >= 238 if systemd)
%description -n sysuser-shadow
This package contians a tool, which expects as input a sysusers.d

View File

@ -1,6 +1,6 @@
#!/bin/sh
# pass systemd sysusers config paths as argument to this script.
echo "/usr/sbin/sysusers2shadow $3 <<\"EOF\" || [ -f /.buildenv ]"
grep -he '^[ugmr]' "$@"
echo "/usr/sbin/sysusers2shadow $2 <<\"EOF\" || [ -f /.buildenv ]"
grep -he '^[ugmr]' "$1"
echo 'EOF'

View File

@ -9,11 +9,11 @@ run() {
if [ -x /usr/bin/systemd-sysusers ] && [ -e /proc/version ]; then
if [ -n "$1" ]; then
if [ -n "$1" ] && [ "$1" != "%3" ]; then
REPLACE_ARG="--replace=/usr/lib/sysusers.d/$1" ||:
fi
# Use systemd-sysusers and let it read the input directly from stdin
/usr/bin/systemd-sysusers $REPLACE_ARG -
run /usr/bin/systemd-sysusers $REPLACE_ARG -
else
# Absolute path to busybox, if found