r2913 - in jhalfs/branches/experimental: . CLFS CLFS2 HLFS LFS common

georgeb at linuxfromscratch.org georgeb at linuxfromscratch.org
Thu Aug 10 20:34:12 PDT 2006


Author: georgeb
Date: 2006-08-10 21:34:10 -0600 (Thu, 10 Aug 2006)
New Revision: 2913

Modified:
   jhalfs/branches/experimental/CLFS/master.sh
   jhalfs/branches/experimental/CLFS2/master.sh
   jhalfs/branches/experimental/HLFS/master.sh
   jhalfs/branches/experimental/LFS/master.sh
   jhalfs/branches/experimental/common/common-functions
   jhalfs/branches/experimental/common/makefile-functions
   jhalfs/branches/experimental/master.sh
Log:
Mods to most files to allow for reduction of internal functions and reduction in the size of the generated makefile

Modified: jhalfs/branches/experimental/CLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS/master.sh	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/CLFS/master.sh	2006-08-11 03:34:10 UTC (rev 2913)
@@ -6,7 +6,6 @@
 ###################################
 
 
-
 #----------------------------#
 host_prep_Makefiles() {      # Initialization of the system
 #----------------------------#
@@ -1009,12 +1008,30 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+SU_LUSER     = su - \$(LUSER) -c
+LUSER_HOME   = /home/\$(LUSER)
+PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+
+
 include makefile-functions
 
 EOF

Modified: jhalfs/branches/experimental/CLFS2/master.sh
===================================================================
--- jhalfs/branches/experimental/CLFS2/master.sh	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/CLFS2/master.sh	2006-08-11 03:34:10 UTC (rev 2913)
@@ -283,6 +283,7 @@
     case $this_script in
       *udev)     continue ;; # This is not a script but a commentary, we want udev-rules
       *console*) continue ;; # Use the files that came with the bootscripts
+      *network*) continue ;; # Manually create these files
       *)  ;;
     esac
 
@@ -432,12 +433,23 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC         = /sources
+MOUNT_PT    = $BUILDDIR
+PKG_LST     = $PKG_LST
+LUSER       = $LUSER
+LGROUP      = $LGROUP
+SCRIPT_ROOT = $SCRIPT_ROOT
 
+BASEDIR    = \$(MOUNT_PT)
+SRCSDIR    = \$(BASEDIR)/sources
+CMDSDIR    = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR     = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+SU_LUSER   = su - \$(LUSER) -c
+PRT_DU     = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
+LUSER_HOME = /home/\$(LUSER)
+
 include makefile-functions
 
 EOF

Modified: jhalfs/branches/experimental/HLFS/master.sh
===================================================================
--- jhalfs/branches/experimental/HLFS/master.sh	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/HLFS/master.sh	2006-08-11 03:34:10 UTC (rev 2913)
@@ -13,15 +13,22 @@
   local toolchain=$1
   local this_script=$2
   local  tc_phase
-
+  local binutil_tarball
+  local gcc_core_tarball
+  
   echo "${tab_}${tab_}${GREEN}toolchain ${L_arrow}${toolchain}${R_arrow}"
 
   #
   # Safe method to remove existing toolchain dirs
-  pkg_tarball=$(get_package_tarball_name "binutils")
-  wrt_remove_existing_dirs  "$pkg_tarball"
-  pkg_tarball=$(get_package_tarball_name "gcc-core")
-  wrt_remove_existing_dirs  "$pkg_tarball"
+  binutil_tarball=$(get_package_tarball_name "binutils")
+  gcc_core_tarball=$(get_package_tarball_name "gcc-core")
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$binutil_tarball)
+	@\$(call remove_existing_dirs,$gcc_core_tarball)
+EOF
+) >> $MKFILE.tmp
+
   #
   # Manually remove the toolchain directories..
   tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
@@ -54,10 +61,17 @@
   esac
   #
   # Safe method to remove packages unpacked while inside the toolchain script
