From 769a97aed5a712c80141fee8da60868c437fbf36 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 18:50:06 +0100 Subject: init.sh: Hardcode XBMK_CACHE for integrity I never really intended for this to be configurable, but the cache directory is also used during release builds. There's too much that can go wrong, letting the user decide where their cache is. Simplify it by hardcoding. Signed-off-by: Leah Rowe --- include/init.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'include') diff --git a/include/init.sh b/include/init.sh index ee19c398..cd4acf43 100644 --- a/include/init.sh +++ b/include/init.sh @@ -89,15 +89,9 @@ xbmk_set_env() export TMPDIR="$(mktemp -d -t xbmk_XXXXXXXX)" xbmktmp="$TMPDIR" - # XBMK_CACHE is a directory, for caching downloads and git repon - [ -z "${XBMK_CACHE+x}" ] && export XBMK_CACHE="$xbmkpwd/cache" - [ -z "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" + export XBMK_CACHE="$xbmkpwd/cache" [ -L "$XBMK_CACHE" ] && [ "$XBMK_CACHE" = "$xbmkpwd/cache" ] && \ err "cachedir '$xbmkpwd/cache' is a symlink" - [ -L "$XBMK_CACHE" ] && export XBMK_CACHE="$xbmkpwd/cache" - xbmkcache="`findpath "$XBMK_CACHE"`" || \ - err "Can't resolve cachedir: '$XBMK_CACHE'" - export XBMK_CACHE="$xbmkcache" [ ! -e "$XBMK_CACHE" ] || \ [ -d "$XBMK_CACHE" ] || err "cachedir '$XBMK_CACHE' is a file"; : -- cgit v1.2.1 From b25a4876434d371dc4278d71365574158c77d47d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 18:53:22 +0100 Subject: init.sh: looser XBMK_THREADS validation on child processes, we can simply correct it. we currently provide an error message, but this is silly. Signed-off-by: Leah Rowe --- include/init.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/init.sh b/include/init.sh index cd4acf43..38eb1c81 100644 --- a/include/init.sh +++ b/include/init.sh @@ -30,7 +30,7 @@ xbmk_init() id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)" [ "$(id -u)" != "0" ] || err "this command as root is not permitted" - for init_cmd in get_version set_env git_init child_exec; do + for init_cmd in get_version set_env set_threads git_init child_exec; do xbmk_$init_cmd "$@" || break done } @@ -76,7 +76,7 @@ xbmk_set_env() if [ "$is_child" = "y" ]; then [ -z "${XBMK_CACHE+x}" ] && err "XBMK_CACHE unset on child" - [ -z "${XBMK_THREADS+x}" ] && err "XBMK_THREADS unset on child" + [ -z "${XBMK_THREADS+x}" ] && xbmk_set_threads e "lock" f missing && err "lock file absent on child" return 1 fi @@ -104,10 +104,6 @@ xbmk_set_env() [ "$XBMK_RELEASE" = "Y" ] && export XBMK_RELEASE="y" [ "$XBMK_RELEASE" = "y" ] || export XBMK_RELEASE="n" - [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 - expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ - 1>/dev/null 2>/dev/null || export XBMK_THREADS=1 - xbmk_set_version export LOCALVERSION="-$projectname-${version%%-*}" @@ -117,6 +113,13 @@ xbmk_set_env() xbmk_set_pyver } +xbmk_set_threads() +{ + [ -z "${XBMK_THREADS+x}" ] && export XBMK_THREADS=1 + expr "X$XBMK_THREADS" : "X-\{0,1\}[0123456789][0123456789]*$" \ + 1>/dev/null 2>/dev/null || export XBMK_THREADS=1 +} + xbmk_set_version() { version_="$version" -- cgit v1.2.1 From d9c64b267540a7c0a62f219c1c27c790234fd11c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:24:43 +0100 Subject: xbmk: stricter handling of files on while loops i overlooked these! Signed-off-by: Leah Rowe --- include/lib.sh | 4 ++-- include/tree.sh | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/lib.sh b/include/lib.sh index 6c831795..025db88a 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -106,9 +106,9 @@ fx_() dx_() { - [ -f "$2" ] && while read -r fx; do + [ ! -f "$2" ] || while read -r fx; do $1 "$fx" || return 1 - done < "$2"; : + done < "$2" || err "dx_ $*: cannot read '$2'"; : } x_() diff --git a/include/tree.sh b/include/tree.sh index 25d4732c..9dccf857 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -332,8 +332,9 @@ check_makefile() copy_elf() { - [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" && while read -r f; do + [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" + [ ! -f "$listfile" ] || while read -r f; do [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From 8aaf404ddea8a8d6c21f0a1f83f1675a8b0895aa Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:29:59 +0100 Subject: lib.sh: Use while, not for, to process arguments This is more reliable against globbing, in context of for. Signed-off-by: Leah Rowe --- include/lib.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/lib.sh b/include/lib.sh index 025db88a..184d0491 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -53,8 +53,10 @@ setvars() fi val="$1" shift 1 - for var in "$@"; do - _setvars="$var=\"$val\"; $_setvars" + while true; do + [ $# -lt 1 ] && break + _setvars="$1=\"$val\"; $_setvars" + shift 1 done printf "%s\n" "${_setvars% }" } @@ -69,9 +71,11 @@ setcfg() chkvars() { - for var in "$@"; do - eval "[ -n \"\${$var+x}\" ] || err \"$var unset\"" - eval "[ -n \"\$$var\" ] || err \"$var unset\"" + while true; do + [ $# -lt 1 ] && break + eval "[ -n \"\${$1+x}\" ] || err \"$1 unset\"" + eval "[ -n \"\$$1\" ] || err \"$1 unset\"" + shift 1 done; : } -- cgit v1.2.1 From 900da04efa929a9373d5a6f3f56f8b8ac8f193df Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 19:57:06 +0100 Subject: tree.sh: fix up copy_elf(), bad for loop Because of how sh works, having just the [] line causes sh to exit, annoyingly without an error message, but it does cause a non-zero exit. This bug will have already been triggering, before I added the recent error handling on files for this for loop. also do it to the other loop in lib.sh Signed-off-by: Leah Rowe --- include/lib.sh | 2 +- include/tree.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/lib.sh b/include/lib.sh index 184d0491..7c4d71ea 100644 --- a/include/lib.sh +++ b/include/lib.sh @@ -111,7 +111,7 @@ fx_() dx_() { [ ! -f "$2" ] || while read -r fx; do - $1 "$fx" || return 1 + $1 "$fx" || return 1; : done < "$2" || err "dx_ $*: cannot read '$2'"; : } diff --git a/include/tree.sh b/include/tree.sh index 9dccf857..8d787d4c 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -334,7 +334,7 @@ copy_elf() { [ -f "$listfile" ] && x_ mkdir -p "$dest_dir" [ ! -f "$listfile" ] || while read -r f; do - [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir" - done < "$listfile" || err "copy_elf $*: cannot read '$listfile'" + [ -f "$srcdir/$f" ] && x_ cp "$srcdir/$f" "$dest_dir"; : + done < "$listfile" || err "copy_elf $*: cannot read '$listfile'"; : x_ make clean -C "$srcdir" $cleanargs } -- cgit v1.2.1 From 620c1dd6fae0f0f83212e9f6b6fb27c1faf67b83 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 22:59:20 +0100 Subject: get.sh: Make xbmkget err on exiting the loop check The idea in this function is that if a file or repo is successfully handled, a return will be performed from the loop. If the loop exits for any reason, an error is thrown. The current code is probably fine, but I can forsee future modifications possibly causing bugs here. Make it unambiguous, by always throwing an error if execution reaches the end of the function. Signed-off-by: Leah Rowe --- include/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index 667ab398..ab6ff401 100644 --- a/include/get.sh +++ b/include/get.sh @@ -87,7 +87,8 @@ xbmkget() for url in "$2" "$3"; do [ -n "$url" ] && try_file "$url" "$@" && \ eval "[ -$echk \"$4\" ] && return 0" - done && err "$1 $2 $3 $4: not downloaded"; : + done + err "$1 $2 $3 $4: not downloaded"; : } try_file() -- cgit v1.2.1 From cdc0fb49e1c47a013ea99117acbf62e96ec5c652 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:07:01 +0100 Subject: get.sh: make xbmkget() easier to understand the intent once again is that this for loop shall return, with zero status, if success is observed. otherwise, the loop breaks and an error is thrown. Signed-off-by: Leah Rowe --- include/get.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index ab6ff401..89859454 100644 --- a/include/get.sh +++ b/include/get.sh @@ -85,8 +85,10 @@ xbmkget() echk="f" && [ "$1" = "git" ] && echk="d" for url in "$2" "$3"; do - [ -n "$url" ] && try_file "$url" "$@" && \ - eval "[ -$echk \"$4\" ] && return 0" + [ -n "$url" ] || continue + try_file "$url" "$@" || continue + eval "[ -$echk \"$4\" ] || continue" + return 0 # successful download/copy done err "$1 $2 $3 $4: not downloaded"; : } -- cgit v1.2.1 From f15bb8153a3f2fce6e0aea28ce029c889a2e7c76 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:09:37 +0100 Subject: get.sh: stricter URL check in xbmkget() don't skip if the URL is empty. throw an error instead. i decree that all links must be properly initialised, because that is the design of lbmk. where only one link is provided, such as in a local copy operation, the second would succeed no better than the first so two identical paths are given. Signed-off-by: Leah Rowe --- include/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index 89859454..8280d96b 100644 --- a/include/get.sh +++ b/include/get.sh @@ -85,7 +85,7 @@ xbmkget() echk="f" && [ "$1" = "git" ] && echk="d" for url in "$2" "$3"; do - [ -n "$url" ] || continue + [ -n "$url" ] || err "empty URL given in: xbmkget $*" try_file "$url" "$@" || continue eval "[ -$echk \"$4\" ] || continue" return 0 # successful download/copy -- cgit v1.2.1 From 903f78bf080ee8ad9176022005b81a3d3ac530b3 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 19 May 2025 23:13:29 +0100 Subject: get.sh: add missing check in fetch_project() we check the main url, but not backup urls. this patch fixes that oversight. Signed-off-by: Leah Rowe --- include/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index 8280d96b..ae2c5a35 100644 --- a/include/get.sh +++ b/include/get.sh @@ -22,7 +22,7 @@ fetch_project() eval "`setvars "" xtree`" eval "`setcfg "config/git/$project/pkg.cfg"`" - chkvars url + chkvars url bkup_url [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree" [ -z "$depend" ] || for d in $depend ; do -- cgit v1.2.1 From fb7aaa78bb080a473bdf0edf449bf08045e8366c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 20 May 2025 02:58:33 +0100 Subject: vendor.sh: optimise find_me() i'm adding characters to 7ztest, which isn't being passed on through because everything runs in subshells; the next pass would default back to the original string, so a given file may be checked multiple times. fix this by mitigation; use the random string from mktemp as a suffix instead. in practice, this has not affected performance much, but it will nevertheless avoid unnecessary work by xbmk. Signed-off-by: Leah Rowe --- include/init.sh | 2 +- include/vendor.sh | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/init.sh b/include/init.sh index 38eb1c81..39d48948 100644 --- a/include/init.sh +++ b/include/init.sh @@ -181,7 +181,7 @@ pybin() [ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \ [ -x "$pypath/$1" ] && printf "%s/%s\n" "$pypath" "$1" && \ - return 0 + return 0; : done && return 1 # Defer to normal command -v if not a venv diff --git a/include/vendor.sh b/include/vendor.sh index 2732eade..88c3fa04 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -38,7 +38,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url_bkup SCH5545EC_DL_hash _dest mecleaner \ kbc1126_ec_dump MRC_refcode_cbtree _dl SCH5545EC_DL_url EC_url rom DL_url \ - nuke cbfstoolref FSPFD_hash _7ztest ME11bootguard ME11delta xromsize \ + nuke cbfstoolref FSPFD_hash ME11bootguard ME11delta xromsize \ ME11version ME11sku ME11pch _me _metmp mfs TBFW_url_bkup TBFW_url cbdir \ TBFW_hash TBFW_size hashfile EC_url_bkup FSPM_bin_hash FSPS_bin_hash \ EC_FW1_hash EC_FW2_hash ME_bin_hash MRC_bin_hash REF_bin_hash _dl_bin \ @@ -156,7 +156,6 @@ extract_intel_me() { e "$mecleaner" f not && err "$cbdir: me_cleaner missing" - _7ztest="$xbmklocal/metmp/a" _metmp="$xbmklocal/me.bin" x_ rm -f "$_metmp" "$xbmklocal/a" @@ -165,7 +164,7 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard set +u +e - x_ rm -Rf "$xbmkpwd/metmp" + x_ rm -Rf "$xbmklocal/metmp" ( fx_ find_me x_ find "$xbmkpwd/$appdir" -type f ) || : [ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_pre_dest" && return 0 @@ -182,14 +181,19 @@ find_me() [ -f "$_metmp" ] && exit 1 [ -L "$1" ] && return 0 - _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" + _7x="`mktemp`" || err "find_me: can't make tmp file" + x_ rm -f "$_7x" + _7x="$xbmklocal/metmp/${_7x##*/}" + + _r="-r" + [ -n "$mfs" ] && _r="" "$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ - -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 + -O "$_metmp" "$1" || extract_archive "$1" "$_7x" || return 0 [ -f "$_metmp" ] && exit 1 - ( fx_ find_me x_ find "$_7ztest" -type f ) || exit 1; : + ( fx_ find_me x_ find "$_7x" -type f ) || exit 1; : } extract_archive() -- cgit v1.2.1 From f6b77822835fcd775a845c825a4e6a78abaa742a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 20 May 2025 20:14:09 +0100 Subject: Revert "vendor.sh: optimise find_me()" This reverts commit fb7aaa78bb080a473bdf0edf449bf08045e8366c. it caused a few issues. will re-do later the old code isn't really broken, just inefficient, because several files are scanned twice, but in practise the overhead isn't that great The error occurs sometimes, when bruteforcing me.bin: ERROR ./mk: Unhandled error for: mv /home/user/lbmk/tmp/me.bin /home/user/lbmk/cache/tmpdl/check This revert should fix the issue, for now. --- include/init.sh | 2 +- include/vendor.sh | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) (limited to 'include') diff --git a/include/init.sh b/include/init.sh index 39d48948..38eb1c81 100644 --- a/include/init.sh +++ b/include/init.sh @@ -181,7 +181,7 @@ pybin() [ $venv -gt 0 ] && for pypath in "/usr/local/bin" "/usr/bin"; do [ -e "$pypath/$1" ] && [ ! -d "$pypath/$1" ] && \ [ -x "$pypath/$1" ] && printf "%s/%s\n" "$pypath" "$1" && \ - return 0; : + return 0 done && return 1 # Defer to normal command -v if not a venv diff --git a/include/vendor.sh b/include/vendor.sh index 88c3fa04..2732eade 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -38,7 +38,7 @@ eval "`setvars "" has_hashes EC_hash DL_hash DL_url_bkup MRC_refcode_gbe vcfg \ E6400_VGA_DL_hash E6400_VGA_DL_url E6400_VGA_DL_url_bkup E6400_VGA_offset \ E6400_VGA_romname SCH5545EC_DL_url_bkup SCH5545EC_DL_hash _dest mecleaner \ kbc1126_ec_dump MRC_refcode_cbtree _dl SCH5545EC_DL_url EC_url rom DL_url \ - nuke cbfstoolref FSPFD_hash ME11bootguard ME11delta xromsize \ + nuke cbfstoolref FSPFD_hash _7ztest ME11bootguard ME11delta xromsize \ ME11version ME11sku ME11pch _me _metmp mfs TBFW_url_bkup TBFW_url cbdir \ TBFW_hash TBFW_size hashfile EC_url_bkup FSPM_bin_hash FSPS_bin_hash \ EC_FW1_hash EC_FW2_hash ME_bin_hash MRC_bin_hash REF_bin_hash _dl_bin \ @@ -156,6 +156,7 @@ extract_intel_me() { e "$mecleaner" f not && err "$cbdir: me_cleaner missing" + _7ztest="$xbmklocal/metmp/a" _metmp="$xbmklocal/me.bin" x_ rm -f "$_metmp" "$xbmklocal/a" @@ -164,7 +165,7 @@ extract_intel_me() [ "$ME11bootguard" = "y" ] && x_ ./mk -f deguard set +u +e - x_ rm -Rf "$xbmklocal/metmp" + x_ rm -Rf "$xbmkpwd/metmp" ( fx_ find_me x_ find "$xbmkpwd/$appdir" -type f ) || : [ "$ME11bootguard" != "y" ] && x_ mv "$_metmp" "$_pre_dest" && return 0 @@ -181,19 +182,14 @@ find_me() [ -f "$_metmp" ] && exit 1 [ -L "$1" ] && return 0 - _7x="`mktemp`" || err "find_me: can't make tmp file" - x_ rm -f "$_7x" - _7x="$xbmklocal/metmp/${_7x##*/}" - - _r="-r" - [ -n "$mfs" ] && _r="" + _7ztest="${_7ztest}a" && _r="-r" && [ -n "$mfs" ] && _r="" "$mecleaner" $mfs $_r -t -O "$xbmklocal/a" -M "$_metmp" "$1" || \ "$mecleaner" $mfs $_r -t -O "$_metmp" "$1" || "$me7updateparser" \ - -O "$_metmp" "$1" || extract_archive "$1" "$_7x" || return 0 + -O "$_metmp" "$1" || extract_archive "$1" "$_7ztest" || return 0 [ -f "$_metmp" ] && exit 1 - ( fx_ find_me x_ find "$_7x" -type f ) || exit 1; : + ( fx_ find_me x_ find "$_7ztest" -type f ) || exit 1; : } extract_archive() -- cgit v1.2.1 From a3250d144744e77b6a0d0f7cf011ecc6800edaaf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 01:17:27 +0100 Subject: tree.sh: Don't run make-clean on dry runs Otherwise, ./mk -d (without arguments) fails for GRUB, which first requires running autoconf to get a Makefile. Signed-off-by: Leah Rowe --- include/tree.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/tree.sh b/include/tree.sh index 8d787d4c..83887864 100644 --- a/include/tree.sh +++ b/include/tree.sh @@ -275,7 +275,8 @@ elfcheck() handle_makefile() { - $dry check_makefile "$srcdir" && x_ make -C "$srcdir" $cleanargs clean + $dry check_makefile "$srcdir" && \ + $dry x_ make -C "$srcdir" $cleanargs clean [ -f "$defconfig" ] && x_ cp "$defconfig" "$srcdir/.config" [ -n "$mode" ] || [ -n "$btype" ] || $dry make -C \ -- cgit v1.2.1 From 8e0c6059d155052c30a2b765b91c580e93ebdb7f Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 01:47:02 +0100 Subject: rom.sh: skip copyps1bios on dry builds otherwise, ./mk -d (without arguments) will fail. Signed-off-by: Leah Rowe --- include/rom.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/rom.sh b/include/rom.sh index 65900a01..1c39979d 100644 --- a/include/rom.sh +++ b/include/rom.sh @@ -20,6 +20,8 @@ buildser() copyps1bios() { + [ "$dry" = ":" ] && return 0; : + remkdir "bin/playstation" x_ cp src/pcsx-redux/src/mips/openbios/openbios.bin bin/playstation -- cgit v1.2.1 From f9266601b8c73daf36518c71db5e5c36080f3ddf Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 11:27:22 +0100 Subject: vendor.sh: add colon at the end of a for loop Signed-off-by: Leah Rowe --- include/vendor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/vendor.sh b/include/vendor.sh index 2732eade..99fc7467 100644 --- a/include/vendor.sh +++ b/include/vendor.sh @@ -107,7 +107,7 @@ fetch() [ "$dl_type" = "fsp" ] && for _cdl in dl dl_bkup; do eval "$_cdl=\"\${$_cdl##*../}\"; _cdp=\"\$$_cdl\"" [ -f "$_cdp" ] || _cdp="$cbdir/$_cdp" - [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\"" + [ -f "$_cdp" ] && eval "$_cdl=\"$_cdp\""; : done; : # download the file (from the internet) to extract from -- cgit v1.2.1 From 231b320e63bb452208b3d01e5df6844ead4b76db Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 11:51:31 +0100 Subject: release.sh: copy version files to rsrc Otherwise, an "unknown" version number is created. This regression was caused by the recent optimisation that reduces the amount of extra work done by init.sh on child instances of xbmk. As a result of those changes, now release.sh has to do some minor initialisation of its own, such as this. Signed-off-by: Leah Rowe --- include/release.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/release.sh b/include/release.sh index 5d6da466..f23ed541 100644 --- a/include/release.sh +++ b/include/release.sh @@ -27,6 +27,8 @@ release() remkdir "$vdir" x_ git clone . "$rsrc" + x_ cp ".version" "$rsrc/.version" + x_ cp ".versiondate" "$rsrc/.versiondate" prep_release src prep_release tarball -- cgit v1.2.1 From 419733d3073cbfc9f8f67e835b385b2b41e6f045 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 12:22:07 +0100 Subject: get.sh: re-generate remotes every time that way, when a remote changes in config/, it will be updated automatically, without user intervention. Signed-off-by: Leah Rowe --- include/get.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index ae2c5a35..08a561d9 100644 --- a/include/get.sh +++ b/include/get.sh @@ -143,8 +143,10 @@ try_git() [ -d "$gitdest" ] || x_ mkdir -p "${gitdest%/*}" [ -d "$gitdest" ] || x_ mv "$tmpgitcache" "$gitdest" - ( x_ git -C "$gitdest" remote add main "$4" 2>/dev/null ) || : - ( x_ git -C "$gitdest" remote add backup "$5" 2>/dev/null ) || : + ( x_ git -C "$gitdest" remote remove main ) || : + ( x_ git -C "$gitdest" remote remove backup ) || : + x_ git -C "$gitdest" remote add main "$4" + x_ git -C "$gitdest" remote add backup "$5" ( x_ git -C "$gitdest" fetch --all ) || : ( x_ git -C "$gitdest" pull --all ) || :; : } -- cgit v1.2.1 From 0216a3104a50ebf01405f6e04e44d0349567b85e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 22 May 2025 12:43:34 +0100 Subject: get.sh: Always update git remotes Right now, if cache/clone/PROJECT/ already exists, the logic for pulling new changes doesn't execute, and neither does the logic for updating remotes. This is bad when updating revisions, because then manual updating is required, defeating the purpose of xbmk's own automation in this regard. Fix it by only checking the cached download on files, not Git repositories; the try_git function itself will already perform this check, before updating remotes and pulling in new commits from upstream. The updating only happens when a given target directory doesn't exist, e.g. src/flashprog/ or src/grub/default/, so this won't slow down release builds for example. Signed-off-by: Leah Rowe --- include/get.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/get.sh b/include/get.sh index 08a561d9..6f1b5f1d 100644 --- a/include/get.sh +++ b/include/get.sh @@ -104,7 +104,8 @@ try_file() echk="d" && [ "$2" != "git" ] && echk="f" && \ bad_checksum "$6" "$cached" 2>/dev/null && x_ rm -f "$cached" - eval "[ -$echk \"$cached\" ] || try_$2 \"\$cached\" \"\$@\" || return 1" + evalchk="[ -$echk \"$cached\" ] || " && [ "$2" = "git" ] && evalchk="" + eval "${evalchk}try_$2 \"\$cached\" \"\$@\" || return 1" [ "$2" != "git" ] && [ -f "$5" ] && \ bad_checksum "$6" "$5" 2>/dev/null && x_ cp "$cached" "$5" eval "[ -$echk \"$cached\" ] || return 1" -- cgit v1.2.1