From bb5bd6ac528ea61a32592e9f449e8fecc616fd24 Mon Sep 17 00:00:00 2001 From: Dominika Hodovska Date: Apr 11 2017 11:11:04 +0000 Subject: Do not resolve with empty package requirements --- diff --git a/brt_dep_solver.sh b/brt_dep_solver.sh index b5b46f4..22c76de 100755 --- a/brt_dep_solver.sh +++ b/brt_dep_solver.sh @@ -24,6 +24,12 @@ function get-baseruntime-caps { } +function cleanup { + + cd .. + ${CLEAN} && rm ${DIR}/* && rmdir ${DIR} +} + function resolve-deps { if [[ ${1} == "runtime" ]]; then runtime=true @@ -56,6 +62,12 @@ function resolve-deps { --enablerepo=f26 \ ${pkg} > ${pkg}-caps.txt && verbose_echo "DONE" +# [ -s ${pkg}-caps.txt ] || cleanup && return + if [ ! -s ${pkg}-caps.txt ]; then + cleanup + verbose_echo "No ${1} dependencies found." + return + fi while read cap; do if [[ $cap != *" = "* ]]; then grep -wq "^${cap}*" ${provided_caps} || echo ${cap} >> ${pkg}-filtered-caps.txt @@ -64,6 +76,11 @@ function resolve-deps { fi done < ${pkg}-caps.txt + if [ ! -s ${pkg}-filtered-caps.txt ]; then + cleanup + verbose_echo "No ${1} dependencies found after diff with baseruntime." + return + fi while read cap; do dnf repoquery -q --latest-limit=1 --srpm \ --disablerepo='*' \ @@ -79,8 +96,7 @@ function resolve-deps { sed -e "s/-[^-]*-[^-]*$//" cap2rpm.txt | sort -u > ../${pkg}-build-deps.txt fi - cd .. - ${CLEAN} && rm ${DIR}/* && rmdir ${DIR} + cleanup } resolve-deps "build"