aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGöktürk Yüksek <gokturk@gentoo.org>2020-01-30 21:56:06 -0500
committerSergei Trofimovich <slyfox@gentoo.org>2020-01-31 07:36:46 +0000
commit2a35343c7e4ebde7a6d509b546c9d66e9f8da9a7 (patch)
tree5817b64496e7ed15ea5a00b199ec18e230029f78
parentcrossdev: create a repos.conf entry for the output overlay if necessary (diff)
downloadcrossdev-2a35343c7e4ebde7a6d509b546c9d66e9f8da9a7.tar.gz
crossdev-2a35343c7e4ebde7a6d509b546c9d66e9f8da9a7.tar.bz2
crossdev-2a35343c7e4ebde7a6d509b546c9d66e9f8da9a7.zip
crossdev: update profiles/categories during uninstall
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 <gokturk@gentoo.org> Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
-rwxr-xr-xcrossdev9
1 files 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}"