summaryrefslogtreecommitdiffstats
path: root/src/add.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-01-16 12:56:20 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-01-16 12:56:20 +0000
commit500778f45e72ab66d9a8a5428ef06544303e3d17 (patch)
treed1a29e7663a4ad4da48523952b6ed210b7ad8588 /src/add.c
parente97521470445bfd076573623379366d40f228ed3 (diff)
parent6b6c10cdf244d3a307df4c339cde774600d49f49 (diff)
downloadapk-tools-500778f45e72ab66d9a8a5428ef06544303e3d17.tar.bz2
apk-tools-500778f45e72ab66d9a8a5428ef06544303e3d17.tar.xz
Merge branch 'master' of ssh://dev.alpinelinux.org/gitroot/apk-tools
Diffstat (limited to 'src/add.c')
-rw-r--r--src/add.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/add.c b/src/add.c
index d8cb62a..9101db2 100644
--- a/src/add.c
+++ b/src/add.c
@@ -14,7 +14,7 @@
#include "apk_applet.h"
#include "apk_database.h"
-#define FLAG_INITDB 0x001
+#define FLAG_INITDB 0x0001
struct add_ctx {
unsigned int flags;
@@ -28,6 +28,9 @@ static int add_parse(void *ctx, int optch, int optindex, const char *optarg)
case 0x10000:
actx->flags |= FLAG_INITDB;
break;
+ case 'u':
+ apk_upgrade = 1;
+ break;
default:
return -1;
}
@@ -73,8 +76,8 @@ static int add_main(void *ctx, int argc, char **argv)
dep = (struct apk_dependency) {
.name = pkg->name,
- .version_mask = APK_VERSION_RESULT_MASK(APK_VERSION_EQUAL),
- .version = pkg->version,
+ .min_version = pkg->version,
+ .max_version = pkg->version,
};
} else {
dep = (struct apk_dependency) {
@@ -91,11 +94,12 @@ err:
static struct option add_options[] = {
{ "initdb", no_argument, NULL, 0x10000 },
+ { "upgrade", no_argument, NULL, 'u' },
};
static struct apk_applet apk_add = {
.name = "add",
- .usage = "[--initdb] apkname...",
+ .usage = "[--initdb] [--upgrade|-u] apkname...",
.context_size = sizeof(struct add_ctx),
.num_options = ARRAY_SIZE(add_options),
.options = add_options,