summaryrefslogtreecommitdiff
path: root/script/update
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2023-10-20 11:16:25 +0100
committerLeah Rowe <leah@libreboot.org>2023-10-20 11:16:25 +0100
commit54a05fc167904c97a3bcbc2aeb4afdb5ad35a379 (patch)
treef59069999cde8f9579a489d37061f8f511c5f6f7 /script/update
parent52c9416b1971af5f2ce4e97c9a6d1ebdaa43c919 (diff)
always re-generate .git in lbmk
in release archives, .git is excluded but the version and versiondate files are included. from these, the git history is re-created with the exact date (but not taking into account timezone, at present). in this way, lbmk will have git history in a release archive. some build systems, like coreboot, prefer that there be git history available, so this is a nice workaround on those build systems. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'script/update')
-rwxr-xr-xscript/update/release23
1 files changed, 2 insertions, 21 deletions
diff --git a/script/update/release b/script/update/release
index 67ec8bec..1875f160 100755
--- a/script/update/release
+++ b/script/update/release
@@ -8,7 +8,7 @@ set -u -e
. "include/err.sh"
. "include/option.sh"
-eval "$(setvars "" vdir relname src_dirname srcdir _nogit _xm target romdir \
+eval "$(setvars "" vdir relname src_dirname srcdir _xm target romdir \
microcode_required mode)"
main()
@@ -37,29 +37,10 @@ main()
mkvdir()
{
mkdir -p "${vdir}" || err "mkvdir: !mkdir -p \"${vdir}\""
-
- git_init || err "mkvdir: !git_init \"${vdir}\""
git clone . "${srcdir}" || err "mkdir: !gitclone \"${srcdir}\""
- [ -z "${_nogit}" ] || x_ rm -Rf ".git"
-
- rm -Rf "${srcdir}/.git" || err "mkvdir: !rm -Rf ${srcdir}/.git"
insert_version_files "${srcdir}" || err "mkvdir ${srcdir}: versionfile"
}
-# release archives contain .gitignore, but not .git.
-# this script can be run from lbmk.git, or an archive.
-git_init()
-{
- [ -L ".git" ] && err "Reference .git is a symlink"
- [ -e ".git" ] && return 0
- eval "$(setvars "$(date -Rd @${versiondate})" cdate _nogit)"
-
- git init || return 1
- git add -A . || return 1
- git commit -m "${projectname} ${version}" --date "${cdate}" || return 1
- git tag -a "${version}" -m "${projectname} ${version}" || return 1
-}
-
build_release()
{
_xm="build_release ${vdir}"
@@ -94,7 +75,7 @@ fetch_trees()
find . -name ".git" -exec rm -Rf {} + || err "${_xm}: rm .git"
find . -name ".gitmodules" -exec rm -Rf {} + || err "${_xm}: rm .gitmod"
- x_ rm -Rf tmp
+ x_ rm -Rf tmp .git
}
mkrom_images()