#!/bin/bash # By Gerard Beekmans [ -x /usr/bin/clear ] && clear show_help() { echo "Usage: $0 [-c5] {package}" echo "-c5: use with LFS-Book Chapter 5 installation: use \$LFS" echo " as the root directory instead of /" echo "package: the package whose installation you wish to log" echo exit } c5="" pkgname="" while [ -n "$1" ]; do case "$1" in -c5) if [ -z "$c5" ]; then c5="c5-"; fi if [ -z "$pkgname" ]; then pkgname=$c5$pkgname; fi shift ;; *) pkgname=$c5$1 && shift ;; esac done [ -z "$pkgname" ] && show_help install_log=$LFS/usr/share/checklfs/install-logs/$pkgname tmpfile=$LFS/tmp/tmpfile PRUNEPATH="$LFS/proc $LFS/usr/src $LFS/tmp $LFS/usr/tmp $LFS/root $LFS/home $LFS/usr/share/checklfs $LFS/mnt $LFS/dev $LFS/usr/var $LFS/usr/misc $LFS/var /etc/cups/certs" PRUNEREGEX=`echo $PRUNEPATH | \ sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'` touch $tmpfile sleep 1 echo "Start the installation of $pkgname now." echo "Press Enter when the package is installed." read echo "Obtaining list of new and changed files..." find $LFS/ -regex "$PRUNEREGEX" -prune -o -cnewer $tmpfile -print \ > $install_log sed 's%//%/%' $install_log > $install_log.tmp mv $install_log.tmp $install_log # FIX ME #if [ -n "$c5" ] #then # sed s%$LFS%\$LFS% $install_log > $install_log.tmp # mv $install_log.tmp $install_log #fi rm $tmpfile vim $install_log echo "Done" echo