diff options
-rwxr-xr-x | build | 3 | ||||
-rwxr-xr-x | include/git.sh | 2 | ||||
-rwxr-xr-x | include/option.sh | 9 |
3 files changed, 12 insertions, 2 deletions
@@ -157,8 +157,7 @@ fetch_trees() [ ! -f "$x" ] || [ -L "$xp" ] || x_ rm -Rf "src/$xp/$xp" done - find . -name ".git" -exec rm -Rf {} + || $err "$_xm: rm .git" - find . -name ".gitmodules" -exec rm -Rf {} + || $err "$_xm: rm .gitmod" + rmgit . rm -Rf tmp .git src/u-boot/*/test/lib/strlcat.c || $err "$_xm !rm" } diff --git a/include/git.sh b/include/git.sh index 04143540..bc818b19 100755 --- a/include/git.sh +++ b/include/git.sh @@ -111,6 +111,8 @@ git_prep() fi fi + [ "$xbmk_release" = "y" ] && rmgit "$tmpgit" + [ "$_loc" = "${_loc%/*}" ] || x_ mkdir -p "${_loc%/*}" mv "$tmpgit" "$_loc" || $err "git_prep: !mv $tmpgit $_loc" [ -n "$xtree" ] && [ ! -d "src/coreboot/$xtree" ] && \ diff --git a/include/option.sh b/include/option.sh index b2e94a6a..1114611b 100755 --- a/include/option.sh +++ b/include/option.sh @@ -178,3 +178,12 @@ mksha512sum() $err "!sha512sum \"${1}\" > \"${2}\"" ) || $err "failed to create tarball checksum" } + +rmgit() +{ + ( + cd "$1" || $err "!cd gitrepo $1" + find . -name ".git" -exec rm -Rf {} + || $err "!rm .git $1" + find . -name ".gitmodules" -exec rm -Rf {} + || $err "!rm .gitmod $1" + ) || $err "Cannot remove .git/.gitmodules in $1" +} |