From 4d3b16da38cf7806ebc247ce9c15f11b91ebcf19 Mon Sep 17 00:00:00 2001 From: Riku Viitanen Date: Fri, 8 Sep 2023 00:25:52 +0300 Subject: [PATCH] Cleaner parent directory creation My previous patch b0rked memtest and others because when making sure their parent directory (the project root) exists, it would instead create the project directory (memtest86lus). The later move would then put the git repo inside that (memtest86plus/memtest86plus_123456). We just need to make sure we don't create the target directory itself. This way, there's no need to hardcode any project names. Tested by ./updating rpi-pico-serprog, memtest86plus, grub and seabios. Signed-off-by: Riku Viitanen --- script/update/project/repo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/update/project/repo b/script/update/project/repo index 24bd14ce..a5e8ef62 100755 --- a/script/update/project/repo +++ b/script/update/project/repo @@ -85,8 +85,8 @@ clone_project() [ ! -d "${location}" ] || \ rm -Rf "${location}" || \ fail "clone_project: Can't remove directory '${location}'" - [ "${name}" != "rpi-pico-serprog" ] || mkdir -p ${location%/*} || \ - fail "clone_project: cannot make directory for rpi-pico-serprog" + [ "${location}" = "${location%/*}" ] || mkdir -p ${location%/*} || \ + fail "clone_project: cannot make directory for ${name}" mv "${tmp_dir}" "${location}" || \ fail "clone_project: could not copy temp file to destination" }