0002-FSDG-os-release-Default-PRETTY_NAME-to-GNU-Linux-ins.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. From b9c335f8a95094e5fd31a90a0f67613c0081e604 Mon Sep 17 00:00:00 2001
  2. From: Luke Shumaker <lukeshu@parabola.nu>
  3. Date: Wed, 25 May 2016 12:23:40 -0400
  4. Subject: [PATCH 2/7] FSDG: os-release: Default PRETTY_NAME to "GNU/Linux"
  5. instead of "Linux"
  6. ---
  7. man/check-os-release-simple.py | 2 +-
  8. man/check-os-release.py | 2 +-
  9. man/check-os-release.sh | 2 +-
  10. man/kernel-install.xml | 4 ++--
  11. man/os-release.xml | 2 +-
  12. src/basic/os-util.c | 2 +-
  13. src/kernel-install/90-loaderentry.install.in | 2 +-
  14. 7 files changed, 8 insertions(+), 8 deletions(-)
  15. diff --git a/man/check-os-release-simple.py b/man/check-os-release-simple.py
  16. index ce73c77b14..9ad899a814 100644
  17. --- a/man/check-os-release-simple.py
  18. +++ b/man/check-os-release-simple.py
  19. @@ -4,7 +4,7 @@
  20. import platform
  21. os_release = platform.freedesktop_os_release()
  22. -pretty_name = os_release.get('PRETTY_NAME', 'Linux')
  23. +pretty_name = os_release.get('PRETTY_NAME', 'GNU/Linux')
  24. print(f'Running on {pretty_name!r}')
  25. if 'fedora' in [os_release.get('ID', 'linux'),
  26. diff --git a/man/check-os-release.py b/man/check-os-release.py
  27. index 19b193ec76..373b77ed06 100644
  28. --- a/man/check-os-release.py
  29. +++ b/man/check-os-release.py
  30. @@ -29,7 +29,7 @@ def read_os_release():
  31. os_release = dict(read_os_release())
  32. -pretty_name = os_release.get('PRETTY_NAME', 'Linux')
  33. +pretty_name = os_release.get('PRETTY_NAME', 'GNU/Linux')
  34. print(f'Running on {pretty_name!r}')
  35. if 'debian' in [os_release.get('ID', 'linux'),
  36. diff --git a/man/check-os-release.sh b/man/check-os-release.sh
  37. index 12f7ee12cc..084647a38b 100644
  38. --- a/man/check-os-release.sh
  39. +++ b/man/check-os-release.sh
  40. @@ -4,7 +4,7 @@
  41. test -e /etc/os-release && os_release='/etc/os-release' || os_release='/usr/lib/os-release'
  42. . "${os_release}"
  43. -echo "Running on ${PRETTY_NAME:-Linux}"
  44. +echo "Running on ${PRETTY_NAME:-GNU/Linux}"
  45. if [ "${ID:-linux}" = "debian" ] || [ "${ID_LIKE#*debian*}" != "${ID_LIKE}" ]; then
  46. echo "Looks like Debian!"
  47. diff --git a/man/kernel-install.xml b/man/kernel-install.xml
  48. index f3468bbde0..163e233489 100644
  49. --- a/man/kernel-install.xml
  50. +++ b/man/kernel-install.xml
  51. @@ -140,7 +140,7 @@
  52. <filename>$BOOT/loader/entries/<replaceable>ENTRY-TOKEN</replaceable>-<replaceable>KERNEL-VERSION</replaceable>.conf</filename>.
  53. The title of the entry is the <replaceable>PRETTY_NAME</replaceable> parameter specified in
  54. <filename>/etc/os-release</filename> or <filename>/usr/lib/os-release</filename> (if the former
  55. - is missing), or "Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.</para>
  56. + is missing), or "GNU/Linux <replaceable>KERNEL-VERSION</replaceable>", if unset.</para>
  57. <para>If <varname>$KERNEL_INSTALL_LAYOUT</varname> is not "bls", this plugin does nothing.</para></listitem>
  58. @@ -640,7 +640,7 @@
  59. <listitem>
  60. <para>Read by <filename>90-loaderentry.install</filename>. If available,
  61. <varname>PRETTY_NAME=</varname> is read from these files and used as the title of the boot menu
  62. - entry. Otherwise, <literal>Linux <replaceable>KERNEL-VERSION</replaceable></literal> will be
  63. + entry. Otherwise, <literal>GNU/Linux <replaceable>KERNEL-VERSION</replaceable></literal> will be
  64. used.</para>
  65. <xi:include href="version-info.xml" xpointer="v198"/>
  66. diff --git a/man/os-release.xml b/man/os-release.xml
  67. index afdb21fc57..a1f0bbb9f4 100644
  68. --- a/man/os-release.xml
  69. +++ b/man/os-release.xml
  70. @@ -190,7 +190,7 @@
  71. <listitem><para>A pretty operating system name in a format suitable for presentation to the
  72. user. May or may not contain a release code name or OS version of some kind, as suitable. If not
  73. - set, a default of <literal>PRETTY_NAME="Linux"</literal> may be used</para>
  74. + set, a default of <literal>PRETTY_NAME="GNU/Linux"</literal> may be used</para>
  75. <para>Example: <literal>PRETTY_NAME="Fedora 17 (Beefy Miracle)"</literal>.</para></listitem>
  76. </varlistentry>
  77. diff --git a/src/basic/os-util.c b/src/basic/os-util.c
  78. index 79f641b364..efbb08c985 100644
  79. --- a/src/basic/os-util.c
  80. +++ b/src/basic/os-util.c
  81. @@ -476,5 +476,5 @@ const char *os_release_pretty_name(const char *pretty_name, const char *name) {
  82. * exists mostly to ensure we use the same logic wherever possible. */
  83. return empty_to_null(pretty_name) ?:
  84. - empty_to_null(name) ?: "Linux";
  85. + empty_to_null(name) ?: "GNU/Linux";
  86. }
  87. diff --git a/src/kernel-install/90-loaderentry.install.in b/src/kernel-install/90-loaderentry.install.in
  88. index 766d321595..56775e63d0 100755
  89. --- a/src/kernel-install/90-loaderentry.install.in
  90. +++ b/src/kernel-install/90-loaderentry.install.in
  91. @@ -66,7 +66,7 @@ elif [ -f /usr/lib/os-release ]; then
  92. . /usr/lib/os-release
  93. fi
  94. -[ -n "$PRETTY_NAME" ] || PRETTY_NAME="Linux $KERNEL_VERSION"
  95. +[ -n "$PRETTY_NAME" ] || PRETTY_NAME="GNU/Linux $KERNEL_VERSION"
  96. SORT_KEY="$IMAGE_ID"
  97. [ -z "$SORT_KEY" ] && SORT_KEY="$ID"
  98. --
  99. 2.45.2