mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
update with script detection patch included
This commit is contained in:
parent
6f2189e413
commit
e1b7fcde3e
1 changed files with 7 additions and 4 deletions
|
@ -717,11 +717,11 @@ add_binary() {
|
|||
# detect if the file has a shebang
|
||||
if IFS='' LC_ALL=C read -rn2 -d '' shebang < "$binary" && [[ "$shebang" == '#!' ]]; then
|
||||
read -r shebang < "$binary"
|
||||
interpreter="${shebang##\#\!}"
|
||||
interpreter="${shebang##\#\!*([[:space:]])}"
|
||||
# strip /usr/bin/env and warn if it is missing
|
||||
if [[ "$interpreter" == '/usr/bin/env'* ]]; then
|
||||
[[ -e "${BUILDROOT}/usr/bin/env" ]] || warning "Possibly missing '/usr/bin/env' for script: %s" "$binary"
|
||||
interpreter="${interpreter##'/usr/bin/env'[[:space:]]}"
|
||||
interpreter="${interpreter##'/usr/bin/env'+([[:space:]])}"
|
||||
fi
|
||||
# strip parameters
|
||||
interpreter="${interpreter%%[[:space:]]*}"
|
||||
|
@ -730,8 +730,11 @@ add_binary() {
|
|||
interpreter="$(PATH="${BUILDROOT}/usr/local/sbin:${BUILDROOT}/usr/local/bin:${BUILDROOT}/usr/bin" type -P "$interpreter")"
|
||||
fi
|
||||
|
||||
# check if the interpreter exists in BUILDROOT
|
||||
if [[ ! -e "${BUILDROOT}/${interpreter}" ]]; then
|
||||
if [[ "$interpreter" != '/'* ]] && PATH="${BUILDROOT}/usr/local/sbin:${BUILDROOT}/usr/local/bin:${BUILDROOT}/usr/bin" type -P "$interpreter" &>/dev/null; then
|
||||
:
|
||||
elif [[ -e "${BUILDROOT}/${interpreter}" ]]; then
|
||||
:
|
||||
else
|
||||
warning "Possibly missing '%s' for script: %s" "$interpreter" "$binary"
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue