r3353 - in jhalfs/trunk: . LFS common common/libs

manuel at linuxfromscratch.org manuel at linuxfromscratch.org
Sat Apr 28 08:24:21 PDT 2007


Author: manuel
Date: 2007-04-28 09:24:20 -0600 (Sat, 28 Apr 2007)
New Revision: 3353

Modified:
   jhalfs/trunk/Config.in
   jhalfs/trunk/LFS/master.sh
   jhalfs/trunk/common/libs/func_validate_configs.sh
   jhalfs/trunk/common/libs/func_wrt_Makefile
   jhalfs/trunk/common/makefile-functions
   jhalfs/trunk/jhalfs
Log:
LFS: Added support for installed files logs.
Should be ported to other books when verified that works as expected.

Modified: jhalfs/trunk/Config.in
===================================================================
--- jhalfs/trunk/Config.in	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/Config.in	2007-04-28 15:24:20 UTC (rev 3353)
@@ -733,6 +733,17 @@
 
 	#--- End Test Suites
 
+	#--- Installed files logs
+	config	INSTALL_LOG
+		bool	"Create installed files logs"
+		default	n
+		depends on BOOK_LFS
+		help
+			#-- Select this if you want to create logs of the files
+			#   installed by each package on the final system.
+
+	#--- End Installed files logs
+
 	#--- FSTAB
 	config	HAVE_FSTAB
 		bool	"Use a custom fstab file"
@@ -920,14 +931,30 @@
 			string "jhalfs directory"
 			default "$BUILDDIR/$SCRIPT_ROOT"
 
+		config	LOGDIRBASE
+			string "Build logs directory basename"
+			default "logs"
+
 		config	LOGDIR
 			string "Build logs directory"
-			default "$JHALFSDIR/logs"
+			default "$JHALFSDIR/$LOGDIRBASE"
 
+		config	TESTLOGDIRBASE
+			string "Test suites logs directory basename"
+			default "test-logs"
+
 		config	TESTLOGDIR
 			string "Test suites logs directory"
-			default "$JHALFSDIR/test-logs"
+			default "$JHALFSDIR/$TESTLOGDIRBASE"
 
+		config	FILELOGDIRBASE
+			string "Installed files logs directory basename"
+			default "installed-files"
+
+		config	FILELOGDIR
+			string "Installed files logs directory"
+			default "$JHALFSDIR/$FILELOGDIRBASE"
+
 		config	ICALOGDIR
 			string "ICA logs directory"
 			default "$LOGDIR/ICA"

Modified: jhalfs/trunk/LFS/master.sh
===================================================================
--- jhalfs/trunk/LFS/master.sh	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/LFS/master.sh	2007-04-28 15:24:20 UTC (rev 3353)
@@ -232,6 +232,10 @@
     # If $pkg_tarball isn't empty, we've got a package...
     # Insert instructions for unpacking the package and changing directories
     if [ "$pkg_tarball" != "" ] ; then
+      # Touch timestamp file if inelalled files logs will be created.
+      if [ "${INSTALL_LOG}" = "y" ] ; then
+        CHROOT_wrt_TouchTimestamp
+      fi
       CHROOT_Unpack "$pkg_tarball"
       # If the testsuites must be run, initialize the log file
       case $name in
@@ -253,9 +257,13 @@
       *)        CHROOT_wrt_RunAsRoot "$file" ;;
     esac
 
-    # Remove the build directory(ies) except if the package build fails.
+    # Write installed files log and remove the build directory(ies)
+    # except if the package build fails.
     if [ "$pkg_tarball" != "" ] ; then
       CHROOT_wrt_RemoveBuildDirs "$name"
+      if [ "${INSTALL_LOG}" = "y" ] ; then
+        CHROOT_wrt_LogNewFiles "$name"
+      fi
     fi
 
     # Include a touch of the target name so make can check
@@ -310,11 +318,17 @@
             name="lfs-bootscripts"
             pkg_tarball=$(get_package_tarball_name $name)
             CHROOT_Unpack "$pkg_tarball"
