Skip to content

Commit

Permalink
Fix install script permission
Browse files Browse the repository at this point in the history
  • Loading branch information
sitaowang1998 committed Oct 29, 2024
1 parent 215efaf commit f699c9e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
9 changes: 6 additions & 3 deletions dep-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ version: "3"

vars:
G_LIB_INSTALL_DIR: "{{.ROOT_DIR}}/tools/scripts/lib_install/"
FMTLIB_VERSION: "11.0.2"
SPDLOG_VERSION: "1.14.1"
MARIADB_CONNECTOR_C_VERSION: "3.4.1"

tasks:

Expand All @@ -14,21 +17,21 @@ tasks:
platforms: ["linux"]
dir: "{{.G_LIB_INSTALL_DIR}}"
cmds:
- "./fmtlib.sh 11.0.2"
- "./fmtlib.sh {{.FMTLIB_VERSION}}"

spdlog:
internal: true
platforms: ["linux"]
dir: "{{.G_LIB_INSTALL_DIR}}"
cmds:
- "./spdlog.sh 1.14.1"
- "./spdlog.sh {{.SPDLOG_VERSION}}"

mariadb-connector-c:
internal: true
platforms: ["linux"]
dir: "{{.G_LIB_INSTALL_DIR}}"
cmds:
- "./mariadb-connector-c.sh 3.4.1"
- "./mariadb-connector-c.sh {{.MARIADB_CONNECTOR_C_VERSION}}"

submodules:
internal: true
Expand Down
Empty file modified tools/scripts/lib_install/fmtlib.sh
100644 → 100755
Empty file.
13 changes: 3 additions & 10 deletions tools/scripts/lib_install/mariadb-connector-c.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ if [ $installed -eq 0 ] ; then
exit
fi

echo "Checking for elevated privileges..."
privileged_command_prefix=""
if [ ${EUID:-$(id -u)} -ne 0 ] ; then
sudo echo "Script can elevate privileges."
privileged_command_prefix="${privileged_command_prefix} sudo"
fi

# Get OS version
source /etc/os-release
if [ $ID = "ubuntu" ] ; then
Expand Down Expand Up @@ -75,16 +68,16 @@ set -e

# Install
install_dir=/usr/local
${privileged_command_prefix} mkdir -p ${install_dir}
mkdir -p ${install_dir}

install_command_prefix="${privileged_command_prefix}"
if [ $checkinstall_installed -eq 0 ] ; then
install_command_prefix="${install_command_prefix} checkinstall --pkgname '${package_name}' --pkgversion '${version}' --provides '${package_name}' --nodoc -y --pakdir \"${deb_output_dir}\""
fi
${install_command_prefix} rsync -a . ${install_dir}/
rsync -a . ${install_dir}/

# Update ld cache
${privileged_command_prefix} ldconfig ${install_dir}/lib/mariadb
ldconfig ${install_dir}/lib/mariadb

# Clean up
rm -rf $temp_dir
Empty file modified tools/scripts/lib_install/spdlog.sh
100644 → 100755
Empty file.

0 comments on commit f699c9e

Please sign in to comment.