Re: libgit2-dev and detection in subsurface/scripts/build.sh
On Wed, 14 Oct 2020, Dirk Hohndel via subsurface wrote: > > I actually think that this isn't a bad idea. Except that it also > should have a clause that allows ldconfig to be found in the PATH, > right? Sure, but are there distributions out there that place ldconfig in the non-root PATH? > Would you mind submitting a PR for that, or would you prefer that I > do this based on your idea? I think it's best you train your shell scripting skills a bit ;) Cheers, -- Cristian ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
Re: libgit2-dev and detection in subsurface/scripts/build.sh
I actually think that this isn't a bad idea. Except that it also should have a clause that allows ldconfig to be found in the PATH, right? Would you mind submitting a PR for that, or would you prefer that I do this based on your idea? Thanks /D > On Oct 11, 2020, at 9:07 AM, Cristian Ionescu-Idbohrn via subsurface > wrote: > > 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? > ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
Re: libgit2-dev and detection in subsurface/scripts/build.sh
On Sun, Oct 11, 2020 at 7:08 PM Cristian Ionescu-Idbohrn via subsurface < subsurface@subsurface-divelog.org> wrote: > 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? > or just add /sbin and /usr/sbin to PATH environment variable? ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
libgit2-dev and detection in subsurface/scripts/build.sh
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 ___ subsurface mailing list subsurface@subsurface-divelog.org http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface