Files
Tobias Waldekranz 41b96e8a01 utils/ixyang: Simplify linting of infix YANG models
Usage examples:

Run yanglint on all infix models:

    ixyang check

Lint a single model:

    ixyang lint infix-interfaces

Dump a tree of ietf-interfaces with all infix augments:

    ixyang lint infix-interfaces ietf-interfaces -- -f tree
2025-01-10 10:12:22 +01:00

34 lines
613 B
Bash

resolve_o()
{
[ -n "$O" ] && return
if [ -f ".config" ] && [ -d "output" ]; then
# Buildroot
O=$(readlink -f ./output)
elif [ -f "output/.config" ]; then
# BR2_EXTERNAL
O=$(readlink -f ./output)
elif [ -f ".config" ] && [ -d "host" ]; then
# Called from inside output/ directory
O=$(readlink -f .)
else
echo "*** Error: cannot find Buildroot output dir!" >&2
exit 1
fi
}
resolve_host_dir()
{
[ -n "$HOST_DIR" ] && return
resolve_o
if ! [ -d "$O/host" ]; then
echo "*** Error: cannot find Buildroot host binaries dir!" >&2
exit 1
fi
HOST_DIR="$O/host"
}