Commit 7326f29a authored by Leo's avatar Leo

replace makedepend-in-depends with a more expensive and better version.

parent 5d858229
...@@ -82,11 +82,13 @@ Declaring duplicate dependencies is superfluous. ...@@ -82,11 +82,13 @@ Declaring duplicate dependencies is superfluous.
The pkgname variable of the APKBUILD has value *foo* but the directory in which the The pkgname variable of the APKBUILD has value *foo* but the directory in which the
APKBUILD is found is not named *foo* APKBUILD is found is not named *foo*
## makedepend-in-depends ## depends-makedepends-checkdepends-overlap
A package is present in both makedepends and depends which is superfluous since all A package is present in 2 to 3 of the 3 types of following dependencies: depends,
depends are installed alongside the makedepends, the package can be removed from makedepends and checkdepends. All of them are installed during creation of the package,
makedepends please specify only once in the lowest common denominator location.
## checkdepend-in-depends
# TAGS (apkbuild-lint) # TAGS (apkbuild-lint)
......
...@@ -136,14 +136,30 @@ pkgname_dirname_mismatch() { ...@@ -136,14 +136,30 @@ pkgname_dirname_mismatch() {
fi fi
} }
makedepend_in_depends() { depends_makedepends_checkdepends_overlap() {
[ "$SKIP_MAKEDEPEND_IN_DEPENDS" ] && return 0 [ "$SKIP_DEPENDS_MAKEDEPENDS_CHECKDEPENDS_OVERLAP" ] && return 0
local _mkdeps local _mkdeps _ckdeps d
_mkdeps="$(echo $makedepends | tr " " "\\n" | sort -u)" _mkdeps="$(echo $makedepends | tr " " "\\n" | sort -u)"
_ckdeps="$(echo $checkdepends | tr " " "\\n" | sort -u)"
[ -z "$_mkdeps" ] && [ -z "$_ckdeps" ] && return 0
for d in $depends; do for d in $depends; do
if printf "%s\\n" "$_mkdeps" | grep -q "^$d$"; then if printf "%s\\n" "$_mkdeps" | grep -q "^$d$"; then
printf "%s:: dependency '%s' is in depends and makedepends\n" "$apkbuild" "$d" printf "%s:: dependency '%s' is in depends and makedepends\n" "$apkbuild" "$d"
fi fi
# Don't check against checkdepends if it is empty
[ -z "$checkdepends" ] && continue
if printf "%s\\n" "$_ckdeps" | grep -q "^$d$"; then
printf "%s:: dependency '%s' is in depends and checkdepends\n" "$apkbuild" "$d"
fi
done
# Don't check against checkdepends if it is empty
[ -z "$checkdepends" ] && return 0
for d in $makedepends; do
if printf "%s\\n" "$_ckdeps" | grep -q "^$d$"; then
printf "%s:: dependency '%s' is in makedepends and checkdepends\n" "$apkbuild" "$d"
fi
done done
} }
...@@ -176,10 +192,7 @@ for apkbuild; do ...@@ -176,10 +192,7 @@ for apkbuild; do
if [ ! -z "$makedepends" ]; then if [ ! -z "$makedepends" ]; then
upper_repo_makedepends & upper_repo_makedepends &
duplicate_makedepends & duplicate_makedepends &
fi depends_makedepends_checkdepends_overlap &
if [ "$makedepends" ] && [ "$depends" ]; then
makedepend_in_depends &
fi fi
if [ ! -z "$checkdepends" ]; then if [ ! -z "$checkdepends" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment