From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PxtsP-0002kF-Ny for garchives@archives.gentoo.org; Fri, 11 Mar 2011 04:22:58 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 292B1E061F; Fri, 11 Mar 2011 04:22:46 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id EDC6FE0654 for ; Fri, 11 Mar 2011 04:22:45 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 73B651B4051 for ; Fri, 11 Mar 2011 04:22:45 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id B2F2E80075 for ; Fri, 11 Mar 2011 04:22:44 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <5da435d712a7896166040ed5751bccc448c06af4.vapier@gentoo> Subject: [gentoo-commits] proj/crossdev:master commit in: / X-VCS-Repository: proj/crossdev X-VCS-Files: crossdev X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 5da435d712a7896166040ed5751bccc448c06af4 Date: Fri, 11 Mar 2011 04:22:44 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: bc6086a13a8925ce88def364668ac6c1 commit: 5da435d712a7896166040ed5751bccc448c06af4 Author: Mike Frysinger gentoo org> AuthorDate: Fri Mar 11 04:04:58 2011 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Mar 11 04:11:01 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;= a=3Dcommit;h=3D5da435d7 crossdev: clean out generated sysroot /etc too Signed-off-by: Mike Frysinger gentoo.org> --- crossdev | 39 +++++++++++++++++++++++++++++++++------ 1 files changed, 33 insertions(+), 6 deletions(-) diff --git a/crossdev b/crossdev index 20d8817..1954331 100755 --- a/crossdev +++ b/crossdev @@ -290,8 +290,11 @@ uninstall() { emerge -qC =3D${p} || exit 1 done else - ewarn "${CTARGET}: no packages installed" + ewarn "${CTARGET}: no packages installed; will clean out known files" fi + + # clean out known toolchain files (binutils/gcc) + local b for b in \ addr2line ar as c++filt dlltool dllwrap embedspu \ gprof ld nm objcopy objdump ranlib readelf \ @@ -300,22 +303,46 @@ uninstall() { rm -f /usr/bin/${CTARGET}-${b} /usr/${CTARGET}/bin/${b} done rm -f /usr/${CTARGET}/{sys-include,usr} + rmdir /usr/${CTARGET}/{include/asm,include} 2>/dev/null rm -f /usr/bin/${CTARGET}-{gcc,{c,g}++,cpp,gfortran,gcov} + rm -f /etc/env.d/{binutils,gcc}/config-${CTARGET} + + # clean out files from crossdev itself + [[ -e /var/db/pkg/cross-${CTARGET} ]] && rmdir /var/db/pkg/cross-${CTAR= GET} rm -f /usr/bin/${CTARGET}-{emerge,fix-root,pkg-config} /usr/bin/emerge-= ${CTARGET} - rmdir /usr/${CTARGET}/{include/asm,include} &> /dev/null - for d in /usr/${CTARGET} /usr/lib/gcc{,-lib}/${CTARGET} ; do + + local f + for f in make.{conf,globals,profile} ; do + f=3D"/usr/${CTARGET}/etc/${f}" + [[ -L ${f} ]] && rm -f ${f} + f=3D"/usr/${CTARGET}/etc/portage/${f##*/}" + [[ -L ${f} ]] && rm -f ${f} + done + find /usr/share/crossdev/etc/ -type f | \ + while read f ; do + f1=3D${f} + [[ ! -e ${f1} ]] && continue + m1=3D$(set -- `md5sum ${f1}`; echo $1) + f2=3D/usr/${CTARGET}${f#/usr/share/crossdev} + [[ ! -e ${f2} ]] && continue + m2=3D$(set -- `md5sum ${f2}`; echo $1) + if [[ ${m1} =3D=3D ${m2} ]] ; then + rm -f ${f2} + fi + done + + # clean out the sysroot, prompting the user if need be + for d in /usr/lib/gcc{,-lib}/${CTARGET} /usr/${CTARGET} ; do if [[ ! -d ${d} ]] ; then rm -f "${d}" &> /dev/null else - rmdir "${d}" &> /dev/null && continue + find "${d}" -type d -depth -exec rmdir {} + 2>/dev/null && continue printf "${d}: directory still exists; remove recursively? [y/N] " local ans read ans [[ ${ans} =3D=3D [Yy]* ]] && rm -rf "${d}" fi done - rm -f /etc/env.d/{binutils,gcc}/config-${CTARGET} - [[ -e /var/db/pkg/cross-${CTARGET} ]] && rmdir /var/db/pkg/cross-${CTAR= GET} =20 exit 0 }