Nimbin[12]?Mirrors & Forks / jhalfs / commits / 3c43655

jhalfs git · trunk

jhalfs LFS build automation (mirror)

lfs mirror bash · first commit 2005-09-11 · last commit 2024-02-13 (2 years ago) · synced 3 days ago · upstream: git.linuxfromscratch.org/jhalfs

Python 78.4% Shell 19.8% Makefile 1.8%
git clone https://git.christianimmanuel.de/mirrors-forks/jhalfs.gitwget https://git.christianimmanuel.de/mirrors-forks/jhalfs/archive/jhalfs.tar.gz

Only replace $(nproc) in scriptlets

Pierre Labastie · 2023-11-15 17:10 · 3c43655ec646c94ab3da44b72e856bc890468f25

There is no more $(nproc || echo 1). Note that we may replace
it with $(nproc) if using all cores, so don't replace it in
the comment-test template (otherwise we have infinite recursion).
 LFS/lfs.xsl                  | 16 ++--------------
 common/libs/func_book_parser | 14 ++++++--------
 2 files changed, 8 insertions(+), 22 deletions(-)

diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl
index 3b575ec..49fbdf2 100644
--- a/LFS/lfs.xsl
+++ b/LFS/lfs.xsl
@@ -29,8 +29,7 @@
   <xsl:param name="testsuite" select="1"/>
 
   <!-- Parallelism (LFS >= 12.1) -->
-  <xsl:param name="jobs_1" select="1"/>
-  <xsl:param name="jobs_2" select="1"/>
+  <xsl:param name="jobs" select="1"/>
 
   <!-- Install non wide character ncurses 5? -->
   <xsl:param name="ncurses5" select="'n'"/>
@@ -621,11 +620,8 @@ unset OLD_PKGDIR
       <xsl:when test="contains(string(.),'&lt;lfs&gt;')">
         <xsl:value-of select="$hostname"/>
       </xsl:when>
-      <xsl:when test="contains(string(.),'$(nproc || echo 1)')">
-        <xsl:value-of select="$jobs_1"/>
-      </xsl:when>
       <xsl:when test="contains(string(.),'$(nproc)')">
-        <xsl:value-of select="$jobs_2"/>
+        <xsl:value-of select="$jobs"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:text>**EDITME</xsl:text>
@@ -1092,14 +1088,6 @@ LOGLEVEL="</xsl:text>
     <xsl:param name="instructions" select="''"/>
     <xsl:param name="eof-seen" select="false()"/>
     <xsl:choose>
-      <xsl:when test="contains($instructions, '$(nproc)')">
-        <xsl:call-template name="comment-test">
-          <xsl:with-param
-            name="instructions"
-            select="concat(substring-before($instructions, '$(nproc)'), $jobs_2, substring-after($instructions, '$(nproc)'))"/>
-          <xsl:with-param name="eof-seen" select="$eof-seen"/>
-        </xsl:call-template>
-      </xsl:when>
       <xsl:when test="contains($instructions,'&#xA;')">
         <xsl:call-template name="comment-test">
           <xsl:with-param name="instructions"
diff --git a/common/libs/func_book_parser b/common/libs/func_book_parser
index 5dbd502..6b7435b 100644
--- a/common/libs/func_book_parser
+++ b/common/libs/func_book_parser
@@ -63,13 +63,12 @@ extract_commands() {         #
   fi
   popd > /dev/null
 
-  JOBS_1=1
-  JOBS_2=1
-  case "$OPTIMIZE" in
-    "1") JOBS_2="$N_PARALLEL";;
-    "2") JOBS_1="$N_PARALLEL"; JOBS_2="$N_PARALLEL";;
-  esac
+  if [ "$ALL_CORES" = "y" ]; then
+	  JOBS="\$(nproc)"
+  else
+	  JOBS="$N_PARALLEL"
 
+  fi
   # First profile the book, for revision and arch. Note that
   # MULTIBLIB is set to "default" if pure 64 bit book. In this case,
   # profiling on arch is useless, but does not hurt either.
@@ -109,8 +108,7 @@ extract_commands() {         #
            --stringparam local          "$LOCAL"        \
            --stringparam log-level      "$LOG_LEVEL"    \
            --stringparam script-root    "$SCRIPT_ROOT"  \
-           --stringparam jobs_1         "$JOBS_1"       \
-           --stringparam jobs_2         "$JOBS_2"       \
+           --stringparam jobs           "$JOBS"         \
            --output "./${COMMANDS}/"                    \
            $XSL                                         \
            prbook.xml >> $LOGDIR/$LOG 2>&1