summaryrefslogtreecommitdiffstats
path: root/RPM4
diff options
context:
space:
mode:
Diffstat (limited to 'RPM4')
-rw-r--r--RPM4/NEWS2
-rw-r--r--RPM4/src/RPM4.xs5
2 files changed, 5 insertions, 2 deletions
diff --git a/RPM4/NEWS b/RPM4/NEWS
index 3264c54..7b4dd11 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -1,6 +1,8 @@
Version 0.29 - 12 June 2012
- functions that not are implemented since switching to rpm-4.6 now die
+- srcrpm(): fix returning "...nosrc.rpm" instead of "...src.rpm" when needed
+ (it always returned "...src.rpm" since rpm-4.9+)
- use rpm-4.6+ API, not rpm-4.4 compatibility one
(fix some memleaks btw)
diff --git a/RPM4/src/RPM4.xs b/RPM4/src/RPM4.xs
index 13bd2c9..5e20da6 100644
--- a/RPM4/src/RPM4.xs
+++ b/RPM4/src/RPM4.xs
@@ -2745,6 +2745,8 @@ Spec_srcrpm(spec)
#else
header = spec->packages->header;
#endif
+ struct rpmtd_s td;
+ int no_src = headerGet(header, RPMTAG_NOPATCH, &td, HEADERGET_MINMEM) || headerGet(header, RPMTAG_NOSOURCE, &td, HEADERGET_MINMEM);
name = get_name(header, RPMTAG_NAME);
version = get_name(header, RPMTAG_VERSION);
release = get_name(header, RPMTAG_RELEASE);
@@ -2752,8 +2754,7 @@ Spec_srcrpm(spec)
mXPUSHs(newSVpvf("%s/%s-%s-%s.%ssrc.rpm",
rpmGetPath("%{_srcrpmdir}", NULL),
name, version, release,
- // FIXME: we basically want genSourceRpmName() which is internal :-(
- "" //spec->noSource ? "no" : ""
+ no_src ? "no" : ""
));
void