Log installed files

Gerard Beekmans gerard at linuxfromscratch.org
Sat Mar 16 08:50:13 PST 2002

On Sat, Mar 16, 2002 at 11:33:45AM +0000, Mark Binns wrote:
> I use a combination of two methods (not exactly pretty).
> a) touch /root/timestamp
>    <do the install>
>    find / -newer /root/timestamp -print | \
>          egrep -v '^/proc' | \
>          egrep -v '^/root' | \
>          egrep -v '^/usr/src' >/root/files-modified
>    (Gets all the files that have been modified apart from in /proc, /root
>     and /usr/src. This method seems to get directories that have had
>     files modified in them too. It also doesn't work all that well for
>     things like the man-pages install as it copies files preserving their
>     older timestamps, thus not picking them up).
> b) find / -not -path '/proc*' \
>           -and -not -path '/root*' \
>           -and -not -path '/usr/src*' >/root/before
>    <do the install>
>    find / -not -path '/proc*' \
>           -and -not -path '/root*' \
>           -and -not -path '/usr/src*' >/root/after
>    cd /root
>    diff before after |egrep -v '^[0-9]' |cut -b3- >files-added

Here is how I do it. Essentially the same, it just save from having to
"egrep -v" afterwards. This setup will tell 'find' to skip it. It'll save
some time:

	touch $LFS/tmp/tmpfile

	PRUNEPATH="$LFS/proc $LFS/usr/src $LFS/tmp $LFS/usr/tmp $LFS/var/tmp
	$LFS/root $LFS/home $LFS/usr/share/misc/checklfs"

		sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`

	find $LFS -regex "$PRUNEREGEX" -prune -o -cnewer $LFS/tmp/tmpfile \
        > output-it-somewhere

Gerard Beekmans

-*- If Linux doesn't have the solution, you have the wrong problem -*-
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-support' in the subject header of the message

More information about the lfs-support mailing list