aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Varner <fuzzyray@gentoo.org>2011-02-25 10:14:21 -0600
committerPaul Varner <fuzzyray@gentoo.org>2011-02-25 10:14:21 -0600
commitd8579a7df0e40734cf4058bae64c63035d041d93 (patch)
tree430c6d1f2b2cad1222e790cc3db7e531cc22e031
parentdecorate some functions as @staticmethod (diff)
downloadgentoolkit-d8579a7df0e40734cf4058bae64c63035d041d93.tar.gz
gentoolkit-d8579a7df0e40734cf4058bae64c63035d041d93.tar.bz2
gentoolkit-d8579a7df0e40734cf4058bae64c63035d041d93.zip
Fix whitespace
-rwxr-xr-xbin/euse34
1 files changed, 17 insertions, 17 deletions
diff --git a/bin/euse b/bin/euse
index bb207c7..175febb 100755
--- a/bin/euse
+++ b/bin/euse
@@ -74,7 +74,7 @@ parse_arguments() {
-E | --enable) MODE="modify"; ACTION="add";;
-D | --disable) MODE="modify"; ACTION="remove";;
-P | --prune | -R | --remove)
- MODE="modify"; ACTION="prune";;
+ MODE="modify"; ACTION="prune";;
-p | --package) MODE="modify"; shift; PACKAGE=${1}; SCOPE="local";;
-*)
echo "ERROR: unknown option ${1} specified."
@@ -218,7 +218,7 @@ print ' '.join(r)"
# * - Lines of package atom followed by flags
# (app-editors/vim flag1 flag2 -flag3)
reduce_package_use() {
- echo "${@}" | python -c "import sys,re
+ echo "${@}" | python -c "import sys,re
h={}; getflags=re.compile(r'(-?[\w*-]+)')
for x in sys.stdin.read().split('\n'):
if not x: continue
@@ -708,7 +708,7 @@ ALL_PORTDIRS=( "$PORTDIR" $(get_all_overlays) )
# Returns:
# 0 (True) if needle in haystack, null (False) otherwise
array_contains() {
- for i in $1; do [[ $i == $2 ]] && return 0; done
+ for i in $1; do [[ $i == $2 ]] && return 0; done
return
} # }}}
@@ -979,8 +979,8 @@ scrub_use_flag() {
elif [[ -n "${PACKAGE}" ]]; then
if [[ -n $(echo "${line}" | grep -Ee "${pkg_re}") ]]; then
# If this is the only (remaining) use flag defined
- # for this package, then remove the whole line
- if [[ -z $(echo "${line}" | \
+ # for this package, then remove the whole line
+ if [[ -z $(echo "${line}" | \
grep -Ee "${pkg_re} *-?${flag} *$") ]]; then
# Remove flag from this line
echo "${line}" | sed -re "s/ *-?\b${flag}\b//"
@@ -1060,12 +1060,12 @@ modify_package() {
# XXX: Handle version or version wildcard?
warn "USE flag \"${flag}\" is not used by $PACKAGE"
# Don't necessarily bail for this, just warn
- elif [[ -n "${V}" && -z "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then
- error "Invalid package atom. Did you forget the leading '='?"
- continue
- elif [[ -z "${V}" && -n "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then
- error "Invalid package atom. Did you forget the version?"
- continue
+ elif [[ -n "${V}" && -z "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then
+ error "Invalid package atom. Did you forget the leading '='?"
+ continue
+ elif [[ -z "${V}" && -n "$(egrep "<|>|=" <<< "${PACKAGE:0:1}")" ]]; then
+ error "Invalid package atom. Did you forget the version?"
+ continue
fi
# If flag is enabled in portage USE flags (emerge --info),
# then "remove"ing the flag should be replaced with adding
@@ -1084,10 +1084,10 @@ modify_package() {
flag="-${flag}"
ACTION="add"
fi
- else
- # Not enabled in package.use, so disable it there
- flag="-${flag}"
- ACTION="add"
+ else
+ # Not enabled in package.use, so disable it there
+ flag="-${flag}"
+ ACTION="add"
fi
else
error "USE flag \"$flag\" is already disabled for $PACKAGE"
@@ -1146,7 +1146,7 @@ modify_package() {
fi
# Walk through the file and add the flag manually
echo "Adding \"${PACKAGE}[${flag}]\" use flag in \"${filename}\""
- local added=0
+ local added=0
while read line; do
if [[ -n $(echo "${line}" | egrep -re "^[^#]*${PACKAGE} ") ]]; then
echo $(reduce_package_use "${line} ${flag}")
@@ -1281,7 +1281,7 @@ modify() {
echo -n 'USE="'
echo -ne "${NEW_MAKE_CONF_USE_2%% }"
echo '"'
- inuse=0
+ inuse=0
had_use=1
fi
done