-  pkg_tarball=$(get_package_tarball_name "binutils")
-  wrt_remove_existing_dirs  "$pkg_tarball"
-  pkg_tarball=$(get_package_tarball_name "gcc-core")
-  wrt_remove_existing_dirs  "$pkg_tarball"
+#  pkg_tarball=$(get_package_tarball_name "binutils")
+#  wrt_remove_existing_dirs  "$pkg_tarball"
+#  pkg_tarball=$(get_package_tarball_name "gcc-core")
+#  wrt_remove_existing_dirs  "$pkg_tarball"
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$binutil_tarball)
+	@\$(call remove_existing_dirs,$gcc_core_tarball)
+EOF
+) >> $MKFILE.tmp
+
   #
   # Manually remove the toolchain directories..
   tc_phase=`echo $toolchain | sed -e 's@[0-9]\{3\}-@@' -e 's at -toolchain@@'`
@@ -482,12 +496,29 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+SU_LUSER     = su - \$(LUSER) -c
+LUSER_HOME   = /home/\$(LUSER)
+PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+
 include makefile-functions
 
 EOF

Modified: jhalfs/branches/experimental/LFS/master.sh
===================================================================
--- jhalfs/branches/experimental/LFS/master.sh	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/LFS/master.sh	2006-08-11 03:34:10 UTC (rev 2913)
@@ -7,7 +7,6 @@
 ###################################
 
 
