1 |
commit: d8579a7df0e40734cf4058bae64c63035d041d93 |
2 |
Author: Paul Varner <fuzzyray <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 25 16:14:21 2011 +0000 |
4 |
Commit: Paul Varner <fuzzyray <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 25 16:14:21 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=d8579a7d |
7 |
|
8 |
Fix whitespace |
9 |
|
10 |
--- |
11 |
bin/euse | 34 +++++++++++++++++----------------- |
12 |
1 files changed, 17 insertions(+), 17 deletions(-) |
13 |
|
14 |
diff --git a/bin/euse b/bin/euse |
15 |
index bb207c7..175febb 100755 |
16 |
--- a/bin/euse |
17 |
+++ b/bin/euse |
18 |
@@ -74,7 +74,7 @@ parse_arguments() { |
19 |
-E | --enable) MODE="modify"; ACTION="add";; |
20 |
-D | --disable) MODE="modify"; ACTION="remove";; |
21 |
-P | --prune | -R | --remove) |
22 |
- MODE="modify"; ACTION="prune";; |
23 |
+ MODE="modify"; ACTION="prune";; |
24 |
-p | --package) MODE="modify"; shift; PACKAGE=${1}; SCOPE="local";; |
25 |
-*) |
26 |
echo "ERROR: unknown option ${1} specified." |
27 |
@@ -218,7 +218,7 @@ print ' '.join(r)" |
28 |
# * - Lines of package atom followed by flags |
29 |
# (app-editors/vim flag1 flag2 -flag3) |
30 |
reduce_package_use() { |
31 |
- echo "${@}" | python -c "import sys,re |
32 |
+ echo "${@}" | python -c "import sys,re |
33 |
h={}; getflags=re.compile(r'(-?[\w*-]+)') |
34 |
for x in sys.stdin.read().split('\n'): |
35 |
if not x: continue |
36 |
@@ -708,7 +708,7 @@ ALL_PORTDIRS=( "$PORTDIR" $(get_all_overlays) ) |
37 |
# Returns: |
38 |
# 0 (True) if needle in haystack, null (False) otherwise |
39 |
array_contains() { |
40 |
- for i in $1; do [[ $i == $2 ]] && return 0; done |
41 |
+ for i in $1; do [[ $i == $2 ]] && return 0; done |
42 |
return |
43 |
} # }}} |
44 |
|
45 |
@@ -979,8 +979,8 @@ scrub_use_flag() { |
46 |
elif [[ -n "${PACKAGE}" ]]; then |
47 |
if [[ -n $(echo "${line}" | grep -Ee "${pkg_re}") ]]; then |
48 |
# If this is the only (remaining) use flag defined |
49 |
- # for this package, then remove the whole line |
50 |
- if [[ -z $(echo "${line}" | \ |
51 |
+ # for this package, then remove the whole line |
52 |
+ if [[ -z $(echo "${line}" | \ |
53 |
grep -Ee "${pkg_re} *-?${flag} *$") ]]; then |
54 |
# Remove flag from this line |
55 |
echo "${line}" | sed -re "s/ *-?\b${flag}\b//" |
56 |
@@ -1060,12 +1060,12 @@ modify_package() { |
57 |
# XXX: Handle version or version wildcard? |
58 |
warn "USE flag \"${flag}\" is not used by $PACKAGE" |
59 |
# Don't necessarily bail for this, just warn |
60 |
- elif [[ -n "${V}" && -z "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then |
61 |
- error "Invalid package atom. Did you forget the leading '='?" |
62 |
- continue |
63 |
- elif [[ -z "${V}" && -n "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then |
64 |
- error "Invalid package atom. Did you forget the version?" |
65 |
- continue |
66 |
+ elif [[ -n "${V}" && -z "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then |
67 |
+ error "Invalid package atom. Did you forget the leading '='?" |
68 |
+ continue |
69 |
+ elif [[ -z "${V}" && -n "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then |
70 |
+ error "Invalid package atom. Did you forget the version?" |
71 |
+ continue |
72 |
fi |
73 |
# If flag is enabled in portage USE flags (emerge --info), |
74 |
# then "remove"ing the flag should be replaced with adding |
75 |
@@ -1084,10 +1084,10 @@ modify_package() { |
76 |
flag="-${flag}" |
77 |
ACTION="add" |
78 |
fi |
79 |
- else |
80 |
- # Not enabled in package.use, so disable it there |
81 |
- flag="-${flag}" |
82 |
- ACTION="add" |
83 |
+ else |
84 |
+ # Not enabled in package.use, so disable it there |
85 |
+ flag="-${flag}" |
86 |
+ ACTION="add" |
87 |
fi |
88 |
else |
89 |
error "USE flag \"$flag\" is already disabled for $PACKAGE" |
90 |
@@ -1146,7 +1146,7 @@ modify_package() { |
91 |
fi |
92 |
# Walk through the file and add the flag manually |
93 |
echo "Adding \"${PACKAGE}[${flag}]\" use flag in \"${filename}\"" |
94 |
- local added=0 |
95 |
+ local added=0 |
96 |
while read line; do |
97 |
if [[ -n $(echo "${line}" | egrep -re "^[^#]*${PACKAGE} ") ]]; then |
98 |
echo $(reduce_package_use "${line} ${flag}") |
99 |
@@ -1281,7 +1281,7 @@ modify() { |
100 |
echo -n 'USE="' |
101 |
echo -ne "${NEW_MAKE_CONF_USE_2%% }" |
102 |
echo '"' |
103 |
- inuse=0 |
104 |
+ inuse=0 |
105 |
had_use=1 |
106 |
fi |
107 |
done |