summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2024-05-22 18:50:42 +0100
committerLeah Rowe <leah@libreboot.org>2024-05-22 18:50:42 +0100
commit73a2d99102afe63bb0fe26a3d7abfa33bd0fbc01 (patch)
treeef63538e28e6e2ac7edce463cda5c065cb123dfa
parentd774987697824c489ce97e7664e92aeeaffd94be (diff)
git.sh: move xgcc linking to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
-rwxr-xr-xinclude/git.sh20
1 files 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