systemd/SOURCES/0168-man-os-release-add-a-note-about-repeating-entries.patch
2022-09-28 19:49:55 +00:00

34 lines
1.4 KiB
Diff

From b4087419bac3cd656a3f8ba82653750fd60c19b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Tue, 8 Mar 2022 10:10:12 +0100
Subject: [PATCH] man/os-release: add a note about repeating entries
We didn't actually say that keys should not be repeated. At least the
examples in docs (both python and shell) would do that, and any simple
parser that builds a dictionary would most likely behave the same way.
But let's document this expectation, but also say how to deal with malformed
files.
(cherry picked from commit 3a84a3c9dfde5182398a6d0863a2b2fe90a936b1)
Related: #2082131
---
man/os-release.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/man/os-release.xml b/man/os-release.xml
index 1826a60d1a..baff088bc0 100644
--- a/man/os-release.xml
+++ b/man/os-release.xml
@@ -75,6 +75,10 @@
from earliest boot on, and hence must be located on the root file
system.</para>
+ <para><filename>os-release</filename> must not contain repeating keys. Nevertheless, readers should pick
+ the entries later in the file in case of repeats, similarly to how a shell sourcing the file would. A
+ reader may warn about repeating entries.</para>
+
<para>For a longer rationale for <filename>os-release</filename>
please refer to the <ulink
url="http://0pointer.de/blog/projects/os-release">Announcement of <filename>/etc/os-release</filename></ulink>.</para>