mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
282bda46f1
This adds %q, %A and %M specifiers to tmpfiles: - %A and %M were previously added to tmpfiles.d man page, but not to specifier_table - %q is added via COMMON_SYSTEM_SPECIFIERS
29 lines
635 B
Bash
Executable File
29 lines
635 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
# Test specifiers
|
|
set -eux
|
|
|
|
rm -rf /tmp/specifiers
|
|
|
|
root='/tmp/specifiers/root'
|
|
mkdir -p $root/etc
|
|
cat >$root/etc/os-release <<EOF
|
|
ID=the-id
|
|
BUILD_ID=build-id
|
|
VARIANT_ID=variant-id
|
|
VERSION_ID=version-id
|
|
IMAGE_ID=image-id
|
|
IMAGE_VERSION=22
|
|
EOF
|
|
|
|
systemd-tmpfiles --create - --root=$root <<EOF
|
|
f /os-release2 - - - - ID=%o\n
|
|
w+ /os-release2 - - - - BUILD_ID=%B\n
|
|
w+ /os-release2 - - - - VARIANT_ID=%W\n
|
|
w+ /os-release2 - - - - VERSION_ID=%w\n
|
|
w+ /os-release2 - - - - IMAGE_ID=%M\n
|
|
w+ /os-release2 - - - - IMAGE_VERSION=%A\n
|
|
EOF
|
|
|
|
diff $root/etc/os-release $root/os-release2
|