summaryrefslogtreecommitdiff
path: root/include/get.sh
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2025-10-04 22:36:11 +0100
committerLeah Rowe <leah@libreboot.org>2025-10-04 22:42:42 +0100
commitc1d6cd22c2390c7317b8996f9b993697491c1eab (patch)
tree120aebfa5328e7699759a087d15a2fd0aeafc3f7 /include/get.sh
parentf358cfaa55219c537de0eb534997be36cba93f14 (diff)
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>
Diffstat (limited to 'include/get.sh')
-rw-r--r--include/get.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/get.sh b/include/get.sh
index 3c30b6d3..0d430abe 100644
--- a/include/get.sh
+++ b/include/get.sh
@@ -81,7 +81,7 @@ git_prep()
fi
if [ "$_loc" != "${_loc%/*}" ]; then
- x_ mkdir -p "${_loc%/*}"
+ x_ xbmkdir "${_loc%/*}"
fi
x_ mv "$tmpgit" "$_loc"
}
@@ -198,7 +198,7 @@ try_fetch_git()
cached="${cached%.git}"
cached="$XBMK_CACHE/$cached"
- x_ mkdir -p "${5%/*}" "${cached%/*}"
+ x_ xbmkdir "${5%/*}" "${cached%/*}"
if ! try_$2 "$cached" "$@"; then
return 1
@@ -221,7 +221,7 @@ try_fetch_file()
cached="file/$6"
cached="$XBMK_CACHE/$cached"
- x_ mkdir -p "${5%/*}" "${cached%/*}"
+ x_ xbmkdir "${5%/*}" "${cached%/*}"
if bad_checksum "$6" "$cached" 2>/dev/null; then
x_ rm -f "$cached"
@@ -284,7 +284,7 @@ try_git()
if [ ! -d "$gitdest" ]; then
( x_ git clone "$2" "$tmpgitcache" ) || return 1
- x_ mkdir -p "${gitdest%/*}"
+ x_ xbmkdir "${gitdest%/*}"
x_ mv "$tmpgitcache" "$gitdest"
fi