aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2012-08-23 19:42:57 +0000
committerPascal Terjan <pterjan@mageia.org>2012-08-23 19:42:57 +0000
commitbcd31ddf23f4c33d4b34a48a6026c1a77a317d3b (patch)
treefc9a2f9919c1a0d528deb15f60713e73b5ba58b0 /URPM.xs
parent5245deff212a9cb431285a13d1555d6eeb29cac2 (diff)
downloadperl-URPM-bcd31ddf23f4c33d4b34a48a6026c1a77a317d3b.tar
perl-URPM-bcd31ddf23f4c33d4b34a48a6026c1a77a317d3b.tar.gz
perl-URPM-bcd31ddf23f4c33d4b34a48a6026c1a77a317d3b.tar.bz2
perl-URPM-bcd31ddf23f4c33d4b34a48a6026c1a77a317d3b.tar.xz
perl-URPM-bcd31ddf23f4c33d4b34a48a6026c1a77a317d3b.zip
Add an alias to Pkg_files to only list doc files.
This avoids pushing more than 50k strings on the stack to check if texmf has a README.urpmi
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs7
1 files changed, 5 insertions, 2 deletions
diff --git a/URPM.xs b/URPM.xs
index b7a6462..fccb009 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -97,6 +97,7 @@ typedef struct s_Package* URPM__Package;
#define FILTER_MODE_ALL_FILES 0
+#define FILTER_MODE_DOC_FILES 1
#define FILTER_MODE_CONF_FILES 2
static ssize_t write_nocheck(int fd, const void *buf, size_t count) {
@@ -643,6 +644,7 @@ return_files(const Header header, int filter_mode) {
if (filter_mode) {
if ((filter_mode & FILTER_MODE_CONF_FILES) && flags && (flags[i] & RPMFILE_CONFIG) == 0) continue;
+ if ((filter_mode & FILTER_MODE_DOC_FILES) && flags && (flags[i] & RPMFILE_DOC) == 0) continue;
}
mXPUSHs(newSVpv(s, len));
@@ -1972,10 +1974,11 @@ void
Pkg_files(pkg)
URPM::Package pkg
ALIAS:
- conf_files = 1
+ conf_files = FILTER_MODE_CONF_FILES
+ doc_files = FILTER_MODE_DOC_FILES
PPCODE:
PUTBACK;
- return_files(pkg->h, ix == 0 ? 0 : FILTER_MODE_CONF_FILES);
+ return_files(pkg->h, ix);
SPAGAIN;
void