-
 #----------------------------#
 chapter4_Makefiles() {
 #----------------------------#
@@ -362,12 +361,30 @@
     cat << EOF
 $HEADER
 
-SRC= /sources
-MOUNT_PT= $BUILDDIR
-PKG_LST= $PKG_LST
-LUSER= $LUSER
-LGROUP= $LGROUP
+SRC          = /sources
+MOUNT_PT     = $BUILDDIR
+PKG_LST      = $PKG_LST
+LUSER        = $LUSER
+LGROUP       = $LGROUP
+SCRIPT_ROOT  = $SCRIPT_ROOT
 
+BASEDIR      = \$(MOUNT_PT)
+SRCSDIR      = \$(BASEDIR)/sources
+CMDSDIR      = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
+LOGDIR       = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
+TESTLOGDIR   = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+
+crSRCSDIR    = /sources
+crCMDSDIR    = /\$(SCRIPT_ROOT)/$PROGNAME-commands
+crLOGDIR     = /\$(SCRIPT_ROOT)/logs
+crTESTLOGDIR = /\$(SCRIPT_ROOT)/test-logs
+
+SU_LUSER     = su - \$(LUSER) -c
+LUSER_HOME   = /home/\$(LUSER)
+PRT_DU       = echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n"
+PRT_DU_CR    = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) \$(MOUNT_PT)\`\n"
+
+
 include makefile-functions
 
 EOF

Modified: jhalfs/branches/experimental/common/common-functions
===================================================================
--- jhalfs/branches/experimental/common/common-functions	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/common/common-functions	2006-08-11 03:34:10 UTC (rev 2913)
@@ -260,62 +260,110 @@
 
 }
 
+
 #----------------------------------#
-wrt_remove_existing_dirs() {       #
+wrt_test_log() {                   # Initialize testsuite log file
 #----------------------------------#
-  local PKG_NAME=$1
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@PKG_PATH=\`ls -t \$(MOUNT_PT)\$(SRC)/${PKG_NAME} | head -n1\` && \\
-	ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
-	[[ -n \$\$ROOT ]] && \\
-	rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build ]; then \\
-		rm -rf \$(MOUNT_PT)\$(SRC)/${PKG_NAME%-*}-build; \\
-	fi;
+cat  << EOF
+	@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
+	su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_remove_existing_dirs2() {      #
+wrt_test_log2() {                  #
 #----------------------------------#
-  local PKG_NAME=$1
+  local TESTLOGFILE=$1
 (
-cat << EOF
-	@PKG_PATH=\`ls -t \$(SRC)/${PKG_NAME} | head -n1\` && \\
-	ROOT=\`tar -tf \$\$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'\` && \\
-	[[ -n \$\$ROOT ]] && \\
-	rm -rf \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/${PKG_NAME%-*}-build ]; then \\
-		rm -rf \$(SRC)/${PKG_NAME%-*}-build; \\
-	fi;
+cat  << EOF
+	@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
+	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
+#----------------------------------#
+wrt_target_vars() {                # Target vars for hlfs (cross-build method)
+#----------------------------------#
+(
+cat  << EOF
+	@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
+	echo "export ldso=/lib/${LOADER}" >> envars
+EOF
+) >> $MKFILE.tmp
 
+}
 
+
 #----------------------------------#
+wrt_copy_fstab() {                 #
+#----------------------------------#
+  local i=$1
+(
+    cat << EOF
+	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_copy_fstab2() {                #
+#----------------------------------#
+  local i=$1
+(
+    cat << EOF
+	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
+EOF
+) >> $MKFILE.tmp
+}
+
+
+#----------------------------------#
+wrt_report() {                     #
+#----------------------------------#
+(
+cat << EOF
+
+create-sbu_du-report:  $PREV
+	@\$(call echo_message, Building)
+	@./create-sbu_du-report.sh logs $VERSION
+	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
+	@touch  \$@
+EOF
+) >> $MKFILE.tmp
+
+chapter789="$chapter789 create-sbu_du-report"
+}
+
+unset wrt_unpack
+#----------------------------------#
 wrt_unpack() {                     # Unpack and set 'ROOT' var
 #----------------------------------#
   local FILE=$1
   local optSAVE_PREVIOUS=$2
 
-  if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs "$FILE"
+  if [[ "${optSAVE_PREVIOUS}" != "1" ]]; then
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
+
 (
 cat << EOF
 	@\$(call unpack,$FILE)
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(MOUNT_PT)\$(SRC)/\$\$ROOT" > envars && \\
-	chown -R \$(LUSER) \$(MOUNT_PT)\$(SRC)/\$\$ROOT
+	@\$(call get_pkg_root)
 EOF
 ) >> $MKFILE.tmp
+
 }
 
-
+unset wrt_unpack2
 #----------------------------------#
 wrt_unpack2() {                    #
 #----------------------------------#
@@ -323,18 +371,20 @@
   local optSAVE_PREVIOUS=$2
 
   if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs "$FILE"
+(
+cat << EOF
+	@\$(call remove_existing_dirs,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
 (
 cat  << EOF
 	@\$(call unpack2,$FILE)
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
+	@\$(call get_pkg_root,nouser)
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
 wrt_unpack3() {                    #
 #----------------------------------#
@@ -342,63 +392,68 @@
   local optSAVE_PREVIOUS=$2
 
   if [ "${optSAVE_PREVIOUS}" != "1" ]; then
-    wrt_remove_existing_dirs2 "$FILE"
+(
+cat << EOF
+	@\$(call remove_existing_dirs2,$FILE)
+EOF
+) >> $MKFILE.tmp
   fi
 (
 cat  << EOF
 	@\$(call unpack3,$FILE)
-	@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	echo "export PKGDIR=\$(SRC)/\$\$ROOT" > envars
+	@\$(call get_pkg_root2)
 EOF
 ) >> $MKFILE.tmp
 }
 
+
+unset wrt_remove_build_dirs
 #----------------------------------#
-wrt_test_log() {                   # Initialize testsuite log file
+wrt_remove_build_dirs() {          #
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local name=$1
 (
-cat  << EOF
-	@echo "export TEST_LOG=$TESTLOGDIR/$TESTLOGFILE" >> envars && \\
-	su - \$(LUSER) -c "echo -e '\n\`date\`\n' >$TESTLOGDIR/$TESTLOGFILE"
+cat << EOF
+	@\$(call remove_build_dirs,$name)
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_test_log2() {                  #
+wrt_remove_build_dirs2() {         #
 #----------------------------------#
-  local TESTLOGFILE=$1
+  local name=$1
 (
-cat  << EOF
-	@echo "export TEST_LOG=/$SCRIPT_ROOT/test-logs/$TESTLOGFILE" >> envars && \\
-	echo -e "\n\`date\`\n" >test-logs/$TESTLOGFILE
+cat << EOF
+	@\$(call remove_build_dirs2,$name)
 EOF
 ) >> $MKFILE.tmp
 }
 
+
+
+unset wrt_touch
 #----------------------------------#
-wrt_target_vars() {                # Target vars for hlfs (cross-build method)
+wrt_touch() {                      #
 #----------------------------------#
 (
-cat  << EOF
-	@echo "export target=$(uname -m)-${TARGET}" >> envars && \\
-	echo "export ldso=/lib/${LOADER}" >> envars
+cat << EOF
+	@\$(call housekeeping)
 EOF
 ) >> $MKFILE.tmp
-
 }
 
-
+unset wrt_RunAsUser
 #----------------------------------#
 wrt_RunAsUser() {                  # Execute script inside time { }, footer to log file
 #----------------------------------#
   local this_script=$1
   local file=$2
+
 (
 cat << EOF
-	@( time { su - \$(LUSER) -c "source /home/\$(LUSER)/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { \$(SU_LUSER) "source \$(LUSER_HOME)/.bashrc && \$(CMDSDIR)/`dirname $file`/\$@" >> logs/\$@ 2>&1; } ) 2>> logs/\$@ && \\
+	\$(PRT_DU) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
@@ -422,13 +477,12 @@
   
 (
 cat << EOF
-	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { export ${MOUNT_ENV}=\$(MOUNT_PT) && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
+	\$(PRT_DU_CR) >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
 wrt_run_as_root2() {               #
 #----------------------------------#
@@ -436,27 +490,28 @@
   local file=$2
 (
 cat << EOF
-	@( time { source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/$this_script
+	@( time { source envars && ${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 ; } ) 2>>logs/\$@ && \\
+	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \`\n" >>logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
 
+unset wrt_run_as_chroot1
 #----------------------------------#
 wrt_run_as_chroot1() {             #
 #----------------------------------#
   local this_script=$1
   local file=$2
 (
-    cat << EOF
-	@( time { \$(CHROOT1) 'cd /${SCRIPT_ROOT} && source envars && /${SCRIPT_ROOT}/${PROGNAME}-commands/$file >>/${SCRIPT_ROOT}/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/${this_script}
+cat << EOF
+	@( time { \$(CHROOT1) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1' ; } ) 2>>logs/\$@ && \\
+	\$(PRT_DU_CR) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
+unset wrt_run_as_chroot2
 #----------------------------------#
 wrt_run_as_chroot2() {             #
 #----------------------------------#
@@ -464,100 +519,55 @@
   local file=$2
 (
 cat << EOF
-	@( time { \$(CHROOT2) 'cd /${SCRIPT_ROOT} && source envars && /${SCRIPT_ROOT}/${PROGNAME}-commands/$file >>/${SCRIPT_ROOT}/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
-	echo -e "\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >>logs/${this_script}
+	@( time { \$(CHROOT2) 'cd \$(SCRIPT_ROOT) && source envars && \$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\@ 2>&1' ; } ) 2>>logs/\@ && \\
+	\$(PRT_DU_CR) >> logs/\$@
 EOF
 ) >> $MKFILE.tmp
 }
 
-
+unset wrt_target
 #----------------------------------#
-wrt_copy_fstab() {                 #
+wrt_target() {                     # Create target and initialize log file
 #----------------------------------#
   local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE="\$@.log" ;;
+             * ) local LOGFILE="\$@"     ;;
+  esac
 (
-    cat << EOF
-	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
-EOF
-) >> $MKFILE.tmp
-}
-
-#----------------------------------#
-wrt_copy_fstab2() {                #
-#----------------------------------#
-  local i=$1
-(
-    cat << EOF
-	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
-EOF
-) >> $MKFILE.tmp
-}
-
-
-#----------------------------------#
-wrt_remove_build_dirs() {          #
-#----------------------------------#
-  local name=$1
-(
 cat << EOF
-	@ROOT=\`head -n1 \$(MOUNT_PT)\$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -rf \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
-		rm -rf \$(MOUNT_PT)\$(SRC)/$name-build; \\
-	fi;
-EOF
-) >> $MKFILE.tmp
-}
 
-
-#----------------------------------#
-wrt_remove_build_dirs2() {         #
-#----------------------------------#
-  local name=$1
-(
-cat << EOF
-	@ROOT=\`head -n1 \$(SRC)/\$(PKG_LST) | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -rf \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/$name-build ]; then \\
-		rm -rf \$(SRC)/$name-build; \\
-	fi;
+$i:  $PREV
+	@\$(call echo_message, Building)
+	@./progress_bar.sh \$@ &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT} \$(MOUNT_PT)\`\n" >logs/$LOGFILE
 EOF
 ) >> $MKFILE.tmp
 }
 
-
 #----------------------------------#
-wrt_touch() {                      #
+wrt_target_boot() {                # Create target and initialize log file
 #----------------------------------#
+  local i=$1
+  local PREV=$2
+  case $i in
+    iteration* ) local LOGFILE="\$@.log" ;;
+             * ) local LOGFILE="\$@" ;;
+  esac
 (
 cat << EOF
-	@touch  \$@ && \\
-	sleep .25 && \\
-	echo -e "\n\n "\$(BOLD)Target \$(BLUE)\$@ \$(BOLD)OK && \\
-	echo --------------------------------------------------------------------------------\$(WHITE)
-EOF
-) >> $MKFILE.tmp
-}
 
-
-#----------------------------------#
-wrt_report() {                     #
-#----------------------------------#
-(
-cat << EOF
-
-create-sbu_du-report:  $PREV
+$i:  $PREV
 	@\$(call echo_message, Building)
-	@./create-sbu_du-report.sh logs $VERSION
-	@\$(call echo_report,$VERSION-SBU_DU-$(date --iso-8601).report)
-	@touch  \$@
+	@./progress_bar.sh \$@ &
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=${SCRIPT_ROOT}\`\n" >logs/$LOGFILE
 EOF
 ) >> $MKFILE.tmp
-
-chapter789="$chapter789 create-sbu_du-report"
 }
 
 
+
 #----------------------------#
 run_make() {                 #
 #----------------------------#

Modified: jhalfs/branches/experimental/common/makefile-functions
===================================================================
--- jhalfs/branches/experimental/common/makefile-functions	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/common/makefile-functions	2006-08-11 03:34:10 UTC (rev 2913)
@@ -15,13 +15,62 @@
   @echo $(WHITE)
 endef
 
+define remove_existing_dirs
+  @PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
+  ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRCSDIR)/$$ROOT && \
+  rm -rf $(SRCSDIR)/$${ROOT%-*}-build
+endef
+
+define remove_existing_dirs2
+  @PKG_PATH=\`ls -t $(SRC)/$(1) | head -n1\` && \
+  ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRC)/$$ROOT && \
+  rm -rf $(SRC)/$${ROOT-*}-build
+endef
+
+define remove_build_dirs
+  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRCSDIR)/$$ROOT && \
+  rm -rf $(SRCSDIR)/$(1)-build
+endef
+
+define remove_build_dirs2
+  @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  rm -rf $(SRC)/$$ROOT && \
+  rm -rf $(SRC)/$(1)-build
+endef
+
+define housekeeping
+  @touch  $@ && \
+  sleep .25 && \
+  echo -e "\n\n "$(BOLD)Target $(BLUE)$@ $(BOLD)OK && \
+  echo --------------------------------------------------------------------------------$(WHITE)
+
+endef
+
+define get_pkg_root
+  @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  if [ "$(1)" != "nouser" ]; then \
+    echo "export PKGDIR=$(SRCSDIR)/$$ROOT" > envars; \
+    chown -R $(LUSER) $(SRCSDIR)/$$ROOT; \
+  else \
+    echo "export PKGDIR=$(crSRCSDIR)/$$ROOT" > envars; \
+  fi;
+endef
+
+define get_pkg_root2
+  @ROOT=`head -n1 $(SRC)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
+  echo "export PKGDIR=$(SRC)/$$ROOT" > envars
+endef
+
 define unpack
