diff options
author | Olivier Thauvin <nanardon@mandriva.org> | 2004-04-25 10:44:42 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mandriva.org> | 2004-04-25 10:44:42 +0000 |
commit | d381d7b78c47ea2cddb46b9e50782372a45a62d9 (patch) | |
tree | 9edb5c4d9d9903a715cd78856f6272df99202de7 /URPM.xs | |
parent | 40144b2ef015bbfc652d96f0d03957af7078addb (diff) | |
download | perl-URPM-d381d7b78c47ea2cddb46b9e50782372a45a62d9.tar perl-URPM-d381d7b78c47ea2cddb46b9e50782372a45a62d9.tar.gz perl-URPM-d381d7b78c47ea2cddb46b9e50782372a45a62d9.tar.bz2 perl-URPM-d381d7b78c47ea2cddb46b9e50782372a45a62d9.tar.xz perl-URPM-d381d7b78c47ea2cddb46b9e50782372a45a62d9.zip |
- add $pkg->queryformat() function
- $ûrpm->list_rpm_tag show all tag, value for unparsable tag is 'undef' in hash
Diffstat (limited to 'URPM.xs')
-rw-r--r-- | URPM.xs | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -2305,6 +2305,18 @@ Pkg_changelog_text(pkg) SPAGAIN; void +Pkg_queryformat(pkg, fmt) + URPM::Package pkg; + char *fmt + PPCODE: + char *s; + if (pkg->h) { + s = headerSprintf(pkg->h, fmt, + rpmTagTable, rpmHeaderFormats, NULL); + XPUSHs(sv_2mortal(newSVpv(s,0))); + } + +void Pkg_get_tag(pkg, tagname) URPM::Package pkg int tagname; @@ -3185,13 +3197,33 @@ Urpm_list_rpm_tag(urpm=Nullsv) SV *urpm PREINIT: int i = 0; + const struct headerSprintfExtension_s * ext = rpmHeaderFormats; PPCODE: read_config_files(0); + + + for (i = 0; i < rpmTagTableSize; i++) { - XPUSHs(sv_2mortal(newSVpv(rpmTagTable[i].name, 0))); + XPUSHs(sv_2mortal(newSVpv(rpmTagTable[i].name + 7, 0))); XPUSHs(sv_2mortal(newSViv(rpmTagTable[i].val))); } + while (ext->name != NULL) { + if (ext->type == HEADER_EXT_MORE) { + ext = ext->u.more; + continue; + } + for (i = 0; i < rpmTagTableSize; i++) { + if (!strcmp(rpmTagTable[i].name, ext->name)) + break; + } + if (i >= rpmTagTableSize && ext->type == HEADER_EXT_TAG) { + XPUSHs(sv_2mortal(newSVpv(ext->name + 7, 0))); + XPUSHs(sv_newmortal()); + } + ext++; + } + int Urpm_ranges_overlap(a, b, b_nopromote=0) char *a |