#!/usr/bin/env bash export local portagedir="/usr/portage" export local confdir="/etc/portage" reset_current_mode() { if [ -d ""$portagedir"/.git" ] ; then find "$portagedir" -mindepth 1 -name "packages" -prune -o -name "distfiles" -prune -o -exec rm -rf {} \; > /dev/null 2>&1 rm ""$confdir"/make.conf" rm ""$confdir"/make.profile" rm "$confdir" fi } main () { reset_current_mode } main