Opened 16 years ago

Closed 16 years ago

#2199 closed defect (fixed)

Making the LFS book from SVN 8551 failed for me — at Version 2

Reported by: Gunter Liszewski Owned by: lfs-book@…
Priority: normal Milestone:
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description (last modified by bdubbs@…)

Proposed Changes

Making the LFS failed for me. To fix the problem I corrected a typo in process-scripts.sh. '=' is the correct string comparison operator.

I also replaced 'sh' with 'bash' in the Makefile, because an error during the make reported that 'popd', and 'pushd' are not available while running in the 'sh' shell.

Change History (2)

comment:1 by Gunter Liszewski, 16 years ago

Updated the diff

Using 'make nochunks' gives a similar problem. To fix, I replaced 'sh' with 'bash'. The 'sh' shell complained about the 'cp' syntax.

snv diff

Index: process-scripts.sh
===================================================================
--- process-scripts.sh	(revision 8551)
+++ process-scripts.sh	(working copy)
@@ -1,4 +1,4 @@
-#!/bin/sh
+ #!/bin/sh
 
 # Boot scripts
 for s in bootscripts/lfs/init.d/*                    \
@@ -9,12 +9,12 @@
   script=$(basename $s)
   
   # Skip directories
-  [ $script == 'network-devices' ] && continue
-  [ $script == 'services'        ] && continue
+  [ $script = 'network-devices' ] && continue
+  [ $script = 'services'        ] && continue
 
   # Disambiguate duplicate file names
-  [ $s == 'bootscripts/lfs/sysconfig/rc'      ] && script='rc-sysinit'; 
-  [ $s == 'bootscripts/lfs/sysconfig/modules' ] && script='modules-sysinit'; 
+  [ $s = 'bootscripts/lfs/sysconfig/rc'      ] && script='rc-sysinit'; 
+  [ $s = 'bootscripts/lfs/sysconfig/modules' ] && script='modules-sysinit'; 
   
   sed  -e 's/\&/\&amp\;/g' -e 's/</\&lt\;/g'   -e 's/>/\&gt\;/g' \
        -e "s/'/\&apos\;/g" -e 's/"/\&quot\;/g' -e 's/\t/    /g'  \
Index: Makefile
===================================================================
--- Makefile	(revision 8551)
+++ Makefile	(working copy)
@@ -67,7 +67,7 @@
 	@echo "Running Tidy..."
 	$(Q)tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true
 	@echo "Running obfuscate.sh..."
-	$(Q)sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
+	$(Q)bash obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT)
 	$(Q)sed -i -e "s@text/html@application/xhtml+xml@g"  \
 	  $(BASEDIR)/$(NOCHUNKS_OUTPUT)
 
@@ -84,7 +84,7 @@
 	$(Q)xmllint --nonet --noent --xinclude --postvalid \
 	  -o $(RENDERTMP)/lfs-full.xml index.xml
 	$(Q)rm -f appendices/*.script
-	$(Q)sh aux-file-data.sh $(RENDERTMP)/lfs-full.xml
+	$(Q)bash aux-file-data.sh $(RENDERTMP)/lfs-full.xml
 
 maketar:
 	@echo "Making tarballs..."

comment:2 by bdubbs@…, 16 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

The == construct is correct for bash. You may be using sh as a symbolic link to something other than bash.

I will change #!/bin/sh to #!/bin/bash in process-scripts.sh. The change from sh to bash in the Makefile should not be required, because the first lines of both scripts now specify bash, but I made them anyway.

Also, do not put a relatively long diff in the ticket description. Put it in a comment or an attachment.

Note: See TracTickets for help on using tickets.