build/roms: create full release tarball name

set relname from option.sh under check_project()

now the release logic simply has to move a directory

Signed-off-by: Leah Rowe <leah@libreboot.org>
audit2-merge1
Leah Rowe 2024-05-15 01:23:22 +01:00 committed by Leah Rowe
parent 90c528032b
commit 21436c6a8f
3 changed files with 8 additions and 14 deletions

13
build
View File

@ -14,8 +14,7 @@ fi
. "include/option.sh"
eval "$(setvars "" script_path aur_notice vdir relname src_dirname srcdir \
_xm target romdir mode)"
eval "$(setvars "" script_path aur_notice vdir src_dirname srcdir _xm mode)"
err="fail"
linkpath="${0}"
@ -133,7 +132,6 @@ mkrelease()
check_project
vdir="${vdir}/${version}"
relname="${projectname}-${version}"
[ "${mode}" = "u-boot" ] && relname="u-boot-for-${relname}"
src_dirname="${relname}_src"
srcdir="${vdir}/${src_dirname}"
@ -209,14 +207,7 @@ mkrom_images()
./build roms all || $err "${_xm}: roms-all"
./build roms serprog rp2040 || $err "${_xm}: rp2040"
./build roms serprog stm32 || $err "${_xm}: stm32"
for rombuild in bin/*.tar.xz; do
[ -f "${rombuild}" ] || continue
tarball="release/$version/roms/${relname}_${rombuild##*/}"
mv "$rombuild" "$tarball" || $err "Cannot create $tarball"
done
mv "release/${version}/roms/" ../roms || $err "${_xm}: copy roms/"
x_ mv bin ../roms
}
mkversion()

View File

@ -34,7 +34,7 @@ setvars()
printf "%s\n" "${_setvars% }"
}
eval "$(setvars "" versiondate tmpdir _nogit version _dest board boarddir \
cbmk_release threads projectname)"
cbmk_release threads projectname relname)"
# if "y": a coreboot target won't be built if target.cfg says release="n"
# (this is used to exclude certain build targets from releases)
@ -162,6 +162,8 @@ check_project()
eval "[ -n \"\$$p\" ] || $err \"$p unset\""
eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
done
relname="${projectname}-${version}"
export LOCALVERSION="-${projectname}-${version%%-*}"
}
@ -171,7 +173,7 @@ mktar_release()
printf "%s\n" "${versiondate}" > "${1}/versiondate" || return 1
printf "%s\n" "${projectname}" > "${1}/projectname" || return 1
mktarball "$1" "${1}.tar.xz"
mktarball "$1" "${1%/*}/${relname}_${1##*/}.tar.xz"
x_ rm -Rf "$1"
}

View File

@ -160,7 +160,8 @@ handle_coreboot_target()
[ -d "bin/${board}" ] || return 0
[ "$cbmk_release" = "y" ] || targets="* bin/${board}\n${targets}"
[ "$cbmk_release" = "y" ] && targets="* bin/$board.tar.xz\n$targets"
[ "$cbmk_release" = "y" ] && \
targets="* bin/${relname}_$board.tar.xz\n$targets"
[ "$cbmk_release" = "y" ] && mktar_release "bin/$board"; return 0
}