summaryrefslogtreecommitdiff
path: root/src/add.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-22 14:24:19 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-22 14:24:19 +0300
commit0a7991f70dcfe9f8e05f6a4a4a59af21be878915 (patch)
tree9c6ef07e6f594b524bd1fc4746a103ab3d93d926 /src/add.c
parent0dadc27ce1cfe84585a747d57e7d3bcafc1069eb (diff)
downloadapk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.gz
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.bz2
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.tar.xz
apk-tools-0a7991f70dcfe9f8e05f6a4a4a59af21be878915.zip
various: misc fixes
- error codes for verification failure types - fix some fdb corruption on file migration - combine some dependency parsing code - fix versioned dependencies
Diffstat (limited to 'src/add.c')
-rw-r--r--src/add.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/add.c b/src/add.c
index fac1edc..f78b4e0 100644
--- a/src/add.c
+++ b/src/add.c
@@ -107,7 +107,7 @@ static int add_main(void *ctx, int argc, char **argv)
apk_default_checksum(), &virtpkg->csum);
virtpkg->version = strdup("0");
virtpkg->description = strdup("virtual meta package");
- virtdep = apk_dep_from_pkg(&db, virtpkg);
+ apk_dep_from_pkg(&virtdep, &db, virtpkg);
virtdep.name->flags |= APK_NAME_TOPLEVEL | APK_NAME_VIRTUAL;
virtpkg = apk_db_pkg_add(&db, virtpkg);
}
@@ -127,9 +127,12 @@ static int add_main(void *ctx, int argc, char **argv)
goto err;
}
- dep = apk_dep_from_pkg(&db, pkg);
- } else
- dep = apk_dep_from_str(&db, argv[i]);
+ apk_dep_from_pkg(&dep, &db, pkg);
+ } else {
+ r = apk_dep_from_blob(&dep, &db, APK_BLOB_STR(argv[i]));
+ if (r != 0)
+ goto err;
+ }
if (virtpkg) {
apk_deps_add(&virtpkg->depends, &dep);