From 4ad04fd1b6c1940fafe5845f173c216813384dd6 Mon Sep 17 00:00:00 2001 From: Lightmann Date: Sun, 14 Jan 2024 10:04:16 -0500 Subject: [PATCH] Fix incorrect naming for main proj (i.e., root build dir) --- bin/dragon | 15 +++++++++------ src/dragon/shscripts/building | 21 +++++++-------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/bin/dragon b/bin/dragon index a37e4b16a..97ffb79bd 100644 --- a/bin/dragon +++ b/bin/dragon @@ -177,9 +177,12 @@ get_subprojs() # Relying on generator to obtain project info # shellcheck disable=SC2207 subsb=($(python3 -c "print('${project_dirs}' if ('${project_dirs}'.count('.')<2) else '${project_names}')")) + proj_names=($(python3 -c "print('${project_names}')")) set +f + index=0 for i in "${subsb[@]}"; do - echo "$i" + echo "$i ${proj_names[$index]}" + ((index++)) done } @@ -189,11 +192,11 @@ get_subprojs() # -------- if [[ $clean -eq 1 ]]; then # clean subproj build dir(s) - get_subprojs | while read -r i; do - clean_dir $i + get_subprojs | while read -r i j; do + clean_dir $i $j done # ensure clean primary build dir - clean_dir . + clean_dir . $(basename $PWD) fi @@ -204,14 +207,14 @@ if [[ $build -eq 1 ]]; then mkdir -p "$DRAGON_DATA_DIR" cp DragonMake "$DRAGON_DATA_DIR/DragonMake" 2> /dev/null - get_subprojs | while read -r i; do + get_subprojs | while read -r i j; do # Copy the DragonMake into the subproject's build directory # Primarily for bundle filter gen, right now. if [[ -d $i ]]; then mkdir -p "$i/$DRAGON_DIR/" cp DragonMake "$i/$DRAGON_DIR/DragonMake" 2> /dev/null fi - build $i + build $i $j done find . -name '.clean' -type f -delete diff --git a/src/dragon/shscripts/building b/src/dragon/shscripts/building index 60896b1cb..c0af05c15 100644 --- a/src/dragon/shscripts/building +++ b/src/dragon/shscripts/building @@ -1,21 +1,13 @@ #!/usr/bin/env bash -get_name() -{ - if [[ $1 == "." ]]; then - i=$(basename $PWD) - else - i=$1 - fi - echo "$i" -} clean_dir() { - DNAME=$(get_name $1) + DNAME=$1 + PROJ=$2 pushd $DNAME &> /dev/null if [[ -d $DRAGON_DIR && ! -f $DRAGON_DIR/.clean ]]; then - prefix_print "Cleaning $DNAME" + prefix_print "Cleaning $PROJ" if [[ -z $DRAGON_DIR ]]; then drexit_reason "nil DRAGON_DIR" fi @@ -52,8 +44,9 @@ build() mkdir -p $DRAGON_DIR/_/.dragonbuilding $DRAGON_DIR/modules - DNAME=$(get_name $1) - prefix_print "Building $DNAME" + DNAME=$1 + PROJ=$2 + prefix_print "Building $PROJ" if ! [[ -e build.ninja ]]; then mv "${i}.ninja" build.ninja @@ -79,7 +72,7 @@ build() # mv build.ninja $DRAGON_DIR/ninja # Was this renamed "ninja" for use elsewhere? mv build.ninja $DRAGON_DIR/build.ninja - if [[ $1 == "." ]]; then + if [[ $DNAME == "." ]]; then true else cp -R $DRAGON_DIR/_ "$DRAGON_DATA_DIR" 2>/dev/null