commit:     2b63b5e7f84303ff9268b1ecce31d9b8a56c5fc3
Author:     Ben Kohler <bkohler <AT> gmail <DOT> com>
AuthorDate: Mon Feb 19 17:26:10 2018 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Mon Mar  5 20:27:28 2018 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=2b63b5e7

kmerge.sh: allow kernel source upgrades w/ kerncache

Currently when kerncache is on and it detects any usable cache, it
adds a package.provided entry so that no new kernel sources will be
installed.  This patch adds a check for newer kernel sources, so if
newer sources are available then it won't create the package.provided
entry.

 targets/support/kmerge.sh | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
index ffa3c9e9..dfdb637c 100755
--- a/targets/support/kmerge.sh
+++ b/targets/support/kmerge.sh
@@ -221,15 +221,12 @@ then
                rm -f ${clst_port_conf}/profile/package.provided
        fi
 
-       if [ ! -e ${clst_port_conf}/profile/package.provided ]
-       then
-               mkdir -p ${clst_port_conf}/profile
-               echo "${KERNELVERSION}" > 
${clst_port_conf}/profile/package.provided
+       # Don't use package.provided if there's a pending up/downgrade
+       if [[ "$(portageq best_visible / ${clst_ksource})" == 
"${KERNELVERSION}" ]]; then
+               echo "No pending updates for ${clst_ksource}"
        else
-               if ( ! grep -q "^${KERNELVERSION}\$"  
${clst_port_conf}/profile/package.provided )
-               then
-                       echo "${KERNELVERSION}" >> 
${clst_port_conf}/profile/package.provided
-               fi
+               echo "Pending updates for ${clst_ksource}, removing 
package.provided"
+               rm ${clst_port_conf}/profile/package.provided
        fi
 
        [ -L /usr/src/linux ] && rm -f /usr/src/linux

Reply via email to