Skip to content
This repository was archived by the owner on Apr 11, 2018. It is now read-only.

Commit 6c8159b

Browse files
committed
Improve libgit2 detection and correction
1 parent 78520ef commit 6c8159b

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

src/postinstall.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
#!/bin/bash
22

3-
LIBPATH="/usr/lib"
4-
if [ -d "/usr/lib/x86_64-linux-gnu" ]
5-
then
6-
LIBPATH="/usr/lib/x86_64-linux-gnu"
7-
fi
8-
9-
LIBGIT2="$(ls -x $LIBPATH | grep -m 1 libgit2.so)"
3+
LIBGIT2="$(ldconfig -p | grep -m 1 libgit2.so | sed 's/.\+=> //')"
104

115
# Check installation priviledge
126
if [ "$(id -u)" != "0" ]; then
@@ -15,7 +9,7 @@ if [ "$(id -u)" != "0" ]; then
159
fi
1610

1711
# Check for libgit2
18-
if [ -z "$LIBGIT2" ]
12+
if [ ! -f "$LIBGIT2" ]
1913
then
2014
echo "libgit2 not found, please install it and re run the installer."
2115
exit 1
@@ -32,8 +26,7 @@ echo "Copying MonoDevelop binaries..."
3226
cp -rf MonoDevelop/ /opt/MonoDevelop/
3327

3428
echo "Adding libgit2-e8b8948.so symlink to fix VersionControl Addin..."
35-
rm -f "$LIBPATH/libgit2-e8b8948.so"
36-
ln -s "$LIBPATH/$LIBGIT2" "$LIBPATH/libgit2-e8b8948.so"
29+
ln -s "$LIBGIT2" "/opt/MonoDevelop/AddIns/VersionControl/libgit2-e8b8948.so"
3730

3831
echo "Adding terminal commands..."
3932
cp monodevelop-stable /usr/bin/monodevelop-stable

0 commit comments

Comments
 (0)