Commit b7a22e55 authored by Timo Teräs's avatar Timo Teräs

solver, test: implements more provides things, add tests

ref #574
parent 1074c4d3
......@@ -27,6 +27,7 @@ struct apk_blob {
};
typedef struct apk_blob apk_blob_t;
typedef int (*apk_blob_cb)(void *ctx, apk_blob_t blob);
extern apk_blob_t apk_null_blob;
#define BLOB_FMT "%.*s"
#define BLOB_PRINTF(b) (int)(b).len, (b).ptr
......
......@@ -609,7 +609,8 @@ static struct apk_hash_ops atom_ops = {
.compare = apk_blob_compare,
.delete_item = (apk_hash_delete_f) free,
};
static apk_blob_t null_blob = {0,0};
apk_blob_t apk_null_blob = {0,0};
void apk_atom_init(void)
{
......@@ -622,7 +623,7 @@ apk_blob_t *apk_blob_atomize(apk_blob_t blob)
unsigned long hash = apk_hash_from_key(&atom_hash, blob);
if (blob.len < 0 || blob.ptr == NULL)
return &null_blob;
return &apk_null_blob;
atom = (struct apk_blob_atom *) apk_hash_get_hashed(&atom_hash, blob, hash);
if (atom != NULL)
......@@ -642,7 +643,7 @@ apk_blob_t *apk_blob_atomize_dup(apk_blob_t blob)
char *ptr;
if (blob.len < 0 || blob.ptr == NULL)
return &null_blob;
return &apk_null_blob;
atom = (struct apk_blob_atom *) apk_hash_get_hashed(&atom_hash, blob, hash);
if (atom != NULL)
return &atom->blob;
......
This diff is collapsed.
C:Q1EyN5AdpAOBJWKMR89pp/C66o+OE=
P:libfoo
V:1
S:1
I:1
p:so:foo.so.1=1.0
C:Q1eVpkasfqZAukAXFYbgwt4xAMZWU=
P:app
V:2
S:1
I:1
D:so:foo.so.1
C:Q1EyN5AdpAOBJWKMR89pp/C66FFFF=
P:mymailreader
V:1
S:1
I:1
p:mail-reader
C:Q1eVpkasfqZAukAXFYbgwt4xAEEEe=
P:mailreadplus
V:1
S:1
I:1
p:mail-reader
C:Q1EyN5AdpAOBJWKMR89pp/C77FFFF=
P:server-a
V:1
S:1
I:1
p:theservice
D:!theservice
C:Q1eVpkasfqZAukAXFYbgwt444EEEe=
P:server-b
V:1
S:1
I:1
p:theservice
D:!theservice
@ARGS
--test-repo provides.repo
add app
@EXPECT
(1/2) Installing libfoo (1)
(2/2) Installing app (2)
OK: 0 MiB in 0 packages
@ARGS
--test-repo provides.repo
add mail-reader
@EXPECT
ERROR: 1 unsatisfiable dependencies:
world: mail-reader
mail-reader is a virtual package provided by:
mymailreader-1 mailreadplus-1
@ARGS
--test-repo provides.repo
add mail-reader mymailreader
@EXPECT
(1/1) Installing mymailreader (1)
OK: 0 MiB in 0 packages
@ARGS
--test-repo provides.repo
add mymailreader mailreadplus
@EXPECT
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment