From 73a2d99102afe63bb0fe26a3d7abfa33bd0fbc01 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 22 May 2024 18:50:42 +0100 Subject: git.sh: move xgcc linking to a new function Signed-off-by: Leah Rowe --- include/git.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/include/git.sh b/include/git.sh index cd4d788f..3b3aeb32 100755 --- a/include/git.sh +++ b/include/git.sh @@ -94,15 +94,8 @@ git_prep() prep_submodules "$_loc" fi - if [ "$project" = "coreboot" ] && [ -n "$xtree" ] && \ - [ "$xtree" != "$tree" ] && [ $# -gt 2 ]; then - ( - cd "$tmpgit/util" || $err "prep $1: !cd $tmpgit/util" - rm -Rf crossgcc || $err "prep $1: !rm xgcc" - ln -s "../../$xtree/util/crossgcc" crossgcc || \ - $err "prep $1: can't create xgcc symlink" - ) || $err "prep $1: can't create xgcc symlink" - fi + [ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \ + [ "$xtree" != "$tree" ] && link_crossgcc "$_loc" [ "$xbmk_release" = "y" ] && [ "$_loc" != "src/$project/$project" ] \ && rmgit "$tmpgit" @@ -129,6 +122,15 @@ prep_submodules() done < "$tmpdir/modules" } +link_crossgcc() +{ + ( + cd "$tmpgit/util" || $err "prep $1: !cd $tmpgit/util" + rm -Rf crossgcc || $err "prep $1: !rm xgcc" + ln -s "../../$xtree/util/crossgcc" crossgcc || $err "$1: !xgcc link" + ) || $err "$1: !xgcc link" +} + git_am_patches() { for _patch in "$2/"*; do -- cgit v1.2.1