Ported INSTALL_LOG support to all books.

This commit is contained in:
Manuel Canales Esparcia 2007-06-03 09:06:13 +00:00
parent 350625a76a
commit f54632006b
8 changed files with 191 additions and 32 deletions

View file

@ -510,6 +510,11 @@ final_system_Makefiles() { #
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
# Touch timestamp file if installed files logs will be created.
# But only for the firt build when running iterative builds.
if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_TouchTimestamp
fi
CHROOT_Unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
case $name in
@ -526,9 +531,17 @@ final_system_Makefiles() { #
#
CHROOT_wrt_RunAsRoot "${file}"
#
[[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
# 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" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
# Include a touch of the target name so make can check
# if it's already been made.
wrt_touch
#
#--------------------------------------------------------------------#
@ -589,11 +602,23 @@ bootscripts_Makefiles() { #
#
# If $pkg_tarball isn't empty, we've got a package...
#
[[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
CHROOT_Unpack "$pkg_tarball"
fi
#
CHROOT_wrt_RunAsRoot "${file}"
#
[[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
# 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 if it's already been made.
wrt_touch
@ -658,7 +683,12 @@ bootable_Makefiles() { #
# If $pkg_tarball isn't empty, we've got a package...
# Insert instructions for unpacking the package and changing directories
#
[[ "$pkg_tarball" != "" ]] && CHROOT_Unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
CHROOT_Unpack "$pkg_tarball"
fi
#
# Select a script execution method
case $this_script in
@ -672,8 +702,14 @@ bootable_Makefiles() { #
;;
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
[[ "$pkg_tarball" != "" ]] && CHROOT_wrt_RemoveBuildDirs "${name}"
# 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 if it's already been made.
wrt_touch

View file

@ -217,6 +217,11 @@ final_system_Makefiles() { #
#
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
# Touch timestamp file if installed files logs will be created.
# But only for the firt build when running iterative builds.
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
LUSER_wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -224,7 +229,14 @@ final_system_Makefiles() { #
#
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
# Write installed files log and remove the build directory(ies)
# except if the package build fails.
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -282,11 +294,21 @@ bootscripts_Makefiles() { #
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
LUSER_wrt_unpack "$pkg_tarball"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
fi
#
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -350,7 +372,12 @@ bootable_Makefiles() { #
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
LUSER_wrt_unpack "$pkg_tarball"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
fi
#
# Select a script execution method
case $this_script in
@ -367,7 +394,12 @@ bootable_Makefiles() { #
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch

View file

@ -267,6 +267,11 @@ final_system_Makefiles() { #
#
# If $pkg_tarball isn't empty, we've got a package...
if [ "$pkg_tarball" != "" ] ; then
# Touch timestamp file if installed files logs will be created.
# But only for the firt build when running iterative builds.
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
LUSER_wrt_unpack "$pkg_tarball"
# If using optimizations, write the instructions
[[ "$OPTIMIZE" != "0" ]] && wrt_optimize "$name" && wrt_makeflags "$name"
@ -274,7 +279,14 @@ final_system_Makefiles() { #
#
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
# Write installed files log and remove the build directory(ies)
# except if the package build fails.
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -330,11 +342,21 @@ bootscripts_Makefiles() { #
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
LUSER_wrt_unpack "$pkg_tarball"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
fi
#
LUSER_wrt_RunAsUser "${file}"
#
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch
@ -398,7 +420,12 @@ bootable_Makefiles() { #
LUSER_wrt_target "${this_script}" "$PREV"
#
# If $pkg_tarball isn't empty, we've got a package...
[[ "$pkg_tarball" != "" ]] && LUSER_wrt_unpack "$pkg_tarball"
if [ "$pkg_tarball" != "" ] ; then
LUSER_wrt_unpack "$pkg_tarball"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_TouchTimestamp
fi
fi
#
# Select a script execution method
case $this_script in
@ -415,7 +442,12 @@ bootable_Makefiles() { #
esac
#
# Housekeeping...remove any build directory(ies) except if the package build fails.
[[ "$pkg_tarball" != "" ]] && LUSER_RemoveBuildDirs "${name}"
if [ "$pkg_tarball" != "" ] ; then
LUSER_RemoveBuildDirs "${name}"
if [ "${INSTALL_LOG}" = "y" ] ; then
LUSER_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
wrt_touch

View file

@ -737,7 +737,6 @@ menu "--- Build Settings"
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.

View file

@ -332,7 +332,15 @@ chapter6_Makefiles() { # sysroot or chroot build phase
# as a dependency. Also call the echo_message function.
if [[ ${name} = "butterfly-toolchain" ]]; then
CHROOT_wrt_target "${this_script}" "$PREV"
# Touch timestamp file if installed files logs will be created.
# But only for the firt build when running iterative builds.
if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_TouchTimestamp
fi
process_toolchain "${this_script}" "${file}"
if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
wrt_touch
PREV=$this_script
continue
@ -346,6 +354,11 @@ chapter6_Makefiles() { # sysroot or chroot build phase
# 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 installed files logs will be created.
# But only for the firt build when running iterative builds.
if [ "${INSTALL_LOG}" = "y" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_TouchTimestamp
fi
CHROOT_Unpack "$pkg_tarball"
# If the testsuites must be run, initialize the log file
# butterfly-toolchain tests are enabled in 'process_tookchain' function
@ -365,9 +378,13 @@ chapter6_Makefiles() { # sysroot or chroot build phase
* ) 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" ] && [ "x${N}" = "x" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
fi
#
# Include a touch of the target name so make can check if it's already been made.
@ -427,6 +444,9 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
case "${this_script}" in
*bootscripts*)
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_TouchTimestamp
fi
CHROOT_Unpack $(get_package_tarball_name "lfs-bootscripts")
blfs_bootscripts=$(get_package_tarball_name "blfs-bootscripts" | sed -e 's/.tar.*//' )
echo -e "\t@echo \"\$(MOUNT_PT)\$(SRC)/$blfs_bootscripts\" >> sources-dir" >> $MKFILE.tmp
@ -434,6 +454,9 @@ chapter7_Makefiles() { # Create a bootable system.. kernel, bootscripts..e
*kernel)
name="linux"
pkg_tarball=$(get_package_tarball_name $name)
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_TouchTimestamp
fi
CHROOT_Unpack "$pkg_tarball"
;;
esac
@ -462,8 +485,14 @@ cat << EOF
rm sources-dir
EOF
) >> $MKFILE.tmp
if [ "${INSTALL_LOG}" = "y" ] ; then
CHROOT_wrt_LogNewFiles "$name"
fi
;;
*kernel) CHROOT_wrt_RemoveBuildDirs "dummy" ;;
*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 if it's already been made.

View file

@ -25,7 +25,7 @@ inline_doc
local -r GENERAL_common="LUSER LGROUP LHOME BUILDDIR CLEAN GETPKG SRC_ARCHIVE \
SERVER GETKERNEL RUNMAKE"
local -r BUILD_chroot="TEST BOMB_TEST STRIP"
local -r BUILD_common="FSTAB CONFIG TIMEZONE PAGE LANG"
local -r BUILD_common="FSTAB CONFIG TIMEZONE PAGE LANG INSTALL_LOG"
local -r ADVANCED_chroot="COMPARE RUN_ICA RUN_FARCE ITERATIONS OPTIMIZE"
local -r ADVANCED_common="REPORT REBUILD_MAKEFILE"
@ -37,10 +37,10 @@ inline_doc
local -r CLFS3_book="$BOOK_common $BOOK_clfsX PLATFORM MIPS_LEVEL"
# Build Settings by book
local -r LFS_build="$BUILD_chroot $BUILD_common VIMLANG INSTALL_LOG"
local -r LFS_build="$BUILD_chroot VIMLANG $BUILD_common"
local -r HLFS_build="$BUILD_chroot $BUILD_common LC_ALL"
local -r CLFS_build="$BUILD_chroot $BUILD_common VIMLANG"
local -r CLFS2_build="STRIP $BUILD_common VIMLANG"
local -r CLFS_build="$BUILD_chroot VIMLANG $BUILD_common"
local -r CLFS2_build="STRIP VIMLANG $BUILD_common"
local -r CLFS3_build=" $BUILD_common"
# Full list of books settings

View file

@ -309,6 +309,16 @@ EOF
#==== INSTALLED FILES LOGS ====
#----------------------------------#
LUSER_wrt_TouchTimestamp() { #
#----------------------------------#
(
cat << EOF
@\$(call touch_timestamp_LUSER)
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
CHROOT_wrt_TouchTimestamp() { #
#----------------------------------#
@ -319,6 +329,17 @@ EOF
) >> $MKFILE.tmp
}
#----------------------------------#
LUSER_wrt_LogNewFiles() { #
#----------------------------------#
local name=$1
(
cat << EOF
@\$(call log_new_files_LUSER,$name)
EOF
) >> $MKFILE.tmp
}
#----------------------------------#
CHROOT_wrt_LogNewFiles() { #
#----------------------------------#

View file

@ -115,12 +115,22 @@ define touch_timestamp
@touch $(SRC)/timestamp-marker && sleep 1
endef
define touch_timestamp_LUSER
@touch $(SRCDIR)/timestamp-marker && sleep 1
endef
define log_new_files
@find / -xdev ! -path "/$(SCRIPT_ROOT)/*" ! -path "/tmp/*" ! -path "$(SRC)/*" \
-newer $(SRC)/timestamp-marker -not -type d \
-printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(crFILELOGDIR)/$(1)
endef
define log_new_files_LUSER
@find $(BASEDIR) -xdev ! -path "$(BASEDIR)/$(SCRIPT_ROOT)/*" ! -path "$(BASEDIR)/tmp/*" ! -path "$(SRCDIR)/*" \
-newer $(SRCDIR)/timestamp-marker -not -type d \
-printf "%p\t%s\t%u:%g\t%m\t%l\n" | sort > $(BASEDIR)$(crFILELOGDIR)/$(1)
endef
#==@
define remove_build_dirs