- # Displaying package build size in log file
- BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }')
- echo " Build size : ${BUILD_SIZE}" 1>> ${LFS_LOG_FILE}
-
- # Some scripts need to preserve the source or build directory. They can
- # do so by renaming them.
- if [ -d ${LFS_TMP}/${PACKAGE} ]; then
- # Removing source directory
- echo "Removing source directory"
- rm -rf ${LFS_TMP}/${PACKAGE}
- fi
- if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
- # Removing build directory
- echo "Removing build directory"
- rm -rf ${LFS_TMP}/${PACKAGE}-build
+ if [ "x${DECOMPRESS}" = "x1" ]; then
+ # Saving package build size in global variable
+ BUILD_SIZE=$(du -h -s -c ${LFS_TMP}/${PACKAGE} ${LFS_TMP}/${PACKAGE}-build | grep total | awk '{ print $1 }')
+
+ # Some scripts need to preserve the source or build directory. They can
+ # do so by renaming them.
+ if [ -d ${LFS_TMP}/${PACKAGE} ]; then
+ # Removing source directory
+ echo "Removing source directory"
+ rm -rf ${LFS_TMP}/${PACKAGE}
+ fi
+ if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
+ # Removing build directory
+ echo "Removing build directory"
+ rm -rf ${LFS_TMP}/${PACKAGE}-build
+ fi
+ else
+ BUILD_SIZE="Unknown"