From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1007564-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id AE7B81382C5
	for <garchives@archives.gentoo.org>; Mon,  5 Mar 2018 20:27:52 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 2011CE08E8;
	Mon,  5 Mar 2018 20:27:52 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 010B0E08E8
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Mar 2018 20:27:52 +0000 (UTC)
Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 36AAC335C06
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Mar 2018 20:27:51 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id E77A41ED
	for <gentoo-commits@lists.gentoo.org>; Mon,  5 Mar 2018 20:27:49 +0000 (UTC)
From: "Richard Farina" <zerochaos@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Richard Farina" <zerochaos@gentoo.org>
Message-ID: <1520281648.2b63b5e7f84303ff9268b1ecce31d9b8a56c5fc3.zerochaos@gentoo>
Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/
X-VCS-Repository: proj/catalyst
X-VCS-Files: targets/support/kmerge.sh
X-VCS-Directories: targets/support/
X-VCS-Committer: zerochaos
X-VCS-Committer-Name: Richard Farina
X-VCS-Revision: 2b63b5e7f84303ff9268b1ecce31d9b8a56c5fc3
X-VCS-Branch: master
Date: Mon,  5 Mar 2018 20:27:49 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 6ccb7d79-ccef-48e6-905f-32d17ed6a6d8
X-Archives-Hash: ab656fb0273df0685b59428179a11d45

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