Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions scripts/scene-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ ignore-scenes-with-missing-plugins() {
echo "Searching for missing plugins..."

while read scene; do
# XML scenes (.scn): parse <RequiredPlugin> tags
if grep -q '^[ ]*<[ ]*RequiredPlugin' "$scene"; then
grep '^[ ]*<[ ]*RequiredPlugin' "$scene" > "$output_dir/grep.tmp"
while read match; do
Expand All @@ -411,6 +412,32 @@ ignore-scenes-with-missing-plugins() {
fi
done < "$output_dir/grep.tmp"
rm -f "$output_dir/grep.tmp"
# Python scenes (.py, .pyscn): parse addObject('RequiredPlugin', ...) calls
elif grep -q "addObject(['\"]RequiredPlugin['\"]" "$scene"; then
grep "addObject(['\"]RequiredPlugin['\"]" "$scene" > "$output_dir/grep.tmp"
while read match; do
if echo "$match" | grep -q 'pluginName'; then
plugin="$(echo "$match" | sed -e "s:.*pluginName[ ]*=[ ]*[\'\"]\([^\'\"]*\)[\'\"].*:\1:g")"
elif echo "$match" | grep -q 'name'; then
plugin="$(echo "$match" | sed -e "s:.*name[ ]*=[ ]*[\'\"]\([^\'\"]*\)[\'\"].*:\1:g")"
else
echo " Warning: unknown RequiredPlugin found in $scene"
break
fi
local lib="$(get-lib "$plugin")"
if [ -z "$lib" ]; then
if grep -q "$scene" "$output_dir/all-tested-scenes.txt"; then
grep -v "$scene" "$output_dir/all-tested-scenes.txt" > "$output_dir/all-tested-scenes.tmp"
mv "$output_dir/all-tested-scenes.tmp" "$output_dir/all-tested-scenes.txt"
rm -f "$output_dir/all-tested-scenes.tmp"
if ! grep -q "$scene" "$output_dir/all-ignored-scenes.txt"; then
echo " ignore $scene: missing plugin \"$plugin\""
echo "$scene" >> "$output_dir/all-ignored-scenes.txt"
fi
fi
fi
done < "$output_dir/grep.tmp"
rm -f "$output_dir/grep.tmp"
fi
done < "$output_dir/all-tested-scenes.txt"
echo "Searching for missing plugins: done."
Expand Down
Loading