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 1QrwxY-0005GP-P1 for garchives@archives.gentoo.org; Fri, 12 Aug 2011 18:59:57 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6E52921C37A; Fri, 12 Aug 2011 18:59:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 418FB21C37A for ; Fri, 12 Aug 2011 18:59:48 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C1BAE1B4063 for ; Fri, 12 Aug 2011 18:59:47 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 202EC80040 for ; Fri, 12 Aug 2011 18:59:47 +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: <3b5c872a23b35c10a7af6893e8fd03eafada0c0b.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: 3b5c872a23b35c10a7af6893e8fd03eafada0c0b Date: Fri, 12 Aug 2011 18:59:47 +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: 11ef1039506b3318d257215d2bef266b commit: 3b5c872a23b35c10a7af6893e8fd03eafada0c0b Author: Mike Frysinger gentoo org> AuthorDate: Fri Aug 12 18:58:45 2011 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Aug 12 18:58:45 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/crossdev.git;= a=3Dcommit;h=3D3b5c872a crossdev: add a --force option for uninstalling Rather than forcing people to type "y" or do `yes|crossdev -C`, add a force option to simplify the prompting. Signed-off-by: Mike Frysinger gentoo.org> --- crossdev | 19 +++++++++++++------ 1 files changed, 13 insertions(+), 6 deletions(-) diff --git a/crossdev b/crossdev index 6ad9d1a..6634095 100755 --- a/crossdev +++ b/crossdev @@ -38,6 +38,7 @@ Options: ${GOOD}--l, --libc${NORMAL} ver Specify version of libc to use ${GOOD}-A, --abis${NORMAL} abis Specify ABIs to build, first o= ne is the default ${GOOD}--[bgkl]env${NORMAL} env Specify env settings for binut= ils/gcc/kernel/libc + ${GOOD}-f, --force${NORMAL} I don't need a seat belt! ${GOOD}-S, --stable${NORMAL} Use latest stable versions as = default ${GOOD}-C, --clean${NORMAL} target Uninstall specified target ${GOOD}-P, --portage${NORMAL} opts Options to pass to emerge (see= emerge(1)) @@ -336,13 +337,17 @@ uninstall() { # 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 + rm -f "${d}" else - 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}" + if [[ ${FORCE} =3D=3D "no" ]] ; then + 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}" + else + rm -rf "${d}" + fi fi done =20 @@ -418,6 +423,7 @@ WITH_HEADERS=3D"COW" WITH_DEF_HEADERS=3D"yes" #2270= 65 gcc-4.3+ is a pita w/out hea EX_FAST=3D"no" EX_GCC=3D"no" EX_GDB=3D"no" +FORCE=3D"no" SET_X=3D"no" =20 while [[ $# -gt 0 ]] ; do @@ -442,6 +448,7 @@ while [[ $# -gt 0 ]] ; do --ex-insight) EX_INSIGHT=3D"yes";; --with-*) eval $(set_withval $1);; --without-*) eval $(set_withval $1);; + -f|--force) FORCE=3D"yes";; -x) SET_X=3D"yes";; -P|--portage) UOPTS=3D"${UOPTS} $2"; shift;; -b|-d|-p|-v|-q) UOPTS=3D"${UOPTS} $1";;