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 1SR4F4-0007Nz-L9 for garchives@archives.gentoo.org; Sun, 06 May 2012 16:23:26 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 227C1E08B5; Sun, 6 May 2012 16:16:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F2523E09BE for ; Sun, 6 May 2012 16:07:27 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 765481B4071 for ; Sun, 6 May 2012 16:07:27 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 3D49DE5433 for ; Sun, 6 May 2012 16:07:26 +0000 (UTC) From: "Sebastian Pipping" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sebastian Pipping" Message-ID: <1196274485.7d068f35aad4034a76f3bd6019c66a2478642a4c.sping@gentoo> Subject: [gentoo-commits] proj/emacs-tools:backups/eselect-emacs@1030 commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: emacs-updater.sh X-VCS-Directories: / X-VCS-Committer: sping X-VCS-Committer-Name: Sebastian Pipping X-VCS-Revision: 7d068f35aad4034a76f3bd6019c66a2478642a4c X-VCS-Branch: backups/eselect-emacs@1030 Date: Sun, 6 May 2012 16:07:26 +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: 93147b3d-4399-4c81-bfd1-790c0cb42712 X-Archives-Hash: 25913bde689cf789740cf4679ff1a910 commit: 7d068f35aad4034a76f3bd6019c66a2478642a4c Author: Christian Faulhammer gentoo org> AuthorDate: Wed Nov 28 18:28:05 2007 +0000 Commit: Sebastian Pipping gentoo org> CommitDate: Wed Nov 28 18:28:05 2007 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/emacs-tools.g= it;a=3Dcommit;h=3D7d068f35 message(), warning(), failure(): Introduce new functions to display text=20 define colors for console output and use them svn path=3D/emacs-extra/eselect-emacs/; revision=3D804 --- emacs-updater.sh | 56 +++++++++++++++++++++++++++++++++++++-----------= ----- 1 files changed, 39 insertions(+), 17 deletions(-) diff --git a/emacs-updater.sh b/emacs-updater.sh index cec421d..be433cd 100755 --- a/emacs-updater.sh +++ b/emacs-updater.sh @@ -3,52 +3,74 @@ # Licensed under GPL version 2 # Author Christian Faulhammer =20 +BLUE=3D$'\033[34;01m' +GREEN=3D$'\e[32;01m' +OFF=3D$'\033[0m' +RED=3D$'\033[31;01m' +YELLOW=3D$'\033[33;01m' +CYAN=3D$'\033[36;01m' +BOLD=3D$'\e[0;01m' +NORMAL=3D$'\033[0m' + SITELISP=3D/usr/share/emacs/site-lisp VERSION=3D0.1 -TMPFILE=3D$(mktemp /tmp/emacs-updater.XXXXXX) +TMPFILE=3D"$(mktemp /tmp/emacs-updater.XXXXXX)" =20 -echo "Emacs updater version ${VERSION}" -echo "Find packages that are installed in the wrong location, file bugs = on http://bugs.gentoo.org/" -echo -echo "Note, you must use the eclasses from the Emacs Overlay for proper = operation! " -echo + +message() { + local OUTPUT=3D$@ + echo + echo "${GREEN}*${NORMAL}${BOLD} ${OUTPUT}${NORMAL}" +} + +warning() { + local OUTPUT=3D$@ + echo + echo "${YELLOW}*${NORMAL}${BOLD} ${OUTPUT}${NORMAL}" +} + +failure() { + local OUTPUT=3D$@ + echo + echo "${RED}*${NORMAL}${BOLD} ${OUTPUT}${NORMAL}"=20 +} + +message "Emacs updater version ${VERSION}" +message "Find packages that are installed in the wrong location, file bu= gs on http://bugs.gentoo.org/" +warning "Note, you must use the eclasses from the Emacs Overlay for prop= er operation! " =20 if ! [ -x /usr/bin/qfile ]; then - echo "Please emerge app-portage/portage-utils to use this tool" + failure "Please emerge app-portage/portage-utils to use this tool" exit 1 fi =20 for sf in "${ROOT}/${SITELISP}"/[0-9][0-9]*-gentoo.el do - echo "Processing ..." + message "Processing ..." qfile -qC "${sf}" >> "${TMPFILE}" done =20 =20 if [[ $(cat ${TMPFILE}) =3D=3D "" ]]; then - echo - echo "No packages to update, quitting." + warning "No packages to update, quitting." exit 2 fi =20 -echo -echo "Packages with site files in the wrong location:" +message "Packages with site files in the wrong location:" cat "${TMPFILE}" =20 echo -echo -n "Remerge packages? [Yes/No] " +echo -n "${BOLD}Remerge packages?${NORMAL} [${GREEN}Yes${NORMAL}/${RED}N= o${NORMAL}] " read choice echo case "${choice}" in y*|Y*|"") ;; *) - echo "Quitting." - echo + message "Quitting." exit 10 ;; esac =20 emerge -av $(cat "${TMPFILE}") =20 -echo -echo "If a package is being rebuilt over and over again, please report i= t on http://bugs.gentoo.org/" +warning "If a package is being rebuilt over and over again, please repor= t it on http://bugs.gentoo.org/"