libgit2-dev and detection in subsurface/scripts/build.sh

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sun Oct 11 09:07:36 PDT 2020


Debian unstable here.

I did not have libgit2-dev installed and noticed this in build.log:

	./subsurface/scripts/build.sh: line 268: ldconfig: command not found
	realpath: missing operand
	Try 'realpath --help' for more information.

That's because ldconfig is installed in /sbin/ldconfig and a non-root 
user does not normally have access to /sbin.  Thus the detection will 
always fail.  So, some sort of detection would be needed.  Something 
like:

	if [ -x /sbin/ldconfig ]; then
		LDCONFIG=/sbin/ldconfig
	elif [ -x /usr/sbin/ldconfig ]; then
		LDCONFIG=/usr/sbin/ldconfig
	else
		echo "no acces to ldconfig" >&2
		exit 1
	fi

	LIBGIT=$(realpath $($LDCONFIG -p | grep libgit2\\.so\\. |
		cut -d\  -f4) | awk -Fo '{ print $NF }')

maybe?


Cheers,

-- 
Cristian


More information about the subsurface mailing list