We tried to store all strings directly in the pool (I think) which is
not what libsolv liked. Any SOLV files written could not be re-read
which is fixed by this change which gives libsolv the chance to store
its strings wherever it wants.
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
static void pakfire_package_set_string(struct pakfire_package* pkg, int key, const char* value) {
Solvable* s = get_solvable(pkg);
- if (!value)
- value = "";
+ // Unset on empty string
+ if (!value || !*value)
+ solvable_unset(s, key);
- solvable_set_poolstr(s, key, value);
+ // Store string
+ solvable_set_str(s, key, value);
}
static char** pakfire_package_get_string_array(struct pakfire_package* pkg, Id key) {