Indication d'un paquet installé par fichier <paquet>.done au lieu d'écrire l'informat...
authorgobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 28 Aug 2011 00:19:21 +0000 (00:19 +0000)
committergobo72 <gobo72@364a67c3-989e-7be9-548d-dae8560ea662>
Sun, 28 Aug 2011 00:19:21 +0000 (00:19 +0000)
functions/ipkg
functions/main

index a3dc0e4..77f51c4 100644 (file)
@@ -1,5 +1,12 @@
 #!/bin/bash
 
+# Global input variables:
+#   PACKAGE_STATUS
+#
+# Global output variables:
+#  BUILD_SIZE
+#  SOURCE_SIZE
+
 function_exists()
 {
     local FUNCTION_NAME=$1
@@ -29,8 +36,8 @@ ipkg_decompress_package()
         mv -v ${LFS_TMP}/${DECOMPRESSED_DIRNAME} ${LFS_TMP}/${PACKAGE}
     fi
 
-    # Displaying package source size in log file
-    echo "  Source size:" $(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }') 1>> ${LFS_LOG_FILE}
+    # Saving package source size in global variable.
+    SOURCE_SIZE=$(du -h -s ${LFS_TMP}/${PACKAGE} | awk '{ print $1 }')
 
     # Removing old build directory (if any)
     if [ -d ${LFS_TMP}/${PACKAGE}-build ]; then
@@ -90,9 +97,8 @@ ipkg_finish()
     # Make sure to return to scripts directory
     cd ${SCRDIR}
 
-    # Displaying package build size in log file
+    # 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 }')
-    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.
@@ -118,7 +124,6 @@ ipkg_script()
     else
         # Use default script name
         PACKAGE_DEF=${SCRDIR}/pkg/$(get_pkg_name ${PACKAGE})
-
     fi
 
     ipkg_decompress_package
index b02efa8..8b14988 100644 (file)
@@ -576,7 +576,7 @@ hv_groupadd()
     done
 
     if ! cat /etc/group | egrep -q "^${groupname}:"; then
-        groupadd ${arguments}    
+        groupadd ${arguments}
     fi
 }
 
@@ -817,6 +817,8 @@ indicate_pkg_build_complete()
     local PACKAGE_DONE=${LFS_LOG_DIR}/${HVLABEL}.done
 
     ipkg_display_build_infos > ${PACKAGE_STATUS}
+    echo "Source size: " ${SOURCE_SIZE} >> ${PACKAGE_STATUS}
+    echo "Build  size: " ${BUILD_SIZE}  >> ${PACKAGE_STATUS}
     echo -n "Build time: " >> ${PACKAGE_STATUS}
     display_build_time >> ${PACKAGE_STATUS}
     echo -e "\n" >> ${PACKAGE_STATUS}
@@ -906,12 +908,16 @@ ipkg()
 
     PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
     PACKAGE_DONE=${LFS_LOG_DIR}/${HVLABEL}.done
+    PACKAGE_STATUS=${LFS_LOG_DIR}/${HVLABEL}.status
 
     # Checking if package was previously successfully installed
     if [ -f ${PACKAGE_DONE} ]; then
        return $EXIT_SUCCESS
     fi
 
+    # Create or empty status file
+    cp /dev/null ${PACKAGE_STATUS}
+
     # Displaying label
     MSGSTRING="Installing ${HVLABEL}"
     display_checkbox_msg ${MSGSTRING}
@@ -999,12 +1005,16 @@ rscr()
 
     PACKAGE_LOG=${LFS_LOG_DIR}/${HVLABEL}.log
     PACKAGE_DONE=${LFS_LOG_DIR}/${HVLABEL}.done
+    PACKAGE_STATUS=${LFS_LOG_DIR}/${HVLABEL}.status
 
     if [ "x${SCRMODE}" = "xonce" ]; then
         # Checking if package was previously successfully installed
         if [ -f ${PACKAGE_DONE} ]; then
            return $EXIT_SUCCESS
         fi
+
+        # Create or empty status file
+        cp /dev/null ${PACKAGE_STATUS}
     fi
 
     display_checkbox_msg ${MSGSTRING}
@@ -1012,7 +1022,7 @@ rscr()
     ipkg_trap_setup
 
     echo "------------------------" 1>> ${LFS_LOG_FILE}
-    echo ${HVLABEL} 1>> ${LFS_LOG_FILE}
+    echo "Running script ${HVLABEL}" 1>> ${LFS_LOG_FILE}
 
     # Executing script
     ${SCRDIR}/${SCRIPT} ${SCRIPT_ARGS} 1>> ${PACKAGE_LOG} 2>&1
@@ -1024,7 +1034,7 @@ rscr()
     echo "Completed" 1>> ${LFS_LOG_FILE}
 
     if [ "x${SCRMODE}" = "xonce" ]; then
-        # Report successfull installation of the package.
+        # Report successfull installation of the script.
         indicate_pkg_build_complete ${HVLABEL}
     fi