aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-19 13:05:54 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-01-19 13:05:54 +0000
commitec9cacadc5e93e90a4c4e859a04c716edba442b3 (patch)
tree6767aedb57ffc5c77d4ef77ecc4f6820463bafae /URPM.xs
parent35a1e7817d16df95fa4a416c9a9ac2c9a059c9de (diff)
downloadperl-URPM-ec9cacadc5e93e90a4c4e859a04c716edba442b3.tar
perl-URPM-ec9cacadc5e93e90a4c4e859a04c716edba442b3.tar.gz
perl-URPM-ec9cacadc5e93e90a4c4e859a04c716edba442b3.tar.bz2
perl-URPM-ec9cacadc5e93e90a4c4e859a04c716edba442b3.tar.xz
perl-URPM-ec9cacadc5e93e90a4c4e859a04c716edba442b3.zip
Return undef on spec parsing failure
Diffstat (limited to 'URPM.xs')
-rw-r--r--URPM.xs9
1 files changed, 6 insertions, 3 deletions
diff --git a/URPM.xs b/URPM.xs
index b05d410..23a1950 100644
--- a/URPM.xs
+++ b/URPM.xs
@@ -3654,24 +3654,27 @@ Urpm_spec2srcheader(specfile)
URPM__Package pkg;
Spec spec = NULL;
PPCODE:
+/* Do not verify architecture */
#define SPEC_ANYARCH 1
+/* Do not verify whether sources exist */
#define SPEC_FORCE 1
if (!parseSpec(ts, specfile, "/", NULL, 0, NULL, NULL, SPEC_ANYARCH, SPEC_FORCE)) {
+ SV *sv_pkg;
spec = rpmtsSetSpec(ts, NULL);
- if ( ! spec->sourceHeader)
+ if (! spec->sourceHeader)
initSourceHeader(spec);
pkg = (URPM__Package)malloc(sizeof(struct s_Package));
memset(pkg, 0, sizeof(struct s_Package));
pkg->h = headerLink(spec->sourceHeader);
- SV *sv_pkg;
EXTEND(SP, 1);
sv_pkg = sv_newmortal();
sv_setref_pv(sv_pkg, "URPM::Package", (void*)pkg);
PUSHs(sv_pkg);
spec = freeSpec(spec);
+ } else {
+ PUSHs(&PL_sv_undef);
}
ts = rpmtsFree(ts);
-
void
expand(name)