From 840d6a1d2770e765db63c4e1114f2b8adaa2029e Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 17 May 2025 11:54:14 +0100 Subject: get.sh: FURTHER simplify nuke() this is getting almost comical now Signed-off-by: Leah Rowe --- include/get.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index c6c6b75b..3448a668 100644 --- a/include/get.sh +++ b/include/get.sh @@ -15,7 +15,7 @@ fetch_targets() printf "Creating %s tree %s\n" "$project" "$tree" git_prep "$url" "$bkup_url" "$xbmkpwd/$configdir/$tree/patches" \ "src/$project/$tree" with_submodules - ( fx_ nuke find "$xbmkpwd/config" -type f -name "nuke.list" ) || exit 1 + ( fx_ nuke find config -type f -name "nuke.list" ) || err; : } fetch_project() @@ -31,7 +31,7 @@ fetch_project() x_ ./mk -f $d done clone_project - ( fx_ nuke find "$xbmkpwd/config" -type f -name "nuke.list" ) || exit 1 + ( fx_ nuke find config -type f -name "nuke.list" ) || err; : } clone_project() @@ -170,7 +170,6 @@ tmpclone() nuke() { - rdir="${1#"$xbmkpwd/config/"}" && [ -d "$xbmkpwd/src/${rdir%/*}" ] && \ - x_ cd "$xbmkpwd/src/${rdir%/*}" && \ - dx_ "eval [ -L \"\$fx\" ] || x_ rm -Rf" "$1"; : + r="${1#config/}" && r="$xbmkpwd/src/${r%/*}" && [ -d "$r" ] && x_ cd \ + "$r" && dx_ "eval [ -L \"\$fx\" ] || x_ rm -Rf" "$xbmkpwd/$1"; : } -- cgit v1.2.1 From 05c07f7401bf79e6eeb34e12a19ce6d2cabab2ab Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 17 May 2025 15:20:02 +0100 Subject: get.sh: move nuke() to release.sh we really only need it there, because the context is for release archives. normal use of the git repository doesn't matter in the context of deletions, because that will not be distributed. only the result of ./mk release will be distributed. the builds produced will not change as a result of this, for people using the normal git repository, because the files in question are never used anyway, in our configs. this is being done to make working on local repos easier. Signed-off-by: Leah Rowe --- include/get.sh | 8 -------- 1 file changed, 8 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index 3448a668..244eb1bb 100644 --- a/include/get.sh +++ b/include/get.sh @@ -15,7 +15,6 @@ fetch_targets() printf "Creating %s tree %s\n" "$project" "$tree" git_prep "$url" "$bkup_url" "$xbmkpwd/$configdir/$tree/patches" \ "src/$project/$tree" with_submodules - ( fx_ nuke find config -type f -name "nuke.list" ) || err; : } fetch_project() @@ -31,7 +30,6 @@ fetch_project() x_ ./mk -f $d done clone_project - ( fx_ nuke find config -type f -name "nuke.list" ) || err; : } clone_project() @@ -167,9 +165,3 @@ tmpclone() ( x_ git -C "$2" reset --hard "$3" ) || return 1 ( fx_ "eval x_ git -C \"$2\" am" find "$4" -type f ) || return 1; : } - -nuke() -{ - r="${1#config/}" && r="$xbmkpwd/src/${r%/*}" && [ -d "$r" ] && x_ cd \ - "$r" && dx_ "eval [ -L \"\$fx\" ] || x_ rm -Rf" "$xbmkpwd/$1"; : -} -- cgit v1.2.1 From 01a0217c1e39ef8f665b5499e210fac7d0221416 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 17 May 2025 16:51:12 +0100 Subject: get.sh: simplify bad_checksum() Signed-off-by: Leah Rowe --- include/get.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index 244eb1bb..b83449b7 100644 --- a/include/get.sh +++ b/include/get.sh @@ -148,14 +148,10 @@ try_git() bad_checksum() { - [ ! -f "$2" ] && printf "File '%s' missing (sha512sum '%s')\n" \ - "$2" "$1" 1>&2 && return 0 - fchksum="$(x_ sha512sum "$2" | awk '{print $1}')" || \ - err "Can't get sha512sum on '$2' (checking for sha512sum '$1')" - [ "$fchksum" != "$1" ] || return 1 - printf "WARNING: BAD checksum for '%s' - expected '%s', got '%s'\n" \ - "$2" "$1" "$fchksum" 1>&2 - x_ rm -f "$2" + [ ! -f "$2" ] && printf "'%s' missing, %s\n" "$2" "$1" 1>&2 && return 0 + csum="$(x_ sha512sum "$2" | awk '{print $1}')" || err "!sha512 '$2' $1" + [ "$csum" != "$1" ] && printf "BAD SHA512, '%s'; need '%s', got %s\n" \ + "$2" "$1" "$csum" 1>&2 && x_ rm -f "$2" && return 0; return 1 } tmpclone() -- cgit v1.2.1 From 3c58181f69ee28c954a8844613dee9d4d576ea2c Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Sat, 17 May 2025 16:52:32 +0100 Subject: get.sh: remove useless message the user doesn't care where the temporary git repo is git shows that information anyway, in the git clone command Signed-off-by: Leah Rowe --- include/get.sh | 1 - 1 file changed, 1 deletion(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index b83449b7..667ab398 100644 --- a/include/get.sh +++ b/include/get.sh @@ -156,7 +156,6 @@ bad_checksum() tmpclone() { - printf "Creating git clone '%s' from '%s'\n" "$2" "$1" ( x_ git clone "$1" "$2" ) || return 1 ( x_ git -C "$2" reset --hard "$3" ) || return 1 ( fx_ "eval x_ git -C \"$2\" am" find "$4" -type f ) || return 1; : -- cgit v1.2.1