From ffe387ac6b98d99f82660410f23bb931e04beed8 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:35:38 +0100 Subject: get.sh: remove superfluous command in try_git() A git-pull is performed immediately after git-fetch. Git-pull already performs git-fetch as a prerequisite. 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 3d06eb4a..4105b93f 100644 --- a/include/get.sh +++ b/include/get.sh @@ -149,7 +149,6 @@ try_git() ( 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 afc36754b13de41bfbea5ebf5202bdb01cb4aeeb Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:44:57 +0100 Subject: get.sh: remove redundant printf in fetch_project The following execution will result in another printf that says exactly what is being downloaded. There is no need to inform the user twice about what is being downloaded. 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 4105b93f..639d101d 100644 --- a/include/get.sh +++ b/include/get.sh @@ -26,7 +26,6 @@ fetch_project() [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree" [ -z "$depend" ] || for d in $depend ; do - printf "'%s' needs '%s'; grabbing '%s'\n" "$project" "$d" "$d" x_ ./mk -f $d done clone_project -- cgit v1.2.1 From e981132c829dea9dd958ea174e35e15e122451d7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:50:06 +0100 Subject: get.sh: consolidate printf statements stick it in git_prep, which both single- and multi-tree projects will use, when downloading git repositories. Signed-off-by: Leah Rowe --- include/get.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index 639d101d..a60e8c36 100644 --- a/include/get.sh +++ b/include/get.sh @@ -11,8 +11,6 @@ tmpgitcache="$XBMK_CACHE/tmpgit" fetch_targets() { e "src/$project/$tree" d && return 0 - - printf "Creating %s tree %s\n" "$project" "$tree" git_prep "$url" "$bkup_url" "$xbmkpwd/$configdir/$tree/patches" \ "src/$project/$tree" with_submodules } @@ -35,7 +33,6 @@ clone_project() { loc="$XBMK_CACHE/clone/$project" && singletree "$project" && \ loc="src/$project" - printf "Downloading project '%s' to '%s'\n" "$project" "$loc" e "$loc" d missing && remkdir "${tmpgit%/*}" && git_prep \ "$url" "$bkup_url" "$xbmkpwd/config/$project/patches" "$loc"; : @@ -43,6 +40,8 @@ clone_project() git_prep() { + printf "Creating code directory, src/%s/%s\n" "$project" "$tree" + _patchdir="$3" _loc="$4" # $1 and $2 are gitrepo and gitrepo_backup -- cgit v1.2.1 From 18dacd4c22b1dfe6ab985d76712dd8261f173ce4 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 00:57:50 +0100 Subject: xbmk: rename xbmklocal/xbmktmp variables shorten them Signed-off-by: Leah Rowe --- include/get.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index a60e8c36..ebaaaff1 100644 --- a/include/get.sh +++ b/include/get.sh @@ -5,7 +5,7 @@ eval "`setvars "" loc url bkup_url subcurl subhash subgit subgit_bkup \ depend subcurl_bkup repofail`" -tmpgit="$xbmklocal/gitclone" +tmpgit="$xbloc/gitclone" tmpgitcache="$XBMK_CACHE/tmpgit" fetch_targets() -- cgit v1.2.1 From 09b6e91803d4112ae22d31313a5fdbe8afe79707 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 01:30:33 +0100 Subject: general cleanup in get.sh and vendor.sh Signed-off-by: Leah Rowe --- include/get.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index ebaaaff1..00768f0b 100644 --- a/include/get.sh +++ b/include/get.sh @@ -46,7 +46,7 @@ git_prep() _loc="$4" # $1 and $2 are gitrepo and gitrepo_backup chkvars rev - xbmkget git "$1" "$2" "$tmpgit" "$rev" "$_patchdir" + xbget git "$1" "$2" "$tmpgit" "$rev" "$_patchdir" if singletree "$project" || [ $# -gt 4 ]; then dx_ fetch_submodule "$mdir/module.list" fi @@ -71,19 +71,19 @@ fetch_submodule() chkvars "sub${st}" "sub${st}_bkup" "subhash" [ "$st" = "git" ] && x_ rm -Rf "$tmpgit/$1" - eval xbmkget "$st" "\$sub$st" "\$sub${st}_bkup" "$tmpgit/$1" \ + eval xbget "$st" "\$sub$st" "\$sub${st}_bkup" "$tmpgit/$1" \ "$subhash" "$mdir/${1##*/}/patches" } -xbmkget() +xbget() { [ "$1" = "curl" ] || [ "$1" = "copy" ] || [ "$1" = "git" ] || \ - err "Bad dlop (arg 1): xbmkget $*" + err "Bad dlop (arg 1): xbget $*" echk="f" && [ "$1" = "git" ] && echk="d" for url in "$2" "$3"; do - [ -n "$url" ] || err "empty URL given in: xbmkget $*" + [ -n "$url" ] || err "empty URL given in: xbget $*" try_file "$url" "$@" || continue eval "[ -$echk \"$4\" ] || continue" return 0 # successful download/copy -- cgit v1.2.1 From 671e3aa27b402f04543cf016565421021d97c27d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 13:11:20 +0100 Subject: get.sh: simplify fetch_targets() Signed-off-by: Leah Rowe --- include/get.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index 00768f0b..d32452ff 100644 --- a/include/get.sh +++ b/include/get.sh @@ -10,9 +10,8 @@ tmpgitcache="$XBMK_CACHE/tmpgit" fetch_targets() { - e "src/$project/$tree" d && return 0 - git_prep "$url" "$bkup_url" "$xbmkpwd/$configdir/$tree/patches" \ - "src/$project/$tree" with_submodules + [ -d "src/$project/$tree" ] || git_prep "$url" "$bkup_url" \ + "$xbmkpwd/$configdir/$tree/patches" "src/$project/$tree" submod; : } fetch_project() -- cgit v1.2.1 From 495098d6a71bc3a67a80d39a5d4fdf2d2207c782 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 13:19:06 +0100 Subject: get.sh: tidy up bad_checksum() Signed-off-by: Leah Rowe --- include/get.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index d32452ff..6aed0a8d 100644 --- a/include/get.sh +++ b/include/get.sh @@ -151,10 +151,10 @@ try_git() bad_checksum() { - [ ! -f "$2" ] && printf "'%s' missing, %s\n" "$2" "$1" 1>&2 && return 0 + e "$2" f missing && 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 + [ "$csum" = "$1" ] && return 1; x_ rm -f "$2" + printf "BAD SHA512 %s, '%s'; need '%s'\n" "$csum" "$2" "$1" 1>&2 } tmpclone() -- cgit v1.2.1 From b5867be214d3f899ae1777bfe1d0b2c1d69ba6cd Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 13:23:06 +0100 Subject: get.sh: simplify try_copy() Signed-off-by: Leah Rowe --- include/get.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index 6aed0a8d..b842d768 100644 --- a/include/get.sh +++ b/include/get.sh @@ -128,8 +128,7 @@ try_curl() try_copy() { - [ -L "$2" ] && printf "symlink %s (trycp %s)\n" "$2" "$*" && return 1 - [ ! -f "$2" ] && printf "%s missing (trycp %s)\n" "$2" "$*" && return 1 + e "$2" f missing && return 1; : ( x_ cp "$2" "$1" ) || return 1; : } -- cgit v1.2.1 From 41308ee924445cad61e599aebf15557a0351522b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 26 May 2025 13:26:34 +0100 Subject: get.sh: simplify fetch_project() Signed-off-by: Leah Rowe --- include/get.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/get.sh') diff --git a/include/get.sh b/include/get.sh index b842d768..a3328454 100644 --- a/include/get.sh +++ b/include/get.sh @@ -19,9 +19,7 @@ fetch_project() eval "`setvars "" xtree`" eval "`setcfg "config/git/$project/pkg.cfg"`" - chkvars url bkup_url - - [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree" + chkvars url bkup_url && [ -n "$xtree" ] && x_ ./mk -f coreboot "$xtree" [ -z "$depend" ] || for d in $depend ; do x_ ./mk -f $d done -- cgit v1.2.1