git.sh: simplify prep_submodules()

copying the module list into tmpdir/ no longer makes sense,
because it was only done before when we supported either
running the list from "git submodule update", or module.list.

since we only support handling of module.list, we can
greatly simplify this function.

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-06-07 16:21:43 +01:00
parent acd3608bb1
commit 7e15859be6
1 changed files with 3 additions and 6 deletions

View File

@ -106,13 +106,9 @@ prep_submodules()
mdir="$PWD/config/submodule/$project" mdir="$PWD/config/submodule/$project"
[ -n "$tree" ] && mdir="$mdir/$tree" [ -n "$tree" ] && mdir="$mdir/$tree"
[ -f "$mdir/module.list" ] || return 0 [ -f "$mdir/module.list" ] && while read -r msrcdir; do
cat "$mdir/module.list" > "$tmpdir/modules" || \
$err "!cp $mdir/module.list $tmpdir/modules"
while read -r msrcdir; do
fetch_submodule "$msrcdir" fetch_submodule "$msrcdir"
done < "$tmpdir/modules" done < "$mdir/module.list"; return 0
} }
fetch_submodule() fetch_submodule()
@ -128,6 +124,7 @@ fetch_submodule()
done done
rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'" rm -Rf "$tmpgit/$1" || $err "!rm '$mdir' '$1'"
tmpclone "$subrepo" "$subrepo_bkup" "$tmpdir/$1" "$subrev" \ tmpclone "$subrepo" "$subrepo_bkup" "$tmpdir/$1" "$subrev" \
"$mdir/${1##*/}/patches" "$mdir/${1##*/}/patches"
} }