Skip to content
Snippets Groups Projects
Commit 0b772d8f authored by Joan Vallvé Navarro's avatar Joan Vallvé Navarro
Browse files

ldconfig with sudo

parent 49f3ba45
No related branches found
No related tags found
No related merge requests found
Pipeline #8658 failed
...@@ -10,6 +10,14 @@ func_make_install () { ...@@ -10,6 +10,14 @@ func_make_install () {
fi fi
} }
func_ldconfig () {
if [ "$UID" -eq 0 -o "$EUID" -eq 0 ]; then
ldconfig
else
sudo ldconfig
fi
}
func_echo () { func_echo () {
if [ $VERBOSE == "true" ]; then if [ $VERBOSE == "true" ]; then
echo "$1" echo "$1"
...@@ -140,6 +148,8 @@ while getopts "vap:d:w:hf:c:" opt; do ...@@ -140,6 +148,8 @@ while getopts "vap:d:w:hf:c:" opt; do
esac esac
done done
# check sudo permissions
func_ldconfig
# UBUNTU # UBUNTU
if [ "$UID" -eq 0 -o "$EUID" -eq 0 ]; then if [ "$UID" -eq 0 -o "$EUID" -eq 0 ]; then
...@@ -354,7 +364,7 @@ if [ $INSTALL_LASER == "y" ]; then ...@@ -354,7 +364,7 @@ if [ $INSTALL_LASER == "y" ]; then
# LASER_SCAN_UTILS # LASER_SCAN_UTILS
func_echo "Installing laser_scan_utils (required)..." func_echo "Installing laser_scan_utils (required)..."
cd $DEPS_PATH cd $DEPS_PATH
ldconfig func_ldconfig
git clone https://gitlab.iri.upc.edu/labrobotica/algorithms/laser_scan_utils.git git clone https://gitlab.iri.upc.edu/labrobotica/algorithms/laser_scan_utils.git
cd laser_scan_utils cd laser_scan_utils
mkdir -p build && cd build mkdir -p build && cd build
...@@ -366,7 +376,7 @@ if [ $INSTALL_LASER == "y" ]; then ...@@ -366,7 +376,7 @@ if [ $INSTALL_LASER == "y" ]; then
# PLUGIN # PLUGIN
func_echo "Cloning plugin laser..." func_echo "Cloning plugin laser..."
cd $WOLF_PATH cd $WOLF_PATH
ldconfig func_ldconfig
git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/laser.git git clone -b master https://gitlab.iri.upc.edu/mobile_robotics/wolf_projects/wolf_lib/plugins/laser.git
cd laser cd laser
...@@ -379,7 +389,7 @@ if [ $INSTALL_LASER == "y" ]; then ...@@ -379,7 +389,7 @@ if [ $INSTALL_LASER == "y" ]; then
func_make_install func_make_install
func_echo "Testing plugin laser..." func_echo "Testing plugin laser..."
ldconfig func_ldconfig
ctest -j$CORES ctest -j$CORES
else else
func_echo "Skipping plugin laser." func_echo "Skipping plugin laser."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment