From 39337c9fd14a969af6be65c34c66fe162e0b463d3b238dc4b09744ec52f77fee Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 4 Apr 2023 09:04:01 +0000 Subject: [PATCH 1/2] Accepting request 1077021 from home:dimstar:Factory - Add man-propose-online.patch: if patch was not found locally, propose to read it online, offering a URL where it could possibly be found. If the man page exists/is installed, we show the man page, otherwise propose an URL where it might exist online (no remote check if the man page exists... that would be too complex imho) OBS-URL: https://build.opensuse.org/request/show/1077021 OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=144 --- man-propose-online.patch | 34 ++++++++++++++++++++++++++++++++++ man.changes | 7 +++++++ man.spec | 5 ++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 man-propose-online.patch diff --git a/man-propose-online.patch b/man-propose-online.patch new file mode 100644 index 0000000..252a5c9 --- /dev/null +++ b/man-propose-online.patch @@ -0,0 +1,34 @@ +diff -ur man-db-2.10.2/src/man.c man-db-2.10.2.patch/src/man.c +--- man-db-2.10.2/src/man.c 2022-03-17 19:41:27.000000000 +0100 ++++ man-db-2.10.2.patch/src/man.c 2023-04-03 17:13:05.944119389 +0200 +@@ -738,11 +738,16 @@ + } + #endif + +- if (sec) ++ if (sec) { + fprintf (stderr, _("No manual entry for %s in section %s\n"), + name, sec); +- else ++ fprintf (stderr, _("Possibly, man the page is not installed, try online at: ")); ++ fprintf (stderr, _("https://manpages.opensuse.org/%s.%s\n"), name, sec); ++ } else { + fprintf (stderr, _("No manual entry for %s\n"), name); ++ fprintf (stderr, _("Possibly, man page is not installed, try online at: ")); ++ fprintf (stderr, _("https://manpages.opensuse.org/%s\n"), name); ++ } + + #ifdef UNDOC_COMMAND + if (getenv ("MAN_TEST_DISABLE_UNDOCUMENTED") == NULL && +diff -ur man-db-2.10.2/src/tests/man-invalid-db-entry man-db-2.10.2.patch/src/tests/man-invalid-db-entry +--- man-db-2.10.2/src/tests/man-invalid-db-entry 2022-03-17 19:41:27.000000000 +0100 ++++ man-db-2.10.2.patch/src/tests/man-invalid-db-entry 2023-04-03 17:13:55.256508193 +0200 +@@ -25,6 +25,8 @@ + rm -f "$tmpdir/usr/share/man/man1/test.1" + + echo "No manual entry for test" > "$tmpdir/1.exp" ++echo "Possibly, man page is not installed, try online at: https://manpages.opensuse.org/test" >> "$tmpdir/1.exp" ++ + LC_ALL=C run $MAN -C "$tmpdir/manpath.config" test 2> "$tmpdir/1.out" + expect_files_equal 'invalid DB entry' "$tmpdir/1.exp" "$tmpdir/1.out" + diff --git a/man.changes b/man.changes index 3a59888..5c7d549 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Apr 3 14:39:03 UTC 2023 - Dominique Leuenberger + +- Add man-propose-online.patch: if patch was not found locally, + propose to read it online, offering a URL where it could possibly + be found. + ------------------------------------------------------------------- Tue Aug 23 06:13:49 UTC 2022 - Dr. Werner Fink diff --git a/man.spec b/man.spec index 08d1d10..102dffd 100644 --- a/man.spec +++ b/man.spec @@ -1,7 +1,7 @@ # # spec file for package man # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -58,6 +58,8 @@ Patch8: man-db-2.9.4.patch Patch9: man-db-2.6.3-man0.dif Patch10: man-db-2.9.4-alternitive.dif Patch11: harden_man-db.service.patch +# PATCH-FEATURE-OPENSUSE -- Propose to read man pages online +Patch12: man-propose-online.patch BuildRequires: automake BuildRequires: flex BuildRequires: gdbm-devel @@ -108,6 +110,7 @@ printer (using groff). %patch10 -b .libalernative rm -f configure %patch11 -p1 -b .p11 +%patch12 -p1 -b .p12 %build %global optflags %{optflags} -funroll-loops -pipe -Wall From eb752c9a6e46cbddcbb2f5b828bdfa6752f7183f392a846a88bd792cdc1f198e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 25 May 2023 06:39:41 +0000 Subject: [PATCH 2/2] Remove harden_man-db.service.patch as already done upstream OBS-URL: https://build.opensuse.org/package/show/Base:System/man?expand=0&rev=145 --- harden_man-db.service.patch | 24 ------------------------ man.changes | 6 ++++++ man.spec | 2 -- 3 files changed, 6 insertions(+), 26 deletions(-) delete mode 100644 harden_man-db.service.patch diff --git a/harden_man-db.service.patch b/harden_man-db.service.patch deleted file mode 100644 index 66270d7..0000000 --- a/harden_man-db.service.patch +++ /dev/null @@ -1,24 +0,0 @@ -Index: man-db-2.9.4/init/systemd/man-db.service.in -=================================================================== ---- man-db-2.9.4.orig/init/systemd/man-db.service.in -+++ man-db-2.9.4/init/systemd/man-db.service.in -@@ -4,6 +4,19 @@ Documentation=man:mandb(8) - ConditionACPower=true - - [Service] -+# added automatically, for details please see -+# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort -+ProtectSystem=full -+ProtectHome=true -+PrivateDevices=true -+ProtectHostname=true -+ProtectClock=true -+ProtectKernelTunables=true -+ProtectKernelModules=true -+ProtectKernelLogs=true -+ProtectControlGroups=true -+RestrictRealtime=true -+# end of automatic additions - Type=oneshot - # Recover from deletion, per FHS. - ExecStart=+/usr/bin/install -d -o @cache_top_owner@ -g @cache_top_owner@ -m 0755 /var/cache/man diff --git a/man.changes b/man.changes index 5c7d549..87ab291 100644 --- a/man.changes +++ b/man.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu May 25 06:37:13 UTC 2023 - Dr. Werner Fink + +- Remove harden_man-db.service.patch as already done upstream + at the end of the service file man-db.service + ------------------------------------------------------------------- Mon Apr 3 14:39:03 UTC 2023 - Dominique Leuenberger diff --git a/man.spec b/man.spec index 102dffd..d4cb70f 100644 --- a/man.spec +++ b/man.spec @@ -57,7 +57,6 @@ Patch8: man-db-2.9.4.patch # PATCH-FEATURE-OPENSUSE -- Add documentation about man0 section (header files) Patch9: man-db-2.6.3-man0.dif Patch10: man-db-2.9.4-alternitive.dif -Patch11: harden_man-db.service.patch # PATCH-FEATURE-OPENSUSE -- Propose to read man pages online Patch12: man-propose-online.patch BuildRequires: automake @@ -109,7 +108,6 @@ printer (using groff). %patch9 -b .p9 %patch10 -b .libalernative rm -f configure -%patch11 -p1 -b .p11 %patch12 -p1 -b .p12 %build