r2572 - jhalfs/branches/experimental/common

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Mon Apr 24 09:41:29 PDT 2006


Author: manuel
Date: 2006-04-24 10:41:29 -0600 (Mon, 24 Apr 2006)
New Revision: 2572

Modified:
   jhalfs/branches/experimental/common/common-functions
Log:
Merged r2570 and r2571 from trunk.

Modified: jhalfs/branches/experimental/common/common-functions
===================================================================
--- jhalfs/branches/experimental/common/common-functions	2006-04-24 16:36:08 UTC (rev 2571)
+++ jhalfs/branches/experimental/common/common-functions	2006-04-24 16:41:29 UTC (rev 2572)
@@ -201,7 +201,7 @@
 
 
 #----------------------------------#
-wrt_target() {                     #
+wrt_target() {                     # Create target and initialize log file
 #----------------------------------#
   local i=$1
   local PREV=$2
@@ -210,6 +210,7 @@
 
 $i:  $PREV
 	@\$(call echo_message, Building)
+	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >logs/$this_script
 EOF
 ) >> $MKFILE.tmp
 }
@@ -273,93 +274,57 @@
 
 
 #----------------------------------#
-wrt_run_as_su() {                  # header to log file, execute script, footer to log file
+wrt_run_as_su() {                  # Execute script inside time { }, footer to log file
 #----------------------------------#
   local this_script=$1
   local file=$2
 (
 cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/$this_script && \\
-	su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { su - lfs -c "source /home/lfs/.bashrc && $JHALFSDIR/${PROGNAME}-commands/$file" >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
 EOF
 ) >> $MKFILE.tmp
 }
 
 
 #----------------------------------#
-wrt_run_as_root() {                #
+wrt_run_as_root() {                # Some scripts must be run as root..
 #----------------------------------#
   local this_script=$1
   local file=$2
 (
 cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/$this_script && \\
-	export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/$this_script
+	@( time { export LFS=\$(MOUNT_PT) && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/$this_script
 EOF
 ) >> $MKFILE.tmp
 }
 
 
 #=============================#
-wrt_run_as_root2() {          # Some scripts must be run as root..
+wrt_run_as_root2() {          #
 #=============================#
   local this_script=$1
   local file=$2
 (
 cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \`\n" >logs/$this_script && \\
-	source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -sk --exclude={0,1}??-* \`\n" >>logs/$this_script
+	@( time { source envars && ${PROGNAME}-commands/$file >>logs/$this_script 2>&1 ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=jhalfs \`\n" >>logs/$this_script
 EOF
 ) >> $MKFILE.tmp
 }
 
 
-#----------------------------------#
-wrt_remove_build_dirs() {          #
-#----------------------------------#
-  local name=$1
-(
-cat << EOF
-	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
-	if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
-		rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
-	fi;
-EOF
-) >> $MKFILE.tmp
-}
 
-
 #----------------------------------#
-wrt_remove_build_dirs2() {         #
-#----------------------------------#
-  local name=$1
-(
-cat << EOF
-	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
-	rm -r \$(SRC)/\$\$ROOT && \\
-	if [ -e \$(SRC)/$name-build ]; then \\
-		rm -r \$(SRC)/$name-build; \\
-	fi;
-EOF
-) >> $MKFILE.tmp
-}
-
-
-
-#----------------------------------#
 wrt_run_as_chroot1() {             #
 #----------------------------------#
   local this_script=$1
   local file=$2
 (
     cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/${this_script} && \\
-	\$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' && \\
-	echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/${this_script}
+	@( time { \$(CHROOT1) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
 EOF
 ) >> $MKFILE.tmp
 }
@@ -372,9 +337,8 @@
   local file=$2
 (
 cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/${this_script} && \\
-	\$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' && \\
-	echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/${this_script}
+	@( time { \$(CHROOT2) 'cd /jhalfs && source envars && /jhalfs/${PROGNAME}-commands/$file >>/jhalfs/logs/${this_script} 2>&1' ; } ) 2>>logs/$this_script && \\
+	echo -e "\nKB: \`du -skx --exclude=jhalfs \$(MOUNT_PT)\`\n" >>logs/${this_script}
 EOF
 ) >> $MKFILE.tmp
 }
@@ -386,38 +350,55 @@
   local i=$1
 (
     cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >logs/$i && \\
-	cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \$(MOUNT_PT)\`\n" >>logs/$i
+	@cp -v $FSTAB \$(MOUNT_PT)/etc/fstab >>logs/$i 2>&1
 EOF
 ) >> $MKFILE.tmp
 }
 
 #----------------------------------#
-wrt_copy_fstab2() {                 #
+wrt_copy_fstab2() {                #
 #----------------------------------#
   local i=$1
 (
     cat << EOF
-	@echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \`\n" >logs/$i && \\
-	cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1 && \\
-	echo -e "\n\`date\`\n\nKB: \`du -skx --exclude={0,1}??-* \`\n" >>logs/$i
+	@cp -v /sources/fstab /etc/fstab >>logs/$i 2>&1
 EOF
 ) >> $MKFILE.tmp
 }
 
 
 #----------------------------------#
-wrt_export_pkgdir() {              #
+wrt_remove_build_dirs() {          #
 #----------------------------------#
+  local name=$1
 (
-    cat << EOF
-	@echo "export PKGDIR=\$(SRC)/binutils-build" > envars
+cat << EOF
+	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
+	rm -r \$(MOUNT_PT)\$(SRC)/\$\$ROOT && \\
+	if [ -e \$(MOUNT_PT)\$(SRC)/$name-build ]; then \\
+		rm -r \$(MOUNT_PT)\$(SRC)/$name-build; \\
+	fi;
 EOF
 ) >> $MKFILE.tmp
 }
 
 
+#----------------------------------#
+wrt_remove_build_dirs2() {         #
+#----------------------------------#
+  local name=$1
+(
+cat << EOF
+	@ROOT=\`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'\` && \\
+	rm -r \$(SRC)/\$\$ROOT && \\
+	if [ -e \$(SRC)/$name-build ]; then \\
+		rm -r \$(SRC)/$name-build; \\
+	fi;
+EOF
+) >> $MKFILE.tmp
+}
+
+
 #----------------------------#
 run_make() {
 #----------------------------#




More information about the alfs-log mailing list