1 |
opfer 08/02/21 11:06:20 |
2 |
|
3 |
Modified: emacs-updater |
4 |
Log: |
5 |
bump emacs-updater to version 0.4 |
6 |
(Portage version: 2.1.4.4) |
7 |
|
8 |
Revision Changes Path |
9 |
1.2 app-admin/eselect-emacs/files/emacs-updater |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/eselect-emacs/files/emacs-updater?rev=1.2&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/eselect-emacs/files/emacs-updater?rev=1.2&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-admin/eselect-emacs/files/emacs-updater?r1=1.1&r2=1.2 |
14 |
|
15 |
Index: emacs-updater |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/app-admin/eselect-emacs/files/emacs-updater,v |
18 |
retrieving revision 1.1 |
19 |
retrieving revision 1.2 |
20 |
diff -u -r1.1 -r1.2 |
21 |
--- emacs-updater 9 Jan 2008 15:47:17 -0000 1.1 |
22 |
+++ emacs-updater 21 Feb 2008 11:06:20 -0000 1.2 |
23 |
@@ -5,8 +5,37 @@ |
24 |
# Christian Faulhammer <opfer@g.o> |
25 |
# Ulrich Mueller <ulm@g.o> |
26 |
|
27 |
-# Only set colours if output is not redirected |
28 |
-if tty -s <&1; then |
29 |
+VERSION=0.4 |
30 |
+SITELISP=/usr/share/emacs/site-lisp |
31 |
+TMPFILE="$(mktemp /tmp/emacs-updater.XXXXXX)" |
32 |
+ |
33 |
+cat <<-EOF |
34 |
+ |
35 |
+Emacs updater version ${VERSION} |
36 |
+Written by the Gentoo Emacs team http://www.gentoo.org/proj/en/lisp/emacs/ |
37 |
+Find packages that are installed in the wrong location |
38 |
+ |
39 |
+EOF |
40 |
+ |
41 |
+# Read in all command-line options and force English output |
42 |
+OPTIONS=$(LC_ALL=C getopt -o hpn --long help,pretend,nocolour \ |
43 |
+ -n 'emacs-updater' -- "$@") |
44 |
+ |
45 |
+eval set -- "${OPTIONS}" |
46 |
+ |
47 |
+while true |
48 |
+do |
49 |
+ case "${1}" in |
50 |
+ -h|--help) echo "You have the following options: --pretend|-p and/or --no-colour|-n" ; exit 0 ;; |
51 |
+ -p|--pretend) PRETEND="true"; shift 1 ;; |
52 |
+ -n|--nocolour) NOCOLOUR="true"; shift 1;; |
53 |
+ --) shift ; break ;; |
54 |
+ esac |
55 |
+done |
56 |
+ |
57 |
+# Only set colours if output is not redirected or the --no-colour |
58 |
+# option is not set |
59 |
+if tty -s <&1 && [ -z ${NOCOLOUR} ] ; then |
60 |
BLUE=$'\e[34;01m' |
61 |
GREEN=$'\e[32;01m' |
62 |
RED=$'\e[31;01m' |
63 |
@@ -16,11 +45,6 @@ |
64 |
NORMAL=$'\e[0m' |
65 |
fi |
66 |
|
67 |
-SITELISP=/usr/share/emacs/site-lisp |
68 |
-VERSION=0.3 |
69 |
-TMPFILE="$(mktemp /tmp/emacs-updater.XXXXXX)" |
70 |
- |
71 |
- |
72 |
message() { |
73 |
local OUTPUT=$@ |
74 |
echo "${GREEN}*${NORMAL}${BOLD} ${OUTPUT}${NORMAL}" |
75 |
@@ -36,14 +60,6 @@ |
76 |
echo "${RED}*${NORMAL}${BOLD} ${OUTPUT}${NORMAL}" |
77 |
} |
78 |
|
79 |
-cat <<-EOF |
80 |
- |
81 |
-Emacs updater version ${VERSION} |
82 |
-Written by the Gentoo Emacs team http://www.gentoo.org/proj/en/lisp/emacs/ |
83 |
-Find packages that are installed in the wrong location |
84 |
- |
85 |
-EOF |
86 |
- |
87 |
if ! [ -x /usr/bin/qfile ]; then |
88 |
echo |
89 |
failure "Please emerge app-portage/portage-utils to use this tool" |
90 |
@@ -66,14 +82,18 @@ |
91 |
message "Packages with site files in the wrong location:" |
92 |
cat "${TMPFILE}" |
93 |
|
94 |
+if [ ${PRETEND} ]; then |
95 |
+ exit 3 |
96 |
+fi |
97 |
+ |
98 |
echo |
99 |
echo -n "${BOLD}Remerge packages?${NORMAL} [${GREEN}Yes${NORMAL}/${RED}No${NORMAL}] " |
100 |
read choice |
101 |
echo |
102 |
case "${choice}" in |
103 |
- y*|Y*|"") |
104 |
- ;; |
105 |
- *) |
106 |
+ y*|Y*|"") |
107 |
+ ;; |
108 |
+ *) |
109 |
warning "Quitting." |
110 |
exit 10 ;; |
111 |
esac |
112 |
|
113 |
|
114 |
|
115 |
-- |
116 |
gentoo-commits@l.g.o mailing list |