summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/git.sh2
-rwxr-xr-xinclude/option.sh9
2 files changed, 11 insertions, 0 deletions
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"
+}