diff options
Diffstat (limited to 'perl-install/c')
-rw-r--r-- | perl-install/c/stuff.pm | 1 | ||||
-rw-r--r-- | perl-install/c/stuff.xs.pm | 32 |
2 files changed, 26 insertions, 7 deletions
diff --git a/perl-install/c/stuff.pm b/perl-install/c/stuff.pm index daf5d8ef3..2cea57d2c 100644 --- a/perl-install/c/stuff.pm +++ b/perl-install/c/stuff.pm @@ -24,6 +24,7 @@ sub headerGetEntry { $q eq 'filenames' and return headerGetEntry_string_list($h, RPMTAG_FILENAMES()); $q eq 'obsoletes' and return headerGetEntry_string_list($h, RPMTAG_OBSOLETES()); $q eq 'requires' and return headerGetEntry_string_list($h, RPMTAG_REQUIRENAME()); + $q eq 'fileflags' and return headerGetEntry_int_list($h, RPMTAG_FILEFLAGS()); } 1; diff --git a/perl-install/c/stuff.xs.pm b/perl-install/c/stuff.xs.pm index 092b136d3..6ca1e32d3 100644 --- a/perl-install/c/stuff.xs.pm +++ b/perl-install/c/stuff.xs.pm @@ -251,7 +251,7 @@ rpmdbTraverse(db, ...) } count = 0; num = rpmdbFirstRecNum(db); - while (num) { + while (num>0) { if (callback != &PL_sv_undef && SvROK(callback)) { h = rpmdbGetRecord(db, num); { @@ -623,19 +623,37 @@ headerGetEntry_int(h, query) RETVAL void +headerGetEntry_int_list(h, query) + void *h + int query + PPCODE: + int i, type, count = 0; + int_32 *intlist = (void **) NULL; + if (headerGetEntry((Header) h, query, &type, (void**) &intlist, &count)) { + if (count > 0) { + EXTEND(SP, count); + for (i = 0; i < count; i++) { + PUSHs(sv_2mortal(newSViv(intlist[i]))); + } + } + } + +void headerGetEntry_string_list(h, query) void *h int query PPCODE: int i, type, count = 0; char **strlist = (char **) NULL; - if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count) && count) { - EXTEND(SP, count); - for (i = 0; i < count; i++) { - PUSHs(sv_2mortal(newSVpv(strlist[i], 0))); + if (headerGetEntry((Header) h, query, &type, (void**) &strlist, &count)) { + if (count > 0) { + EXTEND(SP, count); + for (i = 0; i < count; i++) { + PUSHs(sv_2mortal(newSVpv(strlist[i], 0))); + } } + free(strlist); } - free(strlist); '; @macros = ( @@ -645,7 +663,7 @@ headerGetEntry_string_list(h, query) VT_ACTIVATE VT_WAITACTIVE VT_GETSTATE CDROM_LOCKDOOR CDROMEJECT ) ], ); -push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_FILENAMES RPMTAG_OBSOLETES RPMTAG_REQUIRENAME) ] +push @macros, [ qw(int RPMTAG_NAME RPMTAG_GROUP RPMTAG_SIZE RPMTAG_VERSION RPMTAG_SUMMARY RPMTAG_DESCRIPTION RPMTAG_RELEASE RPMTAG_ARCH RPMTAG_FILENAMES RPMTAG_OBSOLETES RPMTAG_REQUIRENAME RPMTAG_FILEFLAGS RPMFILE_CONFIG) ] if $ENV{C_RPM}; $\= "\n"; |