+            if [ "${INSTALL_LOG}" = "y" ] ; then
+              CHROOT_wrt_TouchTimestamp
+            fi
         ;;
       *kernel)
             name="linux"
             pkg_tarball=$(get_package_tarball_name $name)
             CHROOT_Unpack "$pkg_tarball"
+            if [ "${INSTALL_LOG}" = "y" ] ; then
+              CHROOT_wrt_TouchTimestamp
+            fi
        ;;
     esac
 
@@ -331,8 +345,14 @@
     esac
 
     case "${this_script}" in
-      *bootscripts)  CHROOT_wrt_RemoveBuildDirs "dummy" ;;
-      *kernel)       CHROOT_wrt_RemoveBuildDirs "dummy" ;;
+      *bootscripts)  CHROOT_wrt_RemoveBuildDirs "dummy"
+                     if [ "${INSTALL_LOG}" = "y" ] ; then
+                       CHROOT_wrt_LogNewFiles "$name"
+                     fi ;;
+      *kernel)       CHROOT_wrt_RemoveBuildDirs "dummy"
+                     if [ "${INSTALL_LOG}" = "y" ] ; then
+                       CHROOT_wrt_LogNewFiles "$name"
+                     fi ;;
     esac
 
     # Include a touch of the target name so make can check

Modified: jhalfs/trunk/common/libs/func_validate_configs.sh
===================================================================
--- jhalfs/trunk/common/libs/func_validate_configs.sh	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/common/libs/func_validate_configs.sh	2007-04-28 15:24:20 UTC (rev 3353)
@@ -20,11 +20,11 @@
 inline_doc
 
   # First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
-  local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL       GRSECURITY_HOST                   TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
-  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH                 TARGET TARGET32   TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
-  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH                 TARGET                                    REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
-  local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH PLATFORM        TARGET MIPS_LEVEL                         REPORT                                            FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME           CUSTOM_TOOLS REBUILD_MAKEFILE"
-  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                                               TEST BOMB_TEST OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
+  local -r  hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL       GRSECURITY_HOST                   TEST BOMB_TEST             OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL         PAGE TIMEZONE LANG LC_ALL LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
+  local -r  clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH                 TARGET TARGET32   TEST BOMB_TEST             OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
+  local -r clfs2_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH                 TARGET                                                REPORT                                      STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
+  local -r clfs3_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE        ARCH PLATFORM        TARGET MIPS_LEVEL                                     REPORT                                            FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME           CUSTOM_TOOLS REBUILD_MAKEFILE"
+  local -r   lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE                                               TEST BOMB_TEST INSTALL_LOG OPTIMIZE REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB             CONFIG GETKERNEL VIMLANG PAGE TIMEZONE LANG        LUSER LGROUP LHOME BLFS_TOOL CUSTOM_TOOLS REBUILD_MAKEFILE"
   local -r  blfs_PARAM_LIST="BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR"
 
   local -r blfs_tool_PARAM_LIST="BLFS_BRANCH_ID BLFS_ROOT BLFS_XML TRACKING_DIR DEP_LIBXML DEP_LIBXSLT DEP_TIDY DEP_UNZIP DEP_DBXML DEP_DBXSL DEP_LINKS DEP_SUDO DEP_WGET DEP_SVN DEP_GPM"
@@ -116,6 +116,7 @@
       CUSTOM_TOOLS    | \
       TIMEZONE        | \
       PAGE            | \
+      INSTALL_LOG     | \
       REBUILD_MAKEFILE ) echo -e "`eval echo $PARAM_VALS`" ;;
 
       # Envvars that depend on other settings to be displayed

Modified: jhalfs/trunk/common/libs/func_wrt_Makefile
===================================================================
--- jhalfs/trunk/common/libs/func_wrt_Makefile	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/common/libs/func_wrt_Makefile	2007-04-28 15:24:20 UTC (rev 3353)
@@ -28,12 +28,13 @@
 BASEDIR        = \$(MOUNT_PT)
 SRCSDIR        = \$(BASEDIR)/sources
 CMDSDIR        = \$(BASEDIR)/\$(SCRIPT_ROOT)/$PROGNAME-commands
