Skip to content

Commit 65109b1

Browse files
committed
create-deb-deploy: general script
1 parent 42ab889 commit 65109b1

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

scripts/create-deb-deploy.sh

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,28 @@ rm -f \
8787
"${ART_DIR}/pkg_files_framework.txt" \
8888
"${BUILD_LOG}"
8989

90-
for required_dir in dls2 robotlib gluecode; do
90+
readarray -t required_dirs < <(
91+
awk '
92+
match($0, /^[[:space:]]*add_subdirectory[[:space:]]*\(([[:space:]]*"[^"]+"|[[:space:]]*[^#)[:space:]]+)/) {
93+
dir = substr($0, RSTART, RLENGTH)
94+
sub(/^[[:space:]]*add_subdirectory[[:space:]]*\(/, "", dir)
95+
sub(/^[[:space:]]+/, "", dir)
96+
sub(/^"/, "", dir)
97+
sub(/"$/, "", dir)
98+
sub(/[[:space:]].*$/, "", dir)
99+
if (dir !~ /^\$/ && dir !~ /^\// && dir !~ /\.\./) {
100+
print dir
101+
}
102+
}
103+
' "${ROOT_DIR}/CMakeLists.txt" | sort -u
104+
)
105+
106+
if [[ ${#required_dirs[@]} -eq 0 ]]; then
107+
echo "ERROR: could not infer required source directories from ${ROOT_DIR}/CMakeLists.txt."
108+
exit 1
109+
fi
110+
111+
for required_dir in "${required_dirs[@]}"; do
91112
if [[ ! -f "${ROOT_DIR}/${required_dir}/CMakeLists.txt" ]]; then
92113
echo "ERROR: missing ${required_dir}/CMakeLists.txt under ${ROOT_DIR}."
93114
echo "Hint: submodules are not checked out on this runner."

0 commit comments

Comments
 (0)