commit:     73cfc2c64d19fe3abd9fce807df416a4128e7f5e
Author:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 23:27:26 2023 +0000
Commit:     Maciej Barć <xgqt <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 23:27:26 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=73cfc2c6

app-emacs/wgrep: remove wgrep-test.el if USE=-test

Closes: https://bugs.gentoo.org/894444
Signed-off-by: Maciej Barć <xgqt <AT> gentoo.org>

 app-emacs/wgrep/wgrep-3.0.0-r1.ebuild | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/app-emacs/wgrep/wgrep-3.0.0-r1.ebuild 
b/app-emacs/wgrep/wgrep-3.0.0-r1.ebuild
index fe274279b0a2..2ab08805b3a0 100644
--- a/app-emacs/wgrep/wgrep-3.0.0-r1.ebuild
+++ b/app-emacs/wgrep/wgrep-3.0.0-r1.ebuild
@@ -34,13 +34,23 @@ DOC_CONTENTS="See commentary in ${SITELISP}/${PN}/wgrep.el 
for documentation.
        \n\t(require 'wgrep)"
 SITEFILE="50${PN}-gentoo.el"
 
+src_prepare() {
+       if ! use test ; then
+               rm ${PN}-test.el || die
+       fi
+
+       elisp_src_prepare
+}
+
 src_test() {
        ${EMACS} ${EMACSFLAGS} -L . -l ${PN}.el -l ${PN}-test.el    \
                -f ert-run-tests-batch-and-exit || die "tests failed"
 }
 
 src_install() {
-       rm ${PN}-test.el{,c} || die
+       if use test ; then
+          rm ${PN}-test.el{,c} || die
+       fi
 
        elisp_src_install
 }

Reply via email to