summaryrefslogtreecommitdiff
path: root/include/git.sh
diff options
context:
space:
mode:
Diffstat (limited to 'include/git.sh')
-rw-r--r--include/git.sh40
1 files changed, 12 insertions, 28 deletions
diff --git a/include/git.sh b/include/git.sh
index a30d3aa4..4fa904ba 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -15,7 +15,7 @@ fetch_targets()
printf "Creating %s tree %s\n" "$project" "$tree"
git_prep "$loc" "$loc" "$xbmkpwd/$configdir/$tree/patches" \
- "src/$project/$tree" u
+ "src/$project/$tree" with_submodules
nuke "$project/$tree" "$project/$tree"
}
@@ -56,22 +56,22 @@ git_prep()
chkvars rev
tmpclone "$1" "$2" "$tmpgit" "$rev" "$_patchdir"
if singletree "$project" || [ $# -gt 4 ]; then
- prep_submodules "$_loc"
+ [ -f "$mdir/module.list" ] && while read -r msrcdir; do
+ fetch_submodule "$msrcdir"
+ done < "$mdir/module.list"; :
fi
- [ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
- [ "$xtree" != "$tree" ] && link_crossgcc "$_loc"
+ if [ "$project" = "coreboot" ] && [ -n "$xtree" ] && [ $# -gt 2 ] && \
+ [ "$xtree" != "$tree" ]; then (
+ x_ cd "$tmpgit/util" && x_ rm -Rf crossgcc
+ x_ ln -s "../../$xtree/util/crossgcc" crossgcc
+ ) || $err "$_loc: !xgcc link"; fi
+
[ "$_loc" != "$XBMK_CACHE/repo/$project" ] && \
[ "$XBMK_RELEASE" = "y" ] && rmgit "$tmpgit"
- move_repo "$_loc"
-}
-
-prep_submodules()
-{
- [ -f "$mdir/module.list" ] && while read -r msrcdir; do
- fetch_submodule "$msrcdir"
- done < "$mdir/module.list"; :
+ [ "$_loc" = "${_loc%/*}" ] || x_ mkdir -p "${_loc%/*}"
+ mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc"
}
fetch_submodule()
@@ -135,22 +135,6 @@ git_am_patches()
done; :
}
-link_crossgcc()
-{
- (
- x_ cd "$tmpgit/util" && x_ rm -Rf crossgcc
- ln -s "../../$xtree/util/crossgcc" crossgcc || $err "$1: !xgcc link"
- ) || $err "$1: !xgcc link"; :
-}
-
-move_repo()
-{
- [ "$1" = "${1%/*}" ] || x_ mkdir -p "${1%/*}"
- mv "$tmpgit" "$1" || $err "git_prep: !mv $tmpgit $1"
-}
-
-# can delete from multi- and single-tree projects.
-# called from script/trees when downloading sources.
nuke()
{
e "config/${1%/}/nuke.list" f missing || while read -r nukefile; do