From 2c249e7946fb4c3f4013aabe36ec1097abc02d8a Mon Sep 17 00:00:00 2001 From: Francois Pons Date: Wed, 5 Dec 2001 16:42:28 +0000 Subject: 4.0 release (changes of provides internally). --- rpmtools.xs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'rpmtools.xs') diff --git a/rpmtools.xs b/rpmtools.xs index 89237b2..fc528e7 100644 --- a/rpmtools.xs +++ b/rpmtools.xs @@ -118,12 +118,17 @@ void update_provides(int force, HV* provides, char *name, STRLEN len, Header hea if (!len) len = strlen(name); if (force && (isv = hv_fetch(provides, name, len, 1)) || provides && (isv = hv_fetch(provides, name, len, 0)) != 0) { - if (!SvROK(*isv) || SvTYPE(SvRV(*isv)) != SVt_PVAV) { - SV* choice_table = (SV*)newAV(); + if (!SvROK(*isv) || SvTYPE(SvRV(*isv)) != SVt_PVHV) { + SV* choice_set = (SV*)newHV(); SvREFCNT_dec(*isv); /* drop the old as we are changing it */ - *isv = choice_table ? newRV_noinc(choice_table) : &PL_sv_undef; + *isv = choice_set ? newRV_noinc(choice_set) : &PL_sv_undef; + } + if (*isv != &PL_sv_undef) { + STRLEN key_len; + char *key; + key = SvPV(get_fullname_sv(header), key_len); + hv_fetch((HV*)SvRV(*isv), key, key_len, 1); } - if (*isv != &PL_sv_undef) av_push((AV*)SvRV(*isv), get_fullname_sv(header)); } } -- cgit v1.2.1