Hi guys.

At the moment, Jhalfs doesn't track what files are installed by each package 
it installs.  This causes me problems when upgrading packages in LFS, as I 
can't easily figure out if there are any new binaries or libraries that need 
adding to the book.

To that end, I've attached a work-in-progress patch that nearly does what I 
want.  What it does is touches a 'timestamp-marker' file, immediately prior 
to the 'make install' step in each package.  It then runs a `find' command to 
report all files newer than that timestamp, just prior to deleting the source 
directory.

It has the following issues though:

1) The `touch timestamp-marker' command ends up in lfs-commands/chapter0*/* 
whereas these scripts appear to match the book's instructions exactly.  I'm 
not sure if anyone will have concerns over those scripts now diverging from 
the book.

2) It touches 'timestamp-marker' in chapter 5 packages as well. While this 
doesn't cause any problems, it's unnecessary.  My XSL-fu is far from 
proficient so I wasn't sure how to prevent this from happening.

3) The functionality can't be turned off.  It'd probably be better if this 
were included in the options that control the disk usage and SBU reports, but 
I haven't got around to grokking the Kconfig syntax yet.

I'd love to see this, or some other approach to installed-file logging 
available in Jhalfs.  Comments welcome.

Regards,

Matt.
Index: LFS/lfs.xsl
===================================================================
--- LFS/lfs.xsl	(revision 3352)
+++ LFS/lfs.xsl	(working copy)
@@ -163,6 +163,15 @@
         <xsl:apply-templates/>
         <xsl:text>&#xA;fi&#xA;</xsl:text>
       </xsl:when>
+      <!-- Mark the start of each package installation so we can track what
+           files were installed -->
+      <xsl:when test="starts-with(string(), 'make') and
+                      contains(string(), 'install') and
+                      not(contains(string(), 'make install-libs'))">
+        <xsl:text>touch $PKGDIR/../timestamp-marker &amp;&amp; sleep 1 &#xA;</xsl:text>
+        <xsl:apply-templates/>
+        <xsl:text>&#xA;</xsl:text>
+      </xsl:when>
       <!-- Setting $LANG for /etc/profile -->
       <xsl:when test="ancestor::[EMAIL PROTECTED]'ch-scripts-profile'] and
                 contains(string(),'export LANG=')">
Index: common/makefile-functions
===================================================================
--- common/makefile-functions	(revision 3352)
+++ common/makefile-functions	(working copy)
@@ -111,6 +111,12 @@
 
 #==#
 
+define log_new_files
+  find / -xdev ! -path "$(crLOGDIR)/*" ! -path "/proc/*" ! -path "/tmp/*" \
+  ! -path "/dev/*" -newer $(SRC)/timestamp-marker -not -type d \
+  -fprintf $(crLOGDIR)/$(1).filelist "%p\t%s\t%u:%g\t%m\t%l\n" || true
+endef
+
 define remove_build_dirs
   @ROOT=`head -n1 $(SRCSDIR)/$(PKG_LST) | sed '[EMAIL PROTECTED]/@@;s@/.*@@'` && \
   rm -rf $(SRCSDIR)/$$ROOT && \
Index: common/libs/func_wrt_Makefile
===================================================================
--- common/libs/func_wrt_Makefile	(revision 3352)
+++ common/libs/func_wrt_Makefile	(working copy)
@@ -308,6 +308,7 @@
   local name=$1
 (
 cat << EOF
+	@\$(call log_new_files,$name)
 	@\$(call remove_build_dirs2,$name)
 EOF
 ) >> $MKFILE.tmp
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to