-LOGDIR         = \$(BASEDIR)/\$(SCRIPT_ROOT)/logs
-TESTLOGDIR     = \$(BASEDIR)/\$(SCRIPT_ROOT)/test-logs
+LOGDIR         = \$(BASEDIR)/\$(SCRIPT_ROOT)/$LOGDIRBASE
+TESTLOGDIR     = \$(BASEDIR)/\$(SCRIPT_ROOT)/$TESTLOGDIRBASE
 
 crCMDSDIR      = /\$(SCRIPT_ROOT)/$PROGNAME-commands
-crLOGDIR       = /\$(SCRIPT_ROOT)/logs
-crTESTLOGDIR   = /\$(SCRIPT_ROOT)/test-logs
+crLOGDIR       = /\$(SCRIPT_ROOT)/$LOGDIRBASE
+crTESTLOGDIR   = /\$(SCRIPT_ROOT)/$TESTLOGDIRBASE
+crFILELOGDIR   = /\$(SCRIPT_ROOT)/$FILELOGDIRBASE
 
 SU_LUSER       = su - \$(LUSER) -c
 LUSER_HOME     = \$(LHOME)/\$(LUSER)
@@ -289,6 +290,33 @@
 #=======================
 
 
+#==== INSTALLED FILES LOGS ====
+
+#----------------------------------#
+CHROOT_wrt_TouchTimestamp() {      #
+#----------------------------------#
+  local name=$1
+(
+cat << EOF
+	@\$(call touch_timestamp)
+EOF
+) >> $MKFILE.tmp
+}
+
+#----------------------------------#
+CHROOT_wrt_LogNewFiles() {         #
+#----------------------------------#
+  local name=$1
+(
+cat << EOF
+	@\$(call log_new_files,$name)
+EOF
+) >> $MKFILE.tmp
+}
+
+#=======================
+
+
 #==== RM BUILD DIRS ====
 
 #----------------------------------#

Modified: jhalfs/trunk/common/makefile-functions
===================================================================
--- jhalfs/trunk/common/makefile-functions	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/common/makefile-functions	2007-04-28 15:24:20 UTC (rev 3353)
@@ -111,6 +111,19 @@
 
 #==#
 
+define touch_timestamp
+  @touch $(SRC)/timestamp-marker && sleep 1
+endef
+
+define log_new_files
+  @find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/proc/*" \
+  ! -path "/tmp/*" ! -path "/dev/*" ! -path "$(SRC)/*" \
+  -newer $(SRC)/timestamp-marker -not -type d \
+  -fprintf $(crFILELOGDIR)/$(1) "%p\t%s\t%u:%g\t%m\t%l\n" || true
+endef
+
+#==@
+
 define remove_build_dirs
   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed 's@^./@@;s@/.*@@'` && \
   rm -rf $(SRCSDIR)/$$ROOT && \

Modified: jhalfs/trunk/jhalfs
===================================================================
--- jhalfs/trunk/jhalfs	2007-04-16 20:33:14 UTC (rev 3352)
+++ jhalfs/trunk/jhalfs	2007-04-28 15:24:20 UTC (rev 3353)
@@ -109,6 +109,7 @@
 GRSECURITY_HOST=${GRSECURITY_HOST:-n}
 CUSTOM_TOOLS=${CUSTOM_TOOLS:-n}
 REBUILD_MAKEFILE=${REBUILD_MAKEFILE:-n}
+INSTALL_LOG=${INSTALL_LOG:-n}
 
 # Book surces envars
 BRANCH_ID=${BRANCH_ID:=development}
@@ -354,6 +355,9 @@
   # Create the test-log directory, if needed
   [[ "$TEST" != "0" ]] && [[ ! -d $TESTLOGDIR ]] && install -d -m 1777 $TESTLOGDIR
   #
+  # Create the installed-files directory, if needed
+  [[ "$INSTALL_LOG" = "y" ]] && [[ ! -d $FILELOGDIR ]] && install -d -m 1777 $FILELOGDIR
+  #
   # Prepare report creation, if needed
   if [[ "$REPORT" = "y" ]]; then
     cp $COMMON_DIR/create-sbu_du-report.sh  $JHALFSDIR/




More information about the alfs-log mailing list