diff options
author | Ulrich Müller <ulm@gentoo.org> | 2008-03-08 06:53:06 +0000 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2008-03-08 06:53:06 +0000 |
commit | d4aa5e4760c5b896f79b1559cf95a64ab0e488a7 (patch) | |
tree | bf94ebd6e12cbc745dedac9fa95af5c88b0641d6 /app-admin/eselect-emacs | |
parent | Stable for HPPA (bug #212482). (diff) | |
download | gentoo-2-d4aa5e4760c5b896f79b1559cf95a64ab0e488a7.tar.gz gentoo-2-d4aa5e4760c5b896f79b1559cf95a64ab0e488a7.tar.bz2 gentoo-2-d4aa5e4760c5b896f79b1559cf95a64ab0e488a7.zip |
Update emacs-updater to version 0.6.
(Portage version: 2.1.4.4)
Diffstat (limited to 'app-admin/eselect-emacs')
-rw-r--r-- | app-admin/eselect-emacs/ChangeLog | 5 | ||||
-rwxr-xr-x | app-admin/eselect-emacs/files/emacs-updater | 50 |
2 files changed, 38 insertions, 17 deletions
diff --git a/app-admin/eselect-emacs/ChangeLog b/app-admin/eselect-emacs/ChangeLog index 1cd5d4aaf939..2b1b090fdf87 100644 --- a/app-admin/eselect-emacs/ChangeLog +++ b/app-admin/eselect-emacs/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for app-admin/eselect-emacs # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-emacs/ChangeLog,v 1.40 2008/02/21 11:06:19 opfer Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/eselect-emacs/ChangeLog,v 1.41 2008/03/08 06:53:05 ulm Exp $ + + 08 Mar 2008; Ulrich Mueller <ulm@gentoo.org> files/emacs-updater: + Update emacs-updater to version 0.6. 21 Feb 2008; Christian Faulhammer <opfer@gentoo.org> files/emacs-updater: bump emacs-updater to version 0.4 diff --git a/app-admin/eselect-emacs/files/emacs-updater b/app-admin/eselect-emacs/files/emacs-updater index 51e09ebdfcdf..7f94d97f1fbc 100755 --- a/app-admin/eselect-emacs/files/emacs-updater +++ b/app-admin/eselect-emacs/files/emacs-updater @@ -1,11 +1,14 @@ #!/bin/bash -# Licensed under GPL version 2 +# Copyright 2007-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: emacs-updater,v 1.3 2008/03/08 06:53:06 ulm Exp $ + # Authors: # Christian Faulhammer <opfer@gentoo.org> # Ulrich Mueller <ulm@gentoo.org> -VERSION=0.4 +VERSION=0.6 SITELISP=/usr/share/emacs/site-lisp TMPFILE="$(mktemp /tmp/emacs-updater.XXXXXX)" @@ -17,32 +20,44 @@ Find packages that are installed in the wrong location EOF +usage() { + sed -e 's/^X//' <<-EOF + Usage: ${0##*/} [OPTION]... + X -n, --nocolour disable colour in output + X -p, --pretend don't actually emerge packages + X -h, --help display this help and exit + EOF + exit ${1} +} + # Read in all command-line options and force English output OPTIONS=$(LC_ALL=C getopt -o hpn --long help,pretend,nocolour \ -n 'emacs-updater' -- "$@") +[ $? -eq 0 ] || usage 1 eval set -- "${OPTIONS}" while true do case "${1}" in - -h|--help) echo "You have the following options: --pretend|-p and/or --no-colour|-n" ; exit 0 ;; - -p|--pretend) PRETEND="true"; shift 1 ;; - -n|--nocolour) NOCOLOUR="true"; shift 1;; - --) shift ; break ;; + -h|--help) usage 0 ;; + -p|--pretend) PRETEND="true"; shift 1 ;; + -n|--nocolour) NOCOLOUR="true"; shift 1 ;; + --) shift; break ;; esac done # Only set colours if output is not redirected or the --no-colour # option is not set -if tty -s <&1 && [ -z ${NOCOLOUR} ] ; then - BLUE=$'\e[34;01m' - GREEN=$'\e[32;01m' - RED=$'\e[31;01m' - YELLOW=$'\e[33;01m' - CYAN=$'\e[36;01m' - BOLD=$'\e[0;01m' - NORMAL=$'\e[0m' +if [ -t 1 ] && [ -z "${NOCOLOUR}" ] ; then + RED=$(tput -S <<<$'setaf 1\nbold') + GREEN=$(tput -S <<<$'setaf 2\nbold') + YELLOW=$(tput -S <<<$'setaf 3\nbold') + BLUE=$(tput -S <<<$'setaf 4\nbold') + MAGENTA=$(tput -S <<<$'setaf 5\nbold') + CYAN=$(tput -S <<<$'setaf 6\nbold') + BOLD=$(tput bold) + NORMAL=$(tput sgr0) fi message() { @@ -79,10 +94,13 @@ if [ ! -s "${TMPFILE}" ]; then exit 2 fi -message "Packages with site files in the wrong location:" +NO_OF_PACKAGES=$(sed -n '$=' "${TMPFILE}") + +[ ${NO_OF_PACKAGES} -eq 1 ] && s= || s=s +message "${NO_OF_PACKAGES} package${s} with site files in the wrong location:" cat "${TMPFILE}" -if [ ${PRETEND} ]; then +if [ "${PRETEND}" ]; then exit 3 fi |