diff options
author | Bertrand Jacquin <bertrand@jacquin.bzh> | 2019-09-24 22:42:00 +0100 |
---|---|---|
committer | Mike Pagano <mpagano@gentoo.org> | 2021-06-07 07:58:43 -0400 |
commit | aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d (patch) | |
tree | 0279f91a1ee721f8eb329557c798c5271dc1df89 /eclass/kernel-2.eclass | |
parent | www-client/surf: add myself as maintainer (diff) | |
download | gentoo-aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d.tar.gz gentoo-aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d.tar.bz2 gentoo-aa4f1706fe35d8e49c69f3cd1c1caf66f3a0714d.zip |
eclass/kernel-2: respect USE=symlink
kernel-2 eclass postinst_sources() creates /usr/usr/linux symlink
regardless of USE=symlink. MAKELINK variable controls the creation
of /usr/src/linux, however MAKELINK is always set to 1 only if
/usr/src/linux does not currently exist with no consideration for
USE=symlink.
This change simplify the whole /usr/usr/linux symlink creation to
instead depend on K_SYMLINK which is set if USE=symlink.
This change also refuse to remove existing /usr/usr/linux if it
currently exist while not being a symlink
Note that this is broken since 906501be57c0 ("adding symlink use flag
support")
Bug: https://bugs.gentoo.org/695592
Signed-off-by: Bertrand Jacquin <bertrand@jacquin.bzh>
Closes: https://bugs.gentoo.org/695592
Closes: https://github.com/gentoo/gentoo/pull/13031
Signed-off-by: Mike Pagano <mpagano@gentoo.org>
Diffstat (limited to 'eclass/kernel-2.eclass')
-rw-r--r-- | eclass/kernel-2.eclass | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 2d721ffca878..4c25ff3aef88 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -945,8 +945,6 @@ preinst_headers() { # see inline comments postinst_sources() { - local MAKELINK=0 - # if we have USE=symlink, then force K_SYMLINK=1 use symlink && K_SYMLINK=1 @@ -960,14 +958,10 @@ postinst_sources() { # if we are to forcably symlink, delete it if it already exists first. if [[ ${K_SYMLINK} -gt 0 ]]; then - [[ -h ${EROOT%/}/usr/src/linux ]] && { rm "${EROOT%/}"/usr/src/linux || die; } - MAKELINK=1 - fi - - # if the link doesnt exist, lets create it - [[ ! -h ${EROOT%/}/usr/src/linux ]] && MAKELINK=1 + if [[ -e ${EROOT%/}/usr/src/linux && ! -L ${EROOT%/}/usr/src/linux ]] ; then + die "${EROOT%/}/usr/src/linux exist and is not a symlink" + fi - if [[ ${MAKELINK} == 1 ]]; then ln -sf linux-${KV_FULL} "${EROOT%/}"/usr/src/linux || die fi |