librazor/merger.c
changeset 389 4aac72ec4537
parent 369 f8c27fe9fe63
child 394 afe520f454bd
     1.1 --- a/librazor/merger.c	Fri Jun 12 16:59:11 2009 +0100
     1.2 +++ b/librazor/merger.c	Thu Oct 01 20:02:23 2009 +0100
     1.3 @@ -75,12 +75,13 @@
     1.4  razor_merger_add_package(struct razor_merger *merger,
     1.5  			 struct razor_package *package)
     1.6  {
     1.7 -	char *pool;
     1.8 +	char *pool, *s;
     1.9  	struct list *r;
    1.10  	struct razor_package *p;
    1.11  	struct razor_set *set1;
    1.12  	struct source *source;
    1.13 -	uint32_t flags;
    1.14 +	uint32_t flags, *prefix;
    1.15 +	struct array install_prefixes;
    1.16  
    1.17  	assert(merger->committed == 0);
    1.18  
    1.19 @@ -117,6 +118,18 @@
    1.20  		r = list_next(r);
    1.21  	}
    1.22  
    1.23 +	array_init(&install_prefixes);
    1.24 +	r = list_first(&package->install_prefixes, &source->set->prefix_pool);
    1.25 +	while (r) {
    1.26 +		s = (char *)source->set->string_pool.data + r->data;
    1.27 +		prefix = array_add(&install_prefixes, sizeof *prefix);
    1.28 +		*prefix = hashtable_tokenize(&merger->table, s);
    1.29 +		r = list_next(r);
    1.30 +	}
    1.31 +	list_set_array(&p->install_prefixes, &merger->set->prefix_pool,
    1.32 +                       &install_prefixes, 0);
    1.33 +	array_release(&install_prefixes);
    1.34 +
    1.35  	p->preun.program = hashtable_tokenize(&merger->table,
    1.36  					      &pool[package->preun.program]);
    1.37  	p->preun.body = hashtable_tokenize(&merger->table,