mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
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:
+19
-7
@@ -8,12 +8,6 @@
|
||||
cbfstool="elf/coreboot/default/cbfstool"
|
||||
rmodtool="elf/coreboot/default/rmodtool"
|
||||
|
||||
remkdir()
|
||||
{
|
||||
x_ rm -Rf "$@"
|
||||
x_ mkdir -p "$@"
|
||||
}
|
||||
|
||||
mkrom_tarball()
|
||||
{
|
||||
update_xbmkver "$1"
|
||||
@@ -58,7 +52,7 @@ mktarball()
|
||||
printf "Creating tar archive '%s' from directory '%s'\n" "$2" "$1"
|
||||
|
||||
if [ "${2%/*}" != "$2" ]; then
|
||||
x_ mkdir -p "${2%/*}"
|
||||
x_ xbmkdir "${2%/*}"
|
||||
fi
|
||||
|
||||
x_ tar -c "$1" | xz -T$XBMK_THREADS -9e > "$2" || \
|
||||
@@ -169,6 +163,24 @@ build_sbase()
|
||||
fi
|
||||
}
|
||||
|
||||
remkdir()
|
||||
{
|
||||
x_ rm -Rf "$@"
|
||||
x_ xbmkdir "$@"
|
||||
}
|
||||
|
||||
xbmkdir()
|
||||
{
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
if [ ! -d "$1" ]; then
|
||||
x_ mkdir -p "$1"
|
||||
fi
|
||||
|
||||
shift 1
|
||||
done
|
||||
}
|
||||
|
||||
fx_()
|
||||
{
|
||||
xchk fx_ "$@"
|
||||
|
||||
Reference in New Issue
Block a user