summaryrefslogtreecommitdiff
path: root/src/add.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2011-10-18 18:11:26 -0400
committerTimo Teräs <timo.teras@iki.fi>2011-10-18 18:11:26 -0400
commita787038dbe643a7169a4b3610e104ac94b175ed0 (patch)
tree93e0e6629d805cdef6fa5833100ed0366225b019 /src/add.c
parentafd854a3e2cf20b3f35c5503c9df9589f482dc74 (diff)
downloadapk-tools-a787038dbe643a7169a4b3610e104ac94b175ed0.tar.gz
apk-tools-a787038dbe643a7169a4b3610e104ac94b175ed0.tar.bz2
apk-tools-a787038dbe643a7169a4b3610e104ac94b175ed0.tar.xz
apk-tools-a787038dbe643a7169a4b3610e104ac94b175ed0.zip
pkg, info: remember installed packages "replaces"
"replaces" is now turned to a full dependency type list, so you can make package overwrite files only certain versions of the package (though, we should probably take this into account already at solution calculation phase). Also make 'info --replaces' print the "replaces" of the package. This is in preparation for the policy package support, which still requires "replacement priority" field to decide which packages' files get the preference.
Diffstat (limited to 'src/add.c')
-rw-r--r--src/add.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/add.c b/src/add.c
index 5e1b2bb..a31c9e2 100644
--- a/src/add.c
+++ b/src/add.c
@@ -107,8 +107,9 @@ static int add_main(void *ctx, struct apk_database *db, int argc, char **argv)
}
apk_dep_from_pkg(&dep, db, pkg);
} else {
- r = apk_dep_from_blob(&dep, db, APK_BLOB_STR(argv[i]));
- if (r != 0)
+ apk_blob_t b = APK_BLOB_STR(argv[i]);
+ apk_blob_pull_dep(&b, db, &dep);
+ if (APK_BLOB_IS_NULL(b))
return -1;
}