summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-15 16:38:28 +0000
committertv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-15 16:38:28 +0000
commitf83fba3cf29f5da35d8638f837fc49094bf9f160 (patch)
tree368cc6202578422bc3a52c56ef009cc3bd5fab93
parent73939afc756b5f8a718d9c82532bc3db1c66048d (diff)
downloadperl-RPM4-f83fba3cf29f5da35d8638f837fc49094bf9f160.tar
perl-RPM4-f83fba3cf29f5da35d8638f837fc49094bf9f160.tar.gz
perl-RPM4-f83fba3cf29f5da35d8638f837fc49094bf9f160.tar.bz2
perl-RPM4-f83fba3cf29f5da35d8638f837fc49094bf9f160.tar.xz
perl-RPM4-f83fba3cf29f5da35d8638f837fc49094bf9f160.zip
(srcrpm) fix a FIXME: s/src/no/ again accordingly
see genSourceRpmName() in rpmlib git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@207 971eb68f-4bfb-0310-8326-d2484c010a4c
-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