From 09e6575b72d2b8bb8948feb0bbdcfd47eddb903b Mon Sep 17 00:00:00 2001 From: Sam James Date: Sat, 3 Dec 2022 12:16:46 +0000 Subject: [PATCH] sys-apps/openrc: backport grep 3.8 warning fix Closes: https://bugs.gentoo.org/875557 Signed-off-by: Sam James --- .../openrc/files/openrc-0.45.2-grep-3.8.patch | 35 +++++++++++++++++++ ...45.2-r1.ebuild => openrc-0.45.2-r2.ebuild} | 8 +++-- 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 sys-apps/openrc/files/openrc-0.45.2-grep-3.8.patch rename sys-apps/openrc/{openrc-0.45.2-r1.ebuild => openrc-0.45.2-r2.ebuild} (97%) diff --git a/sys-apps/openrc/files/openrc-0.45.2-grep-3.8.patch b/sys-apps/openrc/files/openrc-0.45.2-grep-3.8.patch new file mode 100644 index 0000000000000..c6eddeec9048d --- /dev/null +++ b/sys-apps/openrc/files/openrc-0.45.2-grep-3.8.patch @@ -0,0 +1,35 @@ +https://bugs.gentoo.org/875557 +https://github.com/OpenRC/openrc/issues/548 +https://github.com/OpenRC/openrc/commit/9380347f042f7d294317f4420b648422817eb75a + +From 9380347f042f7d294317f4420b648422817eb75a Mon Sep 17 00:00:00 2001 +From: Stefan Linke +Date: Wed, 7 Sep 2022 17:18:09 +0200 +Subject: [PATCH] Avoid warning on grep 3.8 in hwclock + +Starting with grep version 3.8, the hwclock init script logs warnings +about stray backslashes: + +> hwclock | * Setting system clock using the hardware clock [UTC] ... +> hwclock |grep: warning: stray \ before - +> hwclock |grep: warning: stray \ before - + +This is caused by the check for existence of the `--noadjfile` argument +in function `get_noadjfile()`. + +Replacing the affected logic with an explicit argument denoting the +pattern as such resolves the issue. + +Fixes #548 +--- a/init.d/hwclock.in ++++ b/init.d/hwclock.in +@@ -72,7 +72,7 @@ get_noadjfile() + { + if ! yesno $clock_adjfile; then + # Some implementations don't handle adjustments +- if LC_ALL=C hwclock --help 2>&1 | grep -q "\-\-noadjfile"; then ++ if LC_ALL=C hwclock --help 2>&1 | grep -q -e "--noadjfile"; then + echo --noadjfile + fi + fi + diff --git a/sys-apps/openrc/openrc-0.45.2-r1.ebuild b/sys-apps/openrc/openrc-0.45.2-r2.ebuild similarity index 97% rename from sys-apps/openrc/openrc-0.45.2-r1.ebuild rename to sys-apps/openrc/openrc-0.45.2-r2.ebuild index 806d414f6ac01..1d0fad63f7abe 100644 --- a/sys-apps/openrc/openrc-0.45.2-r1.ebuild +++ b/sys-apps/openrc/openrc-0.45.2-r2.ebuild @@ -55,10 +55,14 @@ RDEPEND="${COMMON_DEPEND} PDEPEND="netifrc? ( net-misc/netifrc )" +PATCHES=( + "${FILESDIR}"/${P}-grep-3.8.patch +) + src_configure() { local emesonargs=( - $(meson_feature audit) - "-Dbranding=\"Gentoo Linux\"" + $(meson_feature audit) + "-Dbranding=\"Gentoo Linux\"" $(meson_use newnet) -Dos=Linux $(meson_use pam)