Lines 165-177
Link Here
|
165 |
# Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u |
166 |
# Replace whitespace with linebreaks, normalize repeated '/' chars, and sort -u |
166 |
# (If any libs have whitespace in their filenames, someone needs punishment.) |
167 |
# (If any libs have whitespace in their filenames, someone needs punishment.) |
167 |
clean_var() { |
168 |
clean_var() { |
168 |
[[ $@ = '-*'* ]] && return |
169 |
awk 'BEGIN {RS="[[:space:]]"} |
169 |
shopt -s extglob |
170 |
/-\*/ {exit} |
170 |
local a="$@" |
171 |
/[^[:space:]]/ {gsub(/\/\/+/, "/"); print}' | sort -u |
171 |
a="${a%%[[:space:]]-\*[[:space:]]*}" # Delete what follows -* |
|
|
172 |
a="${a//+([[:space:]])/$'\n'}" # Turn spaces into linebreaks |
173 |
a="${a//+(\/\/)//}" # Normalize slashes |
174 |
sort -u <<< "$a" |
175 |
} |
172 |
} |
176 |
# Exit and optionally output to sterr |
173 |
# Exit and optionally output to sterr |
177 |
die() { |
174 |
die() { |
Lines 352-360
Link Here
|
352 |
|
349 |
|
353 |
# Set the final variables |
350 |
# Set the final variables |
354 |
[[ $SEARCH_DIRS ]] || die 1 "No search defined -- this is a bug." |
351 |
[[ $SEARCH_DIRS ]] || die 1 "No search defined -- this is a bug." |
355 |
SEARCH_DIRS=$(clean_var "$SEARCH_DIRS") |
352 |
SEARCH_DIRS=$(clean_var <<< "$SEARCH_DIRS") |
356 |
SEARCH_DIRS_MASK=$(clean_var "$SEARCH_DIRS_MASK") |
353 |
SEARCH_DIRS_MASK=$(clean_var <<< "$SEARCH_DIRS_MASK") |
357 |
LD_LIBRARY_MASK=$(clean_var "$LD_LIBRARY_MASK") |
354 |
LD_LIBRARY_MASK=$(clean_var <<< "$LD_LIBRARY_MASK") |
358 |
|
355 |
|
359 |
set_trap() { |
356 |
set_trap() { |
360 |
trap "rm_temp $1" SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM |
357 |
trap "rm_temp $1" SIGHUP SIGINT SIGQUIT SIGABRT SIGTERM |