From 2a35343c7e4ebde7a6d509b546c9d66e9f8da9a7 Mon Sep 17 00:00:00 2001 From: Göktürk Yüksek Date: Thu, 30 Jan 2020 21:56:06 -0500 Subject: crossdev: update profiles/categories during uninstall MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If we remove the category cross-${CTARGET} in the output overlay, remove the category itself from profiles/categories. Signed-off-by: Göktürk Yüksek Signed-off-by: Sergei Trofimovich --- crossdev | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crossdev b/crossdev index b460d53..9427cf1 100755 --- a/crossdev +++ b/crossdev @@ -555,8 +555,13 @@ uninstall() { ewarn "Uninstalling target '${CTARGET}' ..." # clean out portage config files - [[ -d ${CROSSDEV_OVERLAY}/cross-${CTARGET} ]] \ - && rm -r ${CROSSDEV_OVERLAY}/cross-${CTARGET} + if [[ -d ${CROSSDEV_OVERLAY}/cross-${CTARGET} ]]; then + rm -r "${CROSSDEV_OVERLAY}"/cross-${CTARGET} + # if we remove all the package in the category, + # might as well remove the category itself + sed -e "/cross-${CTARGET}/d" \ + -i "${CROSSDEV_OVERLAY}"/profiles/categories + fi # crossdev stopped creating 'package.keywords' in Jan 2020 for f in categories package.{accept_keywords,env,mask,keywords,use} profile/package.use.{force,mask} ; do f="${CONFIGROOT}/${f}" -- cgit v1.2.3-18-g5258