summaryrefslogtreecommitdiff
path: root/scripts/deplist
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/deplist')
-rwxr-xr-xscripts/deplist23
1 files changed, 17 insertions, 6 deletions
diff --git a/scripts/deplist b/scripts/deplist
index 54e5b3275..f960044c1 100755
--- a/scripts/deplist
+++ b/scripts/deplist
@@ -37,16 +37,29 @@ done
parent ()
{
a=$("${HERE}"/sgrep " ${1} " "${HERE}"/.index | cut -d' ' -f2 | xargs);
- if test -n "${a}"; then
+ if ! test -z "${a}"; then
r=${a};
else
b=$(grep " ${1} " "${HERE}"/.index | cut -d' ' -f2 | xargs);
- r=${b};
+ if ! test -z "${b}"; then
+ r=${b};
+ else
+ r=${1};
+ fi
fi
printf "%s" "${r}";
}
##
+# Prints a fatal error and exits.
+#
+nxdepf ()
+{
+ printf "E: dependency '%s' not found or excepted (needed by '%s')\n" "${1}" "${2}" 1>&2;
+ exit 1;
+}
+
+##
# Do everything at once.
#
for repo in ${@}; do
@@ -152,8 +165,7 @@ EOF
case "${repo}" in
system) # nothing in system may depend on anything outside of system
if ! test -f "${BASE}/${repo}/${_d}/APKBUILD"; then
- printf "E: dependency '%s' not found or excepted\n" "${_d}" 1>&2;
- exit 1;
+ nxdepf "${_d}" "${p}";
fi
path="${repo}/${_d}";
;;
@@ -162,8 +174,7 @@ EOF
if test -f "${BASE}/system/${_d}/APKBUILD"; then
path="system/${_d}";
else
- printf "E: dependency '%s' not found or excepted\n" "${_d}" 1>&2;
- exit 1;
+ nxdepf "${_d}" "${p}";
fi
else
path="${repo}/${_d}";