find-{provides,requires,scriptlet-requires}: report method failures

This commit is contained in:
Alexey Tourbin 2008-06-04 03:26:23 +04:00
parent c5e957a3b3
commit d7dbd5f2ff
3 changed files with 12 additions and 6 deletions

View File

@ -97,12 +97,14 @@ RunMethod()
local filelist="$workdir/${exe##*/}".files local filelist="$workdir/${exe##*/}".files
local deplist="$workdir/${exe##*/}".deps local deplist="$workdir/${exe##*/}".deps
Debug "running $filter" Debug "running $filter"
"$filter" <"$workdir"/files+types >"$filelist" "$filter" <"$workdir"/files+types >"$filelist" ||
Fatal "$filter failed"
Verbose "$filter: $(wc -l <"$filelist") files" Verbose "$filter: $(wc -l <"$filelist") files"
[ -s "$filelist" ] || return 0 [ -s "$filelist" ] || return 0
# XXX validate $filelist # XXX validate $filelist
Debug "running $exe" Debug "running $exe"
"$exe" <"$filelist" >"$deplist" "$exe" <"$filelist" >"$deplist" ||
Fatal "$exe failed"
if [ -s "$deplist" ]; then if [ -s "$deplist" ]; then
LC_COLLATE=C sort -u -o "$deplist" "$deplist" LC_COLLATE=C sort -u -o "$deplist" "$deplist"
Verbose "$exe: $(wc -l <"$deplist") dependencies" Verbose "$exe: $(wc -l <"$deplist") dependencies"

View File

@ -87,12 +87,14 @@ RunMethod()
local filelist="$workdir/${exe##*/}".files local filelist="$workdir/${exe##*/}".files
local deplist="$workdir/${exe##*/}".deps local deplist="$workdir/${exe##*/}".deps
Debug "running $filter" Debug "running $filter"
"$filter" <"$workdir"/files+types >"$filelist" "$filter" <"$workdir"/files+types >"$filelist" ||
Fatal "$filter failed"
Verbose "$filter: $(wc -l <"$filelist") files" Verbose "$filter: $(wc -l <"$filelist") files"
[ -s "$filelist" ] || return 0 [ -s "$filelist" ] || return 0
# XXX validate $filelist # XXX validate $filelist
Debug "running $exe" Debug "running $exe"
"$exe" <"$filelist" >"$deplist" "$exe" <"$filelist" >"$deplist" ||
Fatal "$exe failed"
if [ -s "$deplist" ]; then if [ -s "$deplist" ]; then
LC_COLLATE=C sort -u -o "$deplist" "$deplist" LC_COLLATE=C sort -u -o "$deplist" "$deplist"
Verbose "$exe: $(wc -l <"$deplist") dependencies" Verbose "$exe: $(wc -l <"$deplist") dependencies"

View File

@ -19,9 +19,11 @@ RunMethod()
local file_and_type local file_and_type
file_and_type=$(file -L -NF$'\t' "$script") file_and_type=$(file -L -NF$'\t' "$script")
local filtered local filtered
filtered=$(printf '%s\n' "$file_and_type" |"$filter") filtered=$(printf '%s\n' "$file_and_type" |"$filter") ||
Fatal "$filter failed"
[ -n "$filtered" ] || return 0 [ -n "$filtered" ] || return 0
printf '%s\n' "$script" |"$exe" printf '%s\n' "$script" |"$exe" ||
Fatal "$exe failed"
} }
methods=$(SetupMethods req all) methods=$(SetupMethods req all)