index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-08-09 01:00:16 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-15 12:56:41 -0500 |
commit | a628feee46f2200db7d3303091813f050a61d0a3 (patch) | |
tree | 47e9924d205098c48a6ef3db33e4424b9845c0fc /lib/libalpm/package.c | |
parent | bd5ec9cd8e23bba4334a7b3a5a73843c3667c085 (diff) |
-rw-r--r-- | lib/libalpm/package.c | 22 |
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index a8dc1440..19d2c844 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -496,7 +496,9 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg) newpkg->reason = pkg->reason; newpkg->licenses = alpm_list_strdup(pkg->licenses); - newpkg->replaces = alpm_list_strdup(pkg->replaces); + for(i = pkg->replaces; i; i = alpm_list_next(i)) { + newpkg->replaces = alpm_list_add(newpkg->replaces, _alpm_dep_dup(i->data)); + } newpkg->groups = alpm_list_strdup(pkg->groups); if(pkg->files.count) { size_t filenum; @@ -517,8 +519,12 @@ alpm_pkg_t *_alpm_pkg_dup(alpm_pkg_t *pkg) newpkg->depends = alpm_list_add(newpkg->depends, _alpm_dep_dup(i->data)); } newpkg->optdepends = alpm_list_strdup(pkg->optdepends); - newpkg->conflicts = alpm_list_strdup(pkg->conflicts); - newpkg->provides = alpm_list_strdup(pkg->provides); + for(i = pkg->conflicts; i; i = alpm_list_next(i)) { + newpkg->conflicts = alpm_list_add(newpkg->conflicts, _alpm_dep_dup(i->data)); + } + for(i = pkg->provides; i; i = alpm_list_next(i)) { + newpkg->provides = alpm_list_add(newpkg->provides, _alpm_dep_dup(i->data)); + } for(i = pkg->deltas; i; i = alpm_list_next(i)) { newpkg->deltas = alpm_list_add(newpkg->deltas, _alpm_delta_dup(i->data)); } @@ -557,8 +563,10 @@ void _alpm_pkg_free(alpm_pkg_t *pkg) FREE(pkg->sha256sum); FREE(pkg->base64_sig); FREE(pkg->arch); + FREELIST(pkg->licenses); - FREELIST(pkg->replaces); + alpm_list_free_inner(pkg->replaces, (alpm_list_fn_free)_alpm_dep_free); + alpm_list_free(pkg->replaces); FREELIST(pkg->groups); if(pkg->files.count) { size_t i; @@ -572,8 +580,10 @@ void _alpm_pkg_free(alpm_pkg_t *pkg) alpm_list_free_inner(pkg->depends, (alpm_list_fn_free)_alpm_dep_free); alpm_list_free(pkg->depends); FREELIST(pkg->optdepends); - FREELIST(pkg->conflicts); - FREELIST(pkg->provides); + alpm_list_free_inner(pkg->conflicts, (alpm_list_fn_free)_alpm_dep_free); + alpm_list_free(pkg->conflicts); + alpm_list_free_inner(pkg->provides, (alpm_list_fn_free)_alpm_dep_free); + alpm_list_free(pkg->provides); alpm_list_free_inner(pkg->deltas, (alpm_list_fn_free)_alpm_delta_free); alpm_list_free(pkg->deltas); alpm_list_free(pkg->delta_path); |