Commit e790c9c9 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Handle 'not found' from ldd

When a required library can't be found by ldd the script reports it and
exits with 1.

Fixes #2
parent e590dad9
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -39,6 +39,12 @@ Environment:
  STAGE:  An alternate way of providing --stage
"

fatal() {
	[[ ${code:=$?} -gt 0 ]] || code=1
	echo >&2 "Fatal: $*"
	exit $code
}

missing() {
	[[ $? -eq 127 ]] || return 0
	opt_builtin() {
@@ -75,12 +81,13 @@ copy_elf() {
	ldd "$bin" | while read dep; do
		local dep=${dep% (*}
		case $dep in
			*'not found'*) fatal "missing dependency $dep" ;;
			*'=>'*) dep=${dep#*=> } ;;
			/*) ;;
			*) continue ;;
		esac
		copy "$dep"
	done || true
	done
	copy_file "$bin"
}