support noload and load filters

pull/5/head
Tomas M 2013-01-15 05:53:52 -06:00
parent e4f414c68d
commit 895913cb36
1 changed files with 27 additions and 1 deletions

View File

@ -534,6 +534,32 @@ copy_to_ram()
fi fi
} }
# load filter
#
filter_load()
{
local FILTER
FILTER=$(cmdline_value load)
if [ "$FILTER" = "" ]; then
cat -
else
cat - | egrep "$FILTER"
fi
}
# noload filter
#
filter_noload()
{
local FILTER
FILTER=$(cmdline_value noload)
if [ "$FILTER" = "" ]; then
cat -
else
cat - | egrep -v "$FILTER"
fi
}
# sort modules by number even if they are in subdirectory # sort modules by number even if they are in subdirectory
# #
sortmod() sortmod()
@ -555,7 +581,7 @@ union_append_bundles()
echo_green_star echo_green_star
echo "Adding bundles to union" echo "Adding bundles to union"
( ls -1 "$1" | sort -n ; cd "$1" ; find modules/ 2>/dev/null | sortmod) | grep '[.]'$BEXT'$' | while read BUNDLE; do ( ls -1 "$1" | sort -n ; cd "$1" ; find modules/ 2>/dev/null | sortmod) | grep '[.]'$BEXT'$' | filter_load | filter_noload | while read BUNDLE; do
echo "* $BUNDLE" echo "* $BUNDLE"
BUN="$(basename "$BUNDLE")" BUN="$(basename "$BUNDLE")"
mkdir -p "$2/$BUN" mkdir -p "$2/$BUN"