diff options
author | Xavier Chantry <shiningxc@gmail.com> | 2008-07-25 02:02:17 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2008-07-24 22:16:28 -0500 |
commit | 310b13a4b7da1a35e035ce39f47091c0d3877cd5 (patch) | |
tree | 87693fcc6e33cbab78ed44722f1d523558ea7f79 | |
parent | c317222d710e4d6b98f9387fedac2057cfa42c73 (diff) | |
download | pacman-310b13a4b7da1a35e035ce39f47091c0d3877cd5.tar.xz |
libalpm/package.c : fix infolevel bug in pkg_dup
The pkg_dup function shouldn't call any alpm_pkg_get_ accessors because
this can fill the old package with all INFRQ_DESC fields for example, and
this won't necessarily be reproduced in the new package (for all the fields
that were copied before).
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r-- | lib/libalpm/package.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 13d0ae3f..49238ea8 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -766,19 +766,18 @@ pmpkg_t *_alpm_pkg_dup(pmpkg_t *pkg) newpkg->force = pkg->force; newpkg->reason = pkg->reason; - newpkg->licenses = alpm_list_strdup(alpm_pkg_get_licenses(pkg)); - newpkg->replaces = alpm_list_strdup(alpm_pkg_get_replaces(pkg)); - newpkg->groups = alpm_list_strdup(alpm_pkg_get_groups(pkg)); - newpkg->files = alpm_list_strdup(alpm_pkg_get_files(pkg)); - newpkg->backup = alpm_list_strdup(alpm_pkg_get_backup(pkg)); - for(i = alpm_pkg_get_depends(pkg); i; i = alpm_list_next(i)) { + newpkg->licenses = alpm_list_strdup(pkg->licenses); + newpkg->replaces = alpm_list_strdup(pkg->replaces); + newpkg->groups = alpm_list_strdup(pkg->groups); + newpkg->files = alpm_list_strdup(pkg->files); + newpkg->backup = alpm_list_strdup(pkg->backup); + for(i = pkg->depends; i; i = alpm_list_next(i)) { newpkg->depends = alpm_list_add(newpkg->depends, _alpm_dep_dup(i->data)); } - newpkg->optdepends = alpm_list_strdup(alpm_pkg_get_optdepends(pkg)); - newpkg->conflicts = alpm_list_strdup(alpm_pkg_get_conflicts(pkg)); - newpkg->provides = alpm_list_strdup(alpm_pkg_get_provides(pkg)); - newpkg->deltas = alpm_list_copy_data(alpm_pkg_get_deltas(pkg), - sizeof(pmdelta_t)); + newpkg->optdepends = alpm_list_strdup(pkg->optdepends); + newpkg->conflicts = alpm_list_strdup(pkg->conflicts); + newpkg->provides = alpm_list_strdup(pkg->provides); + newpkg->deltas = alpm_list_copy_data(pkg->deltas, sizeof(pmdelta_t)); /* internal */ newpkg->origin = pkg->origin; |