Current BE-LFS (but w/ GCC 3.3.3) merged -> 6.0 branch
[linux_from_scratch.git] / checklfs / bin / log-install
blobd05bf452c3f939389286ca71e5acd3046e9dfc5c
1 #!/bin/bash
2 # By Gerard Beekmans <gerard@linuxfromscratch.org>
4 [ -x /usr/bin/clear ] && clear
6 show_help()
8 echo "Usage: $0 [-c5] {package}"
9 echo "-c5: use with LFS-Book Chapter 5 installation: use \$LFS"
10 echo " as the root directory instead of /"
11 echo "package: the package whose installation you wish to log"
12 echo
13 exit
16 c5=""
17 pkgname=""
18 root=""
20 while [ -n "$1" ]; do
21 case "$1" in
22 -c5) if [ -z "$c5" ]; then c5="c5-"; fi
24 if [ -z "$pkgname" ]; then pkgname=$c5$pkgname; fi
25 shift
28 pkgname=$c5$1 && shift
30 esac
31 done
33 [ -z "$pkgname" ] && show_help
35 [ -n "$c5" ] && root="$LFS"
37 install_log=$root/usr/share/checklfs/install-logs/$pkgname
38 tmpfile=$root/tmp/tmpfile
39 PRUNEPATH="$root/proc $root/usr/src $root/tmp $root/usr/tmp $root/var/tmp
40 $root/root $root/home $root/usr/share/checklfs $root/mnt $root/dev"
41 PRUNEREGEX=`echo $PRUNEPATH | \
42 sed -e 's,^,\\\(^,' -e 's, ,$\\\)\\\|\\\(^,g' -e 's,$,$\\\),'`
44 touch $tmpfile
46 sleep 1
48 echo "Start the installation of $pkgname now."
49 echo "Press Enter when the package is installed."
50 read
52 echo "Obtaining list of new and changed files..."
53 find $root/ -regex "$PRUNEREGEX" -prune -o -cnewer $tmpfile -print \
54 > $install_log
56 if [ -n "$c5" ]
57 then
58 sed s%$LFS%% $install_log > $install_log.tmp
59 mv $install_log.tmp $install_log
62 rm $tmpfile
64 [ -x /usr/bin/vim ] && vim $install_log
66 echo "Done"
67 echo