summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--RPM4/NEWS2
-rw-r--r--RPM4/src/RPM4.xs20
2 files changed, 19 insertions, 3 deletions
diff --git a/RPM4/NEWS b/RPM4/NEWS
index 9482d32..123beca 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -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))