summaryrefslogtreecommitdiffstats
path: root/perl-install/c
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-12-08 18:58:45 +0000
committerFrancois Pons <fpons@mandriva.com>1999-12-08 18:58:45 +0000
commit1934b3123c81c2ccb425626aa61ed29e38780ddf (patch)
treec66e075fb0a7ffa7f7cd6f53a65e015ec864b855 /perl-install/c
parent1cf2e9bf3d2dd8e82380afdcf3cb8f68c6285dcc (diff)
downloaddrakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar
drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.gz
drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.bz2
drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.tar.xz
drakx-backup-do-not-use-1934b3123c81c2ccb425626aa61ed29e38780ddf.zip
*** empty log message ***
Diffstat (limited to 'perl-install/c')
-rw-r--r--perl-install/c/stuff.pm1
-rw-r--r--perl-install/c/stuff.xs.pm32
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";