build-package.sh: break possible circular dependencies

This commit is contained in:
Leonid Pliushch 2019-05-09 22:38:42 +03:00
parent d9274b596d
commit c2b843a72d
1 changed files with 6 additions and 4 deletions

View File

@ -69,10 +69,12 @@ termux_create_subpackages() {
Homepage: $TERMUX_PKG_HOMEPAGE
HERE
if [ -n "$TERMUX_SUBPKG_DEPENDS" ]; then
echo "Depends: $TERMUX_PKG_NAME (= $TERMUX_PKG_FULLVERSION), $TERMUX_SUBPKG_DEPENDS" >> control
else
echo "Depends: $TERMUX_PKG_NAME (= $TERMUX_PKG_FULLVERSION)" >> control
if ! grep -qwP "[^\w]*${SUB_PKG_NAME}[^\w]*" <(echo "${TERMUX_PKG_DEPENDS}"); then
if [ -n "$TERMUX_SUBPKG_DEPENDS" ]; then
echo "Depends: $TERMUX_PKG_NAME (= $TERMUX_PKG_FULLVERSION), $TERMUX_SUBPKG_DEPENDS" >> control
else
echo "Depends: $TERMUX_PKG_NAME (= $TERMUX_PKG_FULLVERSION)" >> control
fi
fi
test ! -z "$TERMUX_SUBPKG_BREAKS" && echo "Breaks: $TERMUX_SUBPKG_BREAKS" >> control