diff --git a/CLFS/clfs.xsl b/CLFS/clfs.xsl
index f0e871e..0562fb8 100644
--- a/CLFS/clfs.xsl
+++ b/CLFS/clfs.xsl
@@ -112,6 +112,9 @@
+
+ echo -e "\n\nTotalseconds: $SECONDS\n"
+
exit
diff --git a/HLFS/hlfs.xsl b/HLFS/hlfs.xsl
index e8d0fb4..aa9504a 100644
--- a/HLFS/hlfs.xsl
+++ b/HLFS/hlfs.xsl
@@ -111,13 +111,13 @@
pushd ../; tar -xvf gettext-&gettext-version;.*; popd;
-
tar -xvf gcc-core-&gcc-version;.*;
tar -xvf binutils-&binutils-version;.*;
-
tar -xvf gcc-g++-&gcc-version;.*;
@@ -128,6 +128,10 @@
+
+ echo -e "\n\nTotalseconds: $SECONDS\n"
+
exit
diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl
index 7350b43..fcb9126 100644
--- a/LFS/lfs.xsl
+++ b/LFS/lfs.xsl
@@ -105,7 +105,11 @@
- exit
+
+ echo -e "\n\nTotalseconds: $SECONDS\n"
+
+ exit
diff --git a/common/create-sbu_du-report.sh b/common/create-sbu_du-report.sh
index 1e08bf4..e0a44ed 100755
--- a/common/create-sbu_du-report.sh
+++ b/common/create-sbu_du-report.sh
@@ -53,7 +53,7 @@ BUILDLOGS="`grep -l "^Totalseconds:" ${LOGSDIR}/*`"
# Match the first timed log to extract the SBU unit value from it
BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1`
echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value."
-SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $BASELOG`
+SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG`
echo -e "\nThe SBU unit value is equal to $SBU_UNIT seconds.\n"
echo -e "\n\n$LINE\n\nThe SBU unit value is equal to $SBU_UNIT seconds.\n" >> "$REPORT"
@@ -70,13 +70,13 @@ for log in $BUILDLOGS ; do
# Start SBU calculation
# Build time
- TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*.[[:digit:]]*\)$/\1/p' $log`
+ TIME=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $log`
SECS=`perl -e 'print ('$TIME' % '60')';`
MINUTES=`perl -e 'printf "%.0f" , (('$TIME' - '$SECS') / '60')';`
- SBU=`perl -e 'printf "%.3f" , ('$TIME' / '$SBU_UNIT')';`
+ SBU=`perl -e 'printf "%.1f" , ('$TIME' / '$SBU_UNIT')';`
# Append SBU value to SBU2 for grand total
- SBU2=`perl -e 'printf "%.3f" , ('$SBU2' + '$SBU')';`
+ SBU2=`perl -e 'printf "%.1f" , ('$SBU2' + '$SBU')';`
# Start disk usage calculation
# Disk usage before unpacking the package
diff --git a/common/libs/func_wrt_Makefile b/common/libs/func_wrt_Makefile
index 4a51ea3..20fadc3 100644
--- a/common/libs/func_wrt_Makefile
+++ b/common/libs/func_wrt_Makefile
@@ -40,8 +40,6 @@ SU_LUSER = su - \$(LUSER) -c
LUSER_HOME = \$(LHOME)/\$(LUSER)
PRT_DU = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found \$(MOUNT_PT) \`\n"
PRT_DU_CR = echo -e "\nKB: \`du -skx --exclude=\$(SCRIPT_ROOT) --exclude=lost+found / \`\n"
-TIME_MARK = \`date +%s.%N\`
-BUILD_TIME = perl -e "printf \"\nTotalseconds: %.3f\", ('\$\$end' - '\$\$start')"
ADD_REPORT = $REPORT
ADD_CUSTOM_TOOLS = $CUSTOM_TOOLS
@@ -234,10 +232,8 @@ wrt_RunAsRoot() { # Some scripts must be run as root..
(
cat << EOF
- @start=\$(TIME_MARK) && \\
- export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
+ @export ${MOUNT_ENV}=\$(MOUNT_PT) && \\
${PROGNAME}-commands/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
- end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
\$(PRT_DU) >>logs/\$@
EOF
) >> $MKFILE.tmp
@@ -250,10 +246,8 @@ LUSER_wrt_RunAsUser() { # Calculate time with perl, footer to log fil
(
cat << EOF
- @start=\$(TIME_MARK) && \\
- source ~/.bashrc && \\
+ @source ~/.bashrc && \\
\$(CMDSDIR)/`dirname $file`/\$@ >> logs/\$@ 2>&1 && \\
- end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
\$(PRT_DU) >>logs/\$@
EOF
) >> $MKFILE.tmp
@@ -265,10 +259,8 @@ CHROOT_wrt_RunAsRoot() { #
local file=$1
(
cat << EOF
- @start=\$(TIME_MARK) && \\
- source envars && \\
+ @source envars && \\
\$(crCMDSDIR)/`dirname $file`/\$@ >>logs/\$@ 2>&1 && \\
- end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
\$(PRT_DU_CR) >>logs/\$@
EOF
) >> $MKFILE.tmp
@@ -285,9 +277,7 @@ LUSER_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
- @start=\$(TIME_MARK) && \\
- cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
- end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
+ @cp -v \$(MOUNT_PT)/sources/fstab \$(MOUNT_PT)/etc/fstab >>logs/\$@ 2>&1 && \\
\$(PRT_DU) >>logs/\$@
EOF
) >> $MKFILE.tmp
@@ -298,9 +288,7 @@ CHROOT_wrt_CopyFstab() { #
#----------------------------------#
(
cat << EOF
- @start=\$(TIME_MARK) && \\
- cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
- end=\$(TIME_MARK) && \$(BUILD_TIME) >>logs/\$@ && \\
+ @cp -v /sources/fstab /etc/fstab >>logs/\$@ 2>&1 && \\
\$(PRT_DU_CR) >>logs/\$@
EOF
) >> $MKFILE.tmp
diff --git a/common/makefile-functions b/common/makefile-functions
index 3f4f110..626567b 100644
--- a/common/makefile-functions
+++ b/common/makefile-functions
@@ -64,17 +64,21 @@ endef
define remove_existing_dirs
@PKG_PATH=`ls -t $(SRCSDIR)/$(1) | head -n1` && \
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
- test -n "$$ROOT" -a -d $(SRCSDIR)/$$ROOT && \
- rm -rf $(SRCSDIR)/$$ROOT && \
- rm -rf $(SRCSDIR)/$${ROOT%-*}-build
+ [ -n "$$ROOT" ] && \
+ if [ -d $(SRCDIR)/$$ROOT ]; then \
+ rm -rf $(SRCSDIR)/$$ROOT && \
+ rm -rf $(SRCSDIR)/$${ROOT%-*}-build; \
+ fi;
endef
define remove_existing_dirs2
@PKG_PATH=`ls -t $(SRC)/$(1) | head -n1` && \
ROOT=`tar -tf $$PKG_PATH | head -n1 | sed -e 's@^./@@;s@/.*@@'` && \
- test -n "$$ROOT" -a -d $(SRC)/$$ROOT && \
- rm -rf $(SRC)/$$ROOT && \
- rm -rf $(SRC)/$${ROOT%-*}-build
+ [ -n "$$ROOT" ] && \
+ if [ -d $(SRC)/$$ROOT ]; then \
+ rm -rf $(SRC)/$$ROOT && \
+ rm -rf $(SRC)/$${ROOT%-*}-build; \
+ fi;
endef
#==#