summaryrefslogtreecommitdiff
path: root/autodeps.sh
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2019-05-17 17:16:09 -1000
committerSam Bingner <sam@bingner.com>2019-05-17 17:16:09 -1000
commitb3d0160fb6bcf2b9429907cd6273578f624182ea (patch)
tree8b3a015912b9f819a56ea04cbdf2538b49e87fb4 /autodeps.sh
parentee89492de4409b2244c9d13dc317dd7f757a4501 (diff)
Build system updates
Diffstat (limited to 'autodeps.sh')
-rw-r--r--autodeps.sh25
1 files changed, 17 insertions, 8 deletions
diff --git a/autodeps.sh b/autodeps.sh
index 6347d4bf1..d9c8a913e 100644
--- a/autodeps.sh
+++ b/autodeps.sh
@@ -2,21 +2,30 @@
export PATH=${PKG_BASE}/util:$PATH
declare -a PKG_DPKG_DEPS
declare -a PKG_MISSING_DEPS
+
+function PKG_PARSE_DEPS() {
+ if [[ " ${PKG_DPKG_DEPS[@]} " =~ " ${1} " ]]; then return; fi
+ PKG_DPKG_DEPS[${#PKG_DPKG_DEPS[@]}]="${1}"
+
+ depfile="$(PKG_DATA_ ${1})"/_metadata/depends
+ if [[ -e "${depfile}" ]]; then
+ IFS=, read -a DEPENDS < "${depfile}"
+ for dep in "${DEPENDS[@]}"; do
+ dep="${dep#[[:space:]]}"
+ PKG_PARSE_DEPS "${dep%%[[:space:]]*}"
+ done
+ fi
+}
+
for dep in "${PKG_DEPS[@]}"; do
# XXX: bother dealing with weird arguments?
#DEPNAME=$(basename "${dep}" .dep)
if [ ! -z "${dep##_*}" ]; then
- PKG_DPKG_DEPS[${#PKG_DPKG_DEPS[@]}]="${dep}"
+ PKG_PARSE_DEPS ${dep}
fi
done
-if [[ -e ${PKG_DATA}/_metadata/depends ]]; then
- IFS=, read -a DEPENDS < "${PKG_DATA}/_metadata/depends"
- for dep in "${DEPENDS[@]}"; do
- dep="${dep#[[:space:]]}"
- PKG_DPKG_DEPS[${#PKG_DPKG_DEPS[@]}]="${dep%%[[:space:]]*}"
- done
-fi
+PKG_PARSE_DEPS ${PKG_NAME}
declare -a deps
deps=($(find -L "${PKG_DATA}"/_metadata -name '*.dep' | sed -e 's/^.*\///' -e 's/\.dep$//' | sort -u))