diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-09-19 21:19:06 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-09-19 21:19:06 +0000 |
| commit | ef6f84e233155004a5f0e40e877219502a5f204a (patch) | |
| tree | 79d58835b125fbf864032776b878e3e15f0bc751 | |
| parent | 6477f6d174d1d1e597d93e08b9628ecc920c7c29 (diff) | |
| download | gentoolkit-ef6f84e233155004a5f0e40e877219502a5f204a.tar.gz | |
Fix handling of '-*' in user alterable variables. (Bug #192979)
svn path=/; revision=447
| -rwxr-xr-x | trunk/src/revdep-rebuild/revdep-rebuild | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/trunk/src/revdep-rebuild/revdep-rebuild b/trunk/src/revdep-rebuild/revdep-rebuild index 19de90d..9d5f933 100755 --- a/trunk/src/revdep-rebuild/revdep-rebuild +++ b/trunk/src/revdep-rebuild/revdep-rebuild @@ -165,11 +165,13 @@ get_file_owner() { :; } # Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u # (If any libs have whitespace in their filenames, someone needs punishment.) clean_var() { - local a=$(echo ${@%%[[:space:]]-\*[[:space:]]*}) # Deliberately unquoted - # A benchmark shows this loop is faster than piping to sed, - # as long as there aren't more than a handful of '/' chars. - while [[ $a = *//* ]]; do a="${a//\/\///}"; done - sort -u <<< "${a// /$'\n'}" + [[ $@ = '-*'* ]] && return + shopt -s extglob + local a="$@" + a="${a%%[[:space:]]-\*[[:space:]]*}" # Delete what follows -* + a="${a//+([[:space:]])/$'\n'}" # Turn spaces into linebreaks + a="${a//+(\/\/)//}" # Normalize slashes + sort -u <<< "$a" } # Exit and optionally output to sterr die() { |
