[jhalfs] branch trunk updated: Remove --from lfs from chown for now

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <171554411400.1145.12105370179028264490@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new 57a5e9a  Remove --from lfs from chown for now
57a5e9a is described below

commit 57a5e9acd19afa31ee631a8b6dd4cd8c9f3cb751
Author: Xi Ruoyao <[email protected]>
AuthorDate: Mon May 13 03:59:27 2024 +0800

    Remove --from lfs from chown for now
    
    We've added --from lfs for chown commands in the beginning of chap 7 to
    avoid breaking host distro completely in case the user has not set $LFS
    correctly.  But jhalfs deletes the lfs user before running the
    changingowner script, thus "chown --from lfs" fails because "lfs" does
    not exist.
    
    For now just remove "--from lfs" from the chown commands.  Technically
    we should remove the lfs user after the chown commands (because having
    files owned by unnamed UID is bad).
---
 LFS/lfs.xsl | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl
index d96aa60..8290617 100644
--- a/LFS/lfs.xsl
+++ b/LFS/lfs.xsl
@@ -573,6 +573,26 @@ unset OLD_PKGDIR
         </xsl:choose>
         <xsl:text>&#xA;</xsl:text>
       </xsl:when><!-- temp chapters install -->
+      <!-- In jhalfs chaningowner is executed AFTER userdel lfs
+           so chown \-\- from lfs errors out.  -->
+      <xsl:when test="contains(string(),'--from lfs')">
+        <xsl:copy-of select="substring-before(string(), '--from lfs')"/>
+        <xsl:choose>
+          <xsl:when test="contains(substring-after(string(),'--from lfs'),
+                                   '--from lfs')">
+            <xsl:copy-of select="substring-before(
+                                   substring-after(string(),'--from lfs'),
+                                   '--from lfs')"/>
+            <xsl:copy-of select="substring-after(
+                                   substring-after(string(),'--from lfs'),
+                                   '--from lfs')"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:copy-of select="string()"/>
+          </xsl:otherwise>
+        </xsl:choose>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
       <!-- The rest of commands -->
       <xsl:otherwise>
         <xsl:apply-templates/>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.