lib.sh: remove the items() function

it's pretty much just doing the same thing as ls -1

remove it!

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit6-merge1
Leah Rowe 2024-06-14 13:19:25 +01:00
parent baea03c672
commit 98724d701b
5 changed files with 5 additions and 18 deletions

2
build
View File

@ -119,7 +119,7 @@ build_release()
fetch_trees() fetch_trees()
{ {
for x in $(items config/git); do for x in $(ls -1 config/git); do
./update trees -f "$x" || $err "$_xm: fetch $x" ./update trees -f "$x" || $err "$_xm: fetch $x"
singletree "$x" || x_ rm -Rf "src/$x/$x" singletree "$x" || x_ rm -Rf "src/$x/$x"
done done

View File

@ -118,19 +118,6 @@ done
relname="$projectname-$version" relname="$projectname-$version"
export LOCALVERSION="-$projectname-${version%%-*}" export LOCALVERSION="-$projectname-${version%%-*}"
items()
{
rval=1
e "$1" d not && return 1
for x in "$1/"*; do
# -e used because this is for files *or* directories
[ -e "$x" ] || continue
printf "%s\n" "${x##*/}" 2>/dev/null
rval=0
done
return $rval
}
scan_config() scan_config()
{ {
awkstr=" /\{.*$1.*}{/ {flag=1;next} /\}/{flag=0} flag { print }" awkstr=" /\{.*$1.*}{/ {flag=1;next} /\}/{flag=0} flag { print }"

View File

@ -241,7 +241,7 @@ vendor_inject()
set +u +e set +u +e
[ $# -lt 1 ] && $err "No options specified." [ $# -lt 1 ] && $err "No options specified."
[ "$1" = "listboards" ] && eval "items config/coreboot || :; exit 0" [ "$1" = "listboards" ] && eval "ls -1 config/coreboot || :; exit 0"
archive="$1" archive="$1"

View File

@ -36,7 +36,7 @@ main()
elif [ "$1" = "serprog" ]; then elif [ "$1" = "serprog" ]; then
shift 1; handle_serprog $@; return 0 shift 1; handle_serprog $@; return 0
elif [ "$1" = "list" ]; then elif [ "$1" = "list" ]; then
x_ items config/coreboot; return 0 x_ ls -1 config/coreboot; return 0
else else
[ "$1" = "all" ] && shift && continue [ "$1" = "all" ] && shift && continue
boards="$1 $boards" boards="$1 $boards"
@ -44,7 +44,7 @@ main()
fi fi
done done
[ -n "$boards" ] || boards="$(items config/coreboot)" || \ [ -n "$boards" ] || boards="$(ls -1 config/coreboot)" || \
$err "Cannot generate list of boards for building" $err "Cannot generate list of boards for building"
for x in $boards; do for x in $boards; do
[ -d "config/coreboot/$x/config" ] && \ [ -d "config/coreboot/$x/config" ] && \

View File

@ -87,7 +87,7 @@ build_targets()
# Build for all targets if no argument is given # Build for all targets if no argument is given
[ $# -gt 0 ] && target1="$1" [ $# -gt 0 ] && target1="$1"
[ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && shift 1 [ "$target1" = "utils" ] && [ "$project" = "coreboot" ] && shift 1
targets="$(items "$cfgsdir")" || $err "Can't get options for $cfgsdir" targets="$(ls -1 "$cfgsdir")" || $err "Can't get options for $cfgsdir"
[ $# -gt 0 ] && targets=$@ [ $# -gt 0 ] && targets=$@
handle_targets handle_targets