-  @cd $(MOUNT_PT)$(SRC) && \
+  @cd $(SRCSDIR) && \
   tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
 endef
 
 define unpack2
-  @cd $(MOUNT_PT)$(SRC) && \
+  @cd $(SRCSDIR) && \
   /tools/bin/tar -xvf `ls -t $(1) | head -n1` > $(PKG_LST)
 endef
 

Modified: jhalfs/branches/experimental/master.sh
===================================================================
--- jhalfs/branches/experimental/master.sh	2006-08-10 09:29:24 UTC (rev 2912)
+++ jhalfs/branches/experimental/master.sh	2006-08-11 03:34:10 UTC (rev 2913)
@@ -69,9 +69,11 @@
 [[ $VERBOSITY > 0 ]] && echo "${SD_BORDER}${nl_}"
 
 if [[ -e using_menuconfig ]]; then
+  [[ $VERBOSITY > 0 ]] && echo -n "Loading config params from <configuration>..."
   source configuration
+  [[ $? > 0 ]] && echo "file:configuration did not load.." && exit 1
+  [[ $VERBOSITY > 0 ]] && echo "OK"
 
-
 	#--- Working directories
   SCRIPT_ROOT=jhalfs
     JHALFSDIR=$BUILDDIR/$SCRIPT_ROOT
