commit:     99f0958906ebc4b1eeb2a3286eba9eae7ef0f677
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Thu Apr 10 15:03:43 2025 +0000
Commit:     Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Wed Apr 16 07:56:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=99f09589

app-misc/elasticsearch: mkdir /usr/share/${PN}/plugins in pkg_postinst

instead of keepdir in src_install then remove the .keep file in pkg_postinst,
which cause 'equery check' complains:

> !!! /usr/share/elasticsearch/plugins/.keep_app-misc_elasticsearch-0 does not 
> exist

Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/41533
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>

 app-misc/elasticsearch/elasticsearch-8.15.1.ebuild | 10 +++++-----
 app-misc/elasticsearch/elasticsearch-8.17.3.ebuild | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/app-misc/elasticsearch/elasticsearch-8.15.1.ebuild 
b/app-misc/elasticsearch/elasticsearch-8.15.1.ebuild
index f024f4b1ce68..50805435d3c5 100644
--- a/app-misc/elasticsearch/elasticsearch-8.15.1.ebuild
+++ b/app-misc/elasticsearch/elasticsearch-8.15.1.ebuild
@@ -62,8 +62,6 @@ src_install() {
        insinto /usr/share/${PN}
        doins -r .
 
-       keepdir /usr/share/${PN}/plugins
-
        exeinto /usr/share/${PN}/bin
        doexe "${FILESDIR}"/elasticsearch-systemd-pre-exec
 
@@ -88,9 +86,11 @@ src_install() {
 
 pkg_postinst() {
        # Elasticsearch will choke on our keep file and dodir will not preserve 
the empty dir
-       local KEEPFILE
-       KEEPFILE=$(find "${EROOT}/usr/share/${PN}/plugins/" -type f -name 
'.keep*')
-       rm "${KEEPFILE}" || die
+       # equery check complain .keep* file not exist after rm .keep*
+       if [[ ! -d ${EROOT}/usr/share/${PN}/plugins ]] ; then
+               mkdir ${EROOT}/usr/share/${PN}/plugins || die
+       fi
+
        tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
        if ! systemd_is_booted ; then
                elog "You may create multiple instances of ${PN} by"

diff --git a/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild 
b/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild
index cc04359b9e63..6e35793edaf7 100644
--- a/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild
+++ b/app-misc/elasticsearch/elasticsearch-8.17.3.ebuild
@@ -62,8 +62,6 @@ src_install() {
        insinto /usr/share/${PN}
        doins -r .
 
-       keepdir /usr/share/${PN}/plugins
-
        exeinto /usr/share/${PN}/bin
        doexe "${FILESDIR}"/elasticsearch-systemd-pre-exec
 
@@ -88,9 +86,11 @@ src_install() {
 
 pkg_postinst() {
        # Elasticsearch will choke on our keep file and dodir will not preserve 
the empty dir
-       local KEEPFILE
-       KEEPFILE=$(find "${EROOT}/usr/share/${PN}/plugins/" -type f -name 
'.keep*')
-       rm "${KEEPFILE}" || die
+       # equery check complain .keep* file not exist after rm .keep*
+       if [[ ! -d ${EROOT}/usr/share/${PN}/plugins ]] ; then
+               mkdir ${EROOT}/usr/share/${PN}/plugins || die
+       fi
+
        tmpfiles_process /usr/lib/tmpfiles.d/${PN}.conf
        if ! systemd_is_booted ; then
                elog "You may create multiple instances of ${PN} by"

Reply via email to