diff --git a/BLFS/gen_pkg_book.sh b/BLFS/gen_pkg_book.sh index dd8f633..e953013 100755 --- a/BLFS/gen_pkg_book.sh +++ b/BLFS/gen_pkg_book.sh @@ -297,4 +297,50 @@ xsltproc --xinclude --nonet \ chmod -R +x scripts echo -e "done\n" +if [ -n "$DEP_CHECK" ]; then + if (( ${#TARGET[*]} != 1 )); then + printf "\nWARNING: If dependencies are checked, only one package\n" + printf " shoud be selected. Not generating check code.\n" + exit + fi + + LIST_LFS="$(xsltproc $ListLFS $LFS_FULL)" + LIST_NEEDED="$(echo $FULL_LIST)" + LIST_INSTALLED="$(porg -a | sed 's/-[[:digit:]].*//')" + LIST_UNNEEDED= + for p in $LIST_INSTALLED; do + case " $LIST_LFS " in *" $p "*) continue ;; esac + case " $LIST_NEEDED " in *" $p "*) continue ;; esac + LIST_UNNEEDED="$LIST_UNNEEDED $p" + done + cat >head.tmp <tail.tmp <script.tmp + cat head.tmp script.tmp tail.tmp >scripts/*${TARGET} + rm *.tmp +fi #clean_configuration