[lfs] branch multilib updated: OpenRC: Make prevention of conf overwriting better

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]> Sat, 06 Jun 2026 21:11:09 +0000
Newsgroups gmane.linux.lfs.book
Message-ID <178078026950.16155.13170281888567601872@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch multilib
in repository lfs.

The following commit(s) were added to refs/heads/multilib by this push:
     new 1e67d2f41 OpenRC: Make prevention of conf overwriting better
1e67d2f41 is described below

commit 1e67d2f41e4bed598b660453bc66da2a3a80717f
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