3 # Check prerequisite packages before compile time :-)
6 PREREQ
=${PREREQ:-${CWD}/prereq}
7 PKGS
="/var/log/packages"
8 RESULT
="test_prereq.log"
11 if [ ! -f $PREREQ ];then
12 echo -e "NO LIST OF PREREQUISITE PACKAGES FOUND! EXITING"
13 echo "NO PREREQ LIST FOUND!" > $RESULT
16 # let's source the prereq list
20 if [ ! -f $RESULT ];then
25 for KEY
in ${!deps[@]}; do
26 # echo "KEY is $KEY and VALUE is ${deps[${KEY}]}"
27 findings
=$
(ls $PKGS |
egrep -i "^$KEY")
28 echo -e "$KEY:" >> $RESULT
29 if [[ $findings != "" ]]; then
30 for l
in $findings; do
31 echo -e "Installed\t$l" >> $RESULT
36 echo -e "Missing\t'$KEY'" >> $RESULT
37 echo -e "Expected\t'${deps[${KEY}]}'." >> $RESULT
42 if [[ $MISSING -gt 1 ]]; then
43 # We have missing packages, issue a warning!!
44 echo -e "looks like $MISSING packages are missing. Go check the log."
45 echo -e "grep \"Missing\" $RESULT"
48 # No missing packages. We can procede!!
49 echo -e "GREAT!! All dependancies are satisfied."
50 echo -e "Let's start building."