aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-06-15 17:37:58 +0000
committerThierry Vignaud <tv@mageia.org>2012-06-15 17:37:58 +0000
commit1948ee3ee00b9a7343a04f06a352029b387844ca (patch)
tree6385046433465f15434abd249b5f3c44d5b675cd /URPM.xs
parent96cf1fb40cb7233a176e1dfd512ed41f2da5437f (diff)
downloadperl-URPM-1948ee3ee00b9a7343a04f06a352029b387844ca.tar
perl-URPM-1948ee3ee00b9a7343a04f06a352029b387844ca.tar.gz
perl-URPM-1948ee3ee00b9a7343a04f06a352029b387844ca.tar.bz2
perl-URPM-1948ee3ee00b9a7343a04f06a352029b387844ca.tar.xz
perl-URPM-1948ee3ee00b9a7343a04f06a352029b387844ca.zip
(return_list_tag,update_obsoletes,update_provides) use proper accessors
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs12
1 files changed, 5 insertions, 7 deletions
diff --git a/URPM.xs b/URPM.xs
index c17506e..52d3ec5 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -587,10 +587,9 @@ return_list_tag(const URPM__Package pkg, rpmTag tag_name) {
if (pkg->h != NULL) {
struct rpmtd_s td;
if (headerGet(pkg->h, tag_name, &td, HEADERGET_DEFAULT)) {
- void *list = td.data;
int32_t count = rpmtdCount(&td);
if (tag_name == RPMTAG_ARCH)
- mXPUSHs(newSVpv(headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? (char *) list : "src", 0));
+ mXPUSHs(newSVpv(headerIsEntry(pkg->h, RPMTAG_SOURCERPM) ? rpmtdGetString(&td) : "src", 0));
else
switch (rpmtdType(&td)) {
case RPM_NULL_TYPE:
@@ -915,10 +914,10 @@ update_provides(const URPM__Package pkg, HV *provides) {
/* examine requires for files which need to be marked in provides */
if (headerGet(pkg->h, RPMTAG_REQUIRENAME, &td, HEADERGET_DEFAULT)) {
- char **list = td.data;
for (i = 0; i < rpmtdCount(&td); ++i) {
- len = strlen(list[i]);
- if (list[i][0] == '/') (void)hv_fetch(provides, list[i], len, 1);
+ const char *s = rpmtdNextString(&td);
+ len = strlen(s);
+ if (s[0] == '/') (void)hv_fetch(provides, s, len, 1);
}
}
@@ -974,10 +973,9 @@ update_obsoletes(const URPM__Package pkg, HV *obsoletes) {
/* update all provides */
if (headerGet(pkg->h, RPMTAG_OBSOLETENAME, &td, HEADERGET_DEFAULT)) {
- char **list = td.data;
unsigned int i;
for (i = 0; i < rpmtdCount(&td); ++i)
- update_hash_entry(obsoletes, list[i], 0, 1, 0, pkg);
+ update_hash_entry(obsoletes, rpmtdNextString(&td), 0, 1, 0, pkg);
}
} else {
char *ps, *s;