app-office/gnucash: Fix testcases that write to /tmp
authorPeter Levine <plevine457@gmail.com>
Sun, 15 Sep 2019 20:09:53 +0000 (16:09 -0400)
committerAndreas Sturmlechner <asturm@gentoo.org>
Sun, 13 Oct 2019 11:40:25 +0000 (13:40 +0200)
Have testcases write to "${T}" instead of /tmp

Closes: https://github.com/gentoo/gentoo/pull/12792
Package-Manager: Portage-2.3.75, Repoman-2.3.17
Signed-off-by: Peter Levine <plevine457@gmail.com>
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
app-office/gnucash/gnucash-3.7.ebuild

index 699125271a4b3f62ed8848068e8ef8b42221e661..824af8b7d919819f436cc191c89c5b9fc1398712 100644 (file)
@@ -97,6 +97,23 @@ src_unpack() {
                || die "Failed copying scm"
 }
 
+src_prepare() {
+       cmake-utils_src_prepare
+
+       # Fix tests writing to /tmp
+       local fixtestfiles=(
+               "${S}"/gnucash/report/report-system/test/test-commodity-utils.scm
+               "${S}"/gnucash/report/report-system/test/test-extras.scm
+               "${S}"/gnucash/report/report-system/test/test-report-html.scm
+               "${S}"/gnucash/report/report-system/test/test-report-system.scm
+               "${S}"/libgnucash/backend/xml/test/test-xml-pricedb.cpp
+               "${S}"/libgnucash/backend/dbi/test/test-backend-dbi-basic.cpp
+       )
+       for x in "${fixtestfiles[@]}"; do
+               sed -i -e "s|\"/tmp/|\"${T}/|g" "${x}" || die "sed of "${x}" failed"
+       done
+}
+
 src_configure() {
        export GUILE_AUTO_COMPILE=0