init.sh: check the lock file BEFORE git init
this way, initialisation will not be performed erroneously while another parent instance of lbmk is running. Signed-off-by: Leah Rowe <leah@libreboot.org>master
parent
fa2c288939
commit
4aba9ef29e
|
@ -31,8 +31,8 @@ xbmk_init()
|
||||||
id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)"
|
id -u 1>/dev/null 2>/dev/null || err "suid check failed (id -u)"
|
||||||
[ "$(id -u)" != "0" ] || err "this command as root is not permitted"
|
[ "$(id -u)" != "0" ] || err "this command as root is not permitted"
|
||||||
|
|
||||||
for init_cmd in set_pyver set_version set_env git_init create_tmpdir \
|
for init_cmd in set_pyver set_version set_env lock git_init \
|
||||||
lock create_pathdirs child_exec; do
|
create_tmpdir create_pathdirs child_exec; do
|
||||||
xbmk_$init_cmd "$@" || break
|
xbmk_$init_cmd "$@" || break
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,12 @@ xbmk_set_env()
|
||||||
xbmktmp="$TMPDIR"
|
xbmktmp="$TMPDIR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xbmk_lock()
|
||||||
|
{
|
||||||
|
[ -f "$xbmklock" ] && err "'$xbmklock' exists. Is a build running?"
|
||||||
|
touch "$xbmklock" || err "cannot create '$xbmklock'"; :
|
||||||
|
}
|
||||||
|
|
||||||
xbmk_git_init()
|
xbmk_git_init()
|
||||||
{
|
{
|
||||||
for gitarg in "--global user.name" "--global user.email"; do
|
for gitarg in "--global user.name" "--global user.email"; do
|
||||||
|
@ -187,12 +193,6 @@ xbmk_create_tmpdir()
|
||||||
remkdir "$xbmktmp" "$xbmklocal"
|
remkdir "$xbmktmp" "$xbmklocal"
|
||||||
}
|
}
|
||||||
|
|
||||||
xbmk_lock()
|
|
||||||
{
|
|
||||||
[ -f "$xbmklock" ] && err "'$xbmklock' exists. Is a build running?"
|
|
||||||
touch "$xbmklock" || err "cannot create '$xbmklock'"; :
|
|
||||||
}
|
|
||||||
|
|
||||||
xbmk_create_pathdirs()
|
xbmk_create_pathdirs()
|
||||||
{
|
{
|
||||||
remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
|
remkdir "$XBMK_CACHE/gnupath" "$XBMK_CACHE/xbmkpath"
|
||||||
|
|
Loading…
Reference in New Issue