[lfs] branch openrc updated: OpenRC: Make prevention of conf overwriting better
"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]> Sat, 06 Jun 2026 21:10:48 +0000
| Newsgroups | gmane.linux.lfs.book |
|---|---|
| Message-ID | <178078024882.15901.3676987814129489347@rivendell.linuxfromscratch.org> |
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch openrc
in repository lfs.
The following commit(s) were added to refs/heads/openrc by this push:
new 468d86844 OpenRC: Make prevention of conf overwriting better
468d86844 is described below
commit 468d86844fa14b18261e15d3f1720dcc400e4d38
Author: Zeckmathederg <[email protected]>
AuthorDate: Sat Jun 6 15:07:20 2026 -0600
OpenRC: Make prevention of conf overwriting better
The previous method was clumsy and not very understandable. The build
system uses the standard install_data() Meson function which will
indiscriminately overwrite anything that falls in the cross fire.
However, what we can do is move the old /etc/conf.d directory out of the
way before normal installation takes place, in which we can move all the
old contents back in after the overwrite.
---
chapter08/openrc.xml | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/chapter08/openrc.xml b/chapter08/openrc.xml
index 2f0c67f11..52e142b94 100644
--- a/chapter08/openrc.xml
+++ b/chapter08/openrc.xml
@@ -95,23 +95,15 @@ meson setup --prefix=/usr \
<para>Install the package:</para>
-<screen><userinput remap="install">DESTDIR=$PWD/DESTDIR ninja install
-
-mv -v DESTDIR/{s,}bin/rc-update
-mv -v DESTDIR/{s,}bin DESTDIR/usr
-install -vDm755 DESTDIR/usr/bin/* -t /usr/bin/
-install -vDm755 DESTDIR/usr/sbin/* -t /usr/sbin/
-rm -rf DESTDIR/usr/{s,}bin
-
-for conf in DESTDIR/etc/conf.d/*; do
- if [ ! -e /etc/conf.d/$(basename $conf) ]; then
- install -vDm644 $conf -t /etc/conf.d/
- fi
- rm -f $conf
-done
-
-cp -vR DESTDIR/* /
-rm -rf DESTDIR</userinput></screen>
+<screen><userinput remap="install">if [ -d /etc/conf.d ]; then
+ mv -v /etc/conf.d{,.tmp}
+ ninja install
+ cp -vR /etc/conf.d.tmp/* /etc/conf.d
+ rm -rf /etc/conf.d.tmp
+else
+ ninja install
+fi
+mv -v /usr/{s,}bin/rc-update</userinput></screen>
<note><para>
OpenRC by default reinstalls the configuration files for the base
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
--
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page