remove check_project() (always set variables)
in cbmk, we call check_project() to set variables such as projectname, version, version date this is unnecessary, because all main scripts use this functionality anyway do it by default Signed-off-by: Leah Rowe <leah@libreboot.org>audit2-merge1
parent
c8bc797f31
commit
0794127986
6
build
6
build
|
@ -27,7 +27,7 @@ main()
|
||||||
|
|
||||||
[ "$1" = "dependencies" ] && x_ install_packages $@ && cbmk_exit 0
|
[ "$1" = "dependencies" ] && x_ install_packages $@ && cbmk_exit 0
|
||||||
|
|
||||||
for cmd in initcmd check_git check_project git_init excmd; do
|
for cmd in initcmd check_git git_init excmd; do
|
||||||
eval "${cmd} \$@"
|
eval "${cmd} \$@"
|
||||||
done
|
done
|
||||||
cbmk_exit 0
|
cbmk_exit 0
|
||||||
|
@ -37,8 +37,6 @@ initcmd()
|
||||||
{
|
{
|
||||||
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
[ "$(id -u)" != "0" ] || $err "this command as root is not permitted"
|
||||||
|
|
||||||
check_project
|
|
||||||
|
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
help) usage ${0} ;;
|
help) usage ${0} ;;
|
||||||
list) items "script" ;;
|
list) items "script" ;;
|
||||||
|
@ -129,8 +127,6 @@ mkrelease()
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
check_project
|
|
||||||
|
|
||||||
vdir="${vdir}/${version}"
|
vdir="${vdir}/${version}"
|
||||||
[ "${mode}" = "u-boot" ] && relname="u-boot-for-${relname}"
|
[ "${mode}" = "u-boot" ] && relname="u-boot-for-${relname}"
|
||||||
src_dirname="${relname}_src"
|
src_dirname="${relname}_src"
|
||||||
|
|
|
@ -62,6 +62,26 @@ expr "X$threads" : "X-\{0,1\}[0123456789][0123456789]*$" \
|
||||||
1>/dev/null 2>/dev/null || threads=1 # user specified a non-integer
|
1>/dev/null 2>/dev/null || threads=1 # user specified a non-integer
|
||||||
export CBMK_THREADS="$threads"
|
export CBMK_THREADS="$threads"
|
||||||
|
|
||||||
|
x_() {
|
||||||
|
[ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
read -r projectname < projectname || :
|
||||||
|
[ ! -f version ] || read -r version < version || :
|
||||||
|
version_="${version}"
|
||||||
|
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
|
||||||
|
version="git-$(git rev-parse HEAD 2>&1)" || version="${version_}"
|
||||||
|
[ ! -f versiondate ] || read -r versiondate < versiondate || :
|
||||||
|
versiondate_="${versiondate}"
|
||||||
|
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
||||||
|
--pretty='%ct' HEAD)" || versiondate="${versiondate_}"
|
||||||
|
for p in projectname version versiondate; do
|
||||||
|
eval "[ -n \"\$$p\" ] || $err \"$p unset\""
|
||||||
|
eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
|
||||||
|
done
|
||||||
|
relname="${projectname}-${version}"
|
||||||
|
export LOCALVERSION="-${projectname}-${version%%-*}"
|
||||||
|
|
||||||
items()
|
items()
|
||||||
{
|
{
|
||||||
rval=1
|
rval=1
|
||||||
|
@ -124,10 +144,6 @@ remkdir()
|
||||||
mkdir -p "${1}" || $err "remkdir: !mkdir -p \"${1}\""
|
mkdir -p "${1}" || $err "remkdir: !mkdir -p \"${1}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
x_() {
|
|
||||||
[ $# -lt 1 ] || ${@} || $err "Unhandled non-zero exit: $@"; return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
check_git()
|
check_git()
|
||||||
{
|
{
|
||||||
which git 1>/dev/null 2>/dev/null || \
|
which git 1>/dev/null 2>/dev/null || \
|
||||||
|
@ -144,29 +160,6 @@ git_err()
|
||||||
$err "Git name/email not configured"
|
$err "Git name/email not configured"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_project()
|
|
||||||
{
|
|
||||||
read -r projectname < projectname || :
|
|
||||||
|
|
||||||
[ ! -f version ] || read -r version < version || :
|
|
||||||
version_="${version}"
|
|
||||||
[ ! -e ".git" ] || version="$(git describe --tags HEAD 2>&1)" || \
|
|
||||||
version="git-$(git rev-parse HEAD 2>&1)" || version="${version_}"
|
|
||||||
|
|
||||||
[ ! -f versiondate ] || read -r versiondate < versiondate || :
|
|
||||||
versiondate_="${versiondate}"
|
|
||||||
[ ! -e ".git" ] || versiondate="$(git show --no-patch --no-notes \
|
|
||||||
--pretty='%ct' HEAD)" || versiondate="${versiondate_}"
|
|
||||||
|
|
||||||
for p in projectname version versiondate; do
|
|
||||||
eval "[ -n \"\$$p\" ] || $err \"$p unset\""
|
|
||||||
eval "x_ printf \"%s\\n\" \"\$$p\" > $p"
|
|
||||||
done
|
|
||||||
|
|
||||||
relname="${projectname}-${version}"
|
|
||||||
export LOCALVERSION="-${projectname}-${version%%-*}"
|
|
||||||
}
|
|
||||||
|
|
||||||
mktar_release()
|
mktar_release()
|
||||||
{
|
{
|
||||||
printf "%s\n" "${version}" > "${1}/version" || return 1
|
printf "%s\n" "${version}" > "${1}/version" || return 1
|
||||||
|
|
|
@ -31,8 +31,6 @@ eval "$(setvars "" ${v} boards _displaymode _payload _keyboard all targets \
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
check_project
|
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case ${1} in
|
case ${1} in
|
||||||
help)
|
help)
|
||||||
|
|
|
@ -37,7 +37,6 @@ main()
|
||||||
cfgsdir="config/${project}"
|
cfgsdir="config/${project}"
|
||||||
|
|
||||||
remkdir "${tmpgit%/*}"
|
remkdir "${tmpgit%/*}"
|
||||||
check_project
|
|
||||||
|
|
||||||
_cmd="build_projects"
|
_cmd="build_projects"
|
||||||
[ -f "config/${project}/build.list" ] && _cmd="build_targets"
|
[ -f "config/${project}/build.list" ] && _cmd="build_targets"
|
||||||
|
|
Loading…
Reference in New Issue