xbmk: don't call mkdir. use xbmkdir (new function)

xbmkdir checks if a directory exists, before running
mkdir, and then still uses -p

i was testing xbmk on arch linux today, and noticed
that it errored out when a directory already exists.

i'm mitigating against buggy or differently behaving
mkdir implementations this way, by wrapping around
it.

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2025-10-04 22:36:11 +01:00
parent f358cfaa55
commit c1d6cd22c2
8 changed files with 33 additions and 21 deletions
+3 -3
View File
@@ -432,7 +432,7 @@ project_up_to_date()
shift 3
x_ mkdir -p "$XBMK_CACHE/$hashdir"
x_ xbmkdir "$XBMK_CACHE/$hashdir"
if [ -f "$XBMK_CACHE/$hashdir/$project$hashname" ]; then
read -r old_hash < "$XBMK_CACHE/$hashdir/$project$hashname" \
@@ -485,7 +485,7 @@ check_cross_compiler()
xgccargs="crossgcc-$xfix UPDATED_SUBMODULES=1 CPUS=$XBMK_THREADS"
x_ ./mk -f coreboot "${cbdir#src/coreboot/}"
x_ mkdir -p "elf/coreboot/$tree" # TODO: is this needed?
x_ xbmkdir "elf/coreboot/$tree" # TODO: is this needed?
export PATH="$xbmkpwd/$cbdir/util/crossgcc/xgcc/bin:$PATH"
export CROSS_COMPILE="${xarch% *}-"
@@ -748,7 +748,7 @@ check_makefile()
copy_elf()
{
if [ -f "$listfile" ]; then
x_ mkdir -p "$dest_dir"
x_ xbmkdir "$dest_dir"
fi
if [ -f "$listfile" ]; then