diff options
author | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2011-12-14 19:36:58 +0000 |
---|---|---|
committer | tv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c> | 2011-12-14 19:36:58 +0000 |
commit | 3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17 (patch) | |
tree | 2169079510de29f5ea0c5a8edac210c4156d0d0c | |
parent | 8bca1a8020e15ded1796f096cdab1534acc3d442 (diff) | |
download | perl-RPM4-3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17.tar perl-RPM4-3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17.tar.gz perl-RPM4-3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17.tar.bz2 perl-RPM4-3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17.tar.xz perl-RPM4-3bfba3f85785b1a4b64c02d241b01a3aa1a2ab17.zip |
(Spec_sources, Spec_sources_url) implement them for rpm-4.9
(could use a shared static helper...)
git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@156 971eb68f-4bfb-0310-8326-d2484c010a4c
-rw-r--r-- | RPM4/NEWS | 2 | ||||
-rw-r--r-- | RPM4/src/RPM4.xs | 20 |
2 files changed, 19 insertions, 3 deletions
@@ -1,3 +1,5 @@ +- implement more functions with rpm-4.9 + Version 0.24 - 09 November 2011 - add rpm-4.6 support (pixel, 2009-01-20) diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs index b543114..28275c2 100644 --- a/RPM4/src/RPM4.xs +++ b/RPM4/src/RPM4.xs @@ -2894,10 +2894,17 @@ Spec_sources(spec, is = 0) rpmSpec spec int is PREINIT: - struct Source *srcPtr; +#ifdef RPM4_9_0 + rpmSpecSrc srcPtr; +#else + struct Source * srcPtr; +#endif PPCODE: #ifdef RPM4_9_0 - croak("sources exists only in rpm < 4.9"); + rpmSpecSrcIter iter = rpmSpecSrcIterInit(spec); + while ((srcPtr = rpmSpecSrcIterNext(iter)) != NULL) { + XPUSHs(sv_2mortal(newSVpv(rpmSpecSrcFilename(srcPtr, 0), 0))); + } #else for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { if (is && !(srcPtr->flags & is)) @@ -2911,10 +2918,17 @@ Spec_sources_url(spec, is = 0) rpmSpec spec int is PREINIT: +#ifdef RPM4_9_0 + rpmSpecSrc srcPtr; +#else struct Source * srcPtr; +#endif PPCODE: #ifdef RPM4_9_0 -// XPUSHs(sv_2mortal(newSVpv(get_name(pkg->h, RPMTAG_URL), 0))); + rpmSpecSrcIter iter = rpmSpecSrcIterInit(spec); + while ((srcPtr = rpmSpecSrcIterNext(iter)) != NULL) { + XPUSHs(sv_2mortal(newSVpv(rpmSpecSrcFilename(srcPtr, 1), 0))); + } #else for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { if (is && !(srcPtr->flags & is)) |