aboutsummaryrefslogtreecommitdiffstats
path: root/src/add.c
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2018-02-20 22:22:02 +0000
committerWilliam Pitcock <nenolod@dereferenced.org>2018-02-20 22:22:02 +0000
commita5d9e2eb0acadf6a04670f226a4246934b9997c6 (patch)
tree02bce3a71454da415f852f20bfc330b57946b573 /src/add.c
parentdc7298122ed4320b838ccab39e07f4b211705e6f (diff)
downloadaports-a5d9e2eb0acadf6a04670f226a4246934b9997c6.tar.bz2
aports-a5d9e2eb0acadf6a04670f226a4246934b9997c6.tar.xz
add: child dependencies can never take a pinning, give a useful error
Diffstat (limited to 'src/add.c')
-rw-r--r--src/add.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/add.c b/src/add.c
index 0f12132c77..a28425ecd1 100644
--- a/src/add.c
+++ b/src/add.c
@@ -136,9 +136,10 @@ static int add_main(void *ctx, struct apk_database *db, struct apk_string_array
apk_blob_t b = APK_BLOB_STR(*parg);
apk_blob_pull_dep(&b, db, &dep);
- if (APK_BLOB_IS_NULL(b) || b.len > 0) {
- apk_error("'%s' is not a valid dependency, format is name(@tag)([<>~=]version)",
- *parg);
+ if (APK_BLOB_IS_NULL(b) || b.len > 0 || (virtpkg != NULL && dep.repository_tag)) {
+ apk_error("'%s' is not a valid %s dependency, format is %s",
+ *parg, virtpkg == NULL ? "world" : "child",
+ virtpkg == NULL ? "name(@tag)([<>~=]version)" : "name([<>~=]version)");
return -1;
}
}