@@ -83,32 +85,33 @@
 	#--- farce report log directory
   FARCELOGDIR=$LOGDIR/farce
 
-  [[ ! -z ${BRANCH_ID} ]] &&
-  case $BRANCH_ID in
-   dev* | SVN | trunk )
-    case $PROGNAME in
-      clfs2 ) TREE=branches/clfs-2.0/BOOK ;;
-           *) TREE=trunk/BOOK ;;
+  if [[ ! -z ${BRANCH_ID} ]]; then
+    case $BRANCH_ID in
+     dev* | SVN | trunk )
+      case $PROGNAME in
+        clfs2 ) TREE=branches/clfs-2.0/BOOK ;;
+             *) TREE=trunk/BOOK ;;
+      esac
+      LFSVRS=development
+      ;;
+    branch-* )
+       LFSVRS=${BRANCH_ID}
+       TREE=branches/${BRANCH_ID#branch-}/BOOK
+      ;;
+    * )
+      case $PROGNAME in
+        lfs | hlfs )
+           LFSVRS=${BRANCH_ID}
+          TREE=tags/${BRANCH_ID}/BOOK
+         ;;
+        clfs | clfs2 )
+           LFSVRS=${BRANCH_ID}
+           TREE=tags/${BRANCH_ID}
+         ;;
+      esac
+      ;;
     esac
-    LFSVRS=development
-    ;;
-  branch-* )
-     LFSVRS=${BRANCH_ID}
-     TREE=branches/${BRANCH_ID#branch-}/BOOK
-    ;;
-  * )
-    case $PROGNAME in
-      lfs | hlfs )
-         LFSVRS=${BRANCH_ID}
-         TREE=tags/${BRANCH_ID}/BOOK
-       ;;
-      clfs | clfs2 )
-         LFSVRS=${BRANCH_ID}
-         TREE=tags/${BRANCH_ID}
-       ;;
-    esac
-    ;;
-  esac
+  fi
 fi
 
 #===========================================================




More information about the alfs-log mailing list