commit:     280c4f83d84818e3ba4391b1c7f69f8711870e39
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Jan  7 15:31:23 2021 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Jan  7 15:31:28 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=280c4f83

www-apps/baikal: use relative symlink to config

Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 www-apps/baikal/baikal-0.7.2.ebuild | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/www-apps/baikal/baikal-0.7.2.ebuild 
b/www-apps/baikal/baikal-0.7.2.ebuild
index 39d0aca079d..373282d259b 100644
--- a/www-apps/baikal/baikal-0.7.2.ebuild
+++ b/www-apps/baikal/baikal-0.7.2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI="7"
@@ -34,15 +34,19 @@ src_install() {
        einfo "Setting up container for configuration"
        dodir /etc/${PN}
 
-       einfo "Fixing symlinks"
-       local link target
-       find "${D}${MY_HTDOCSDIR}" -type l | while read link ; do
-               target=$(readlink "${link}")
-               target=${target/..\/Core/Core}
-               rm "${link}" && ln -s "${target}" "${link}"
+       # setup config in /etc
+       # we are not allowed to use straight-forward absolute symlink :(
+       local root path htdocsdir=${MY_HTDOCSDIR%/}
+       while [[ -n ${htdocsdir} ]] ; do
+               root+="../"
+               htdocsdir=${htdocsdir%/*}
+               # trim duplicate slashes
+               while [[ ${htdocsdir} == */ ]] ; do
+                       htdocsdir=${htdocsdir%/}
+               done
        done
-       dosym /etc/${PN} "${MY_HTDOCSDIR}"/Specific
-       dosym /etc/${PN} "${MY_HTDOCSDIR}"/config
+       dosym ${root%/}/etc/${PN} "${MY_HTDOCSDIR}"/Specific
+       dosym ${root%/}/etc/${PN} "${MY_HTDOCSDIR}"/config
        dosym . "${MY_HTDOCSDIR}"/html
 
        webapp_postinst_txt en "${FILESDIR}/postinstall-v0.7-en.txt"

Reply via email to