git.sh: *never* run git submodule update
only use config/submodules/ which the build system then uses to run git clones manually, replicating the submodules feature. we must never use a project's own gitmodules feature, because we can't easily control it. better to let it break first, and then figure out what modules to add manually, so that we have only what we need for each project. it's done this way, because git's own submodules feature doesn't have very good error checking in general, nor does it have good redundancy. with the current design, we can declare backup repositories for each submodule. we replicate it precisely. for example: 3rdparty/vboot this is a coreboot submodule, and we handle that in the coreboot trees. however, our current design also allows you to do this even if the upstream repository does not contain a .gitmodules file Signed-off-by: Leah Rowe <leah@libreboot.org>20240612_branch
parent
137321ebc0
commit
9c1ea8f93a
|
@ -109,9 +109,6 @@ prep_submodules()
|
||||||
if [ -f "$mdir/module.list" ]; then
|
if [ -f "$mdir/module.list" ]; then
|
||||||
cat "$mdir/module.list" > "$tmpdir/modules" || \
|
cat "$mdir/module.list" > "$tmpdir/modules" || \
|
||||||
$err "!cp $mdir/module.list $tmpdir/modules"
|
$err "!cp $mdir/module.list $tmpdir/modules"
|
||||||
elif [ -f "$tmpgit/.gitmodules" ]; then
|
|
||||||
git -C "$tmpgit" submodule status | awk '{print $2}' > \
|
|
||||||
"$tmpdir/modules" || $err "$mdir: cannot list submodules"
|
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
@ -141,9 +138,6 @@ fetch_submodule()
|
||||||
[ -d "$tmpgit/$1" ] && break
|
[ -d "$tmpgit/$1" ] && break
|
||||||
done
|
done
|
||||||
[ -d "$tmpgit/$1" ] || $err "!clone $mod $project $mcfgdir $1"
|
[ -d "$tmpgit/$1" ] || $err "!clone $mod $project $mcfgdir $1"
|
||||||
else
|
|
||||||
git -C "$tmpgit" submodule update --init --checkout -- "$1" \
|
|
||||||
|| $err "$mdir: !update $1"
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue