Skip to content

Commit

Permalink
fix(lib_install): Disable file system translation in checkinstall d…
Browse files Browse the repository at this point in the history
…uring dependency installation.
  • Loading branch information
junhaoliao committed Dec 24, 2024
1 parent 329edf6 commit 7564ff5
Show file tree
Hide file tree
Showing 8 changed files with 120 additions and 38 deletions.
21 changes: 16 additions & 5 deletions components/core/tools/scripts/lib_install/fmtlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get number of cpu cores
Expand Down Expand Up @@ -74,11 +74,22 @@ checkinstall_installed=$?
set -e

# Install
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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} make install
install_cmd_args+=(
make install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir
21 changes: 16 additions & 5 deletions components/core/tools/scripts/lib_install/libarchive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get number of cpu cores
Expand Down Expand Up @@ -74,11 +74,22 @@ checkinstall_installed=$?
set -e

# Install
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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} make install
install_cmd_args+=(
make install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir
21 changes: 16 additions & 5 deletions components/core/tools/scripts/lib_install/lz4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get number of cpu cores
Expand Down Expand Up @@ -71,11 +71,22 @@ checkinstall_installed=$?
set -e

# Install
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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} make install
install_cmd_args+=(
make install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir
24 changes: 19 additions & 5 deletions components/core/tools/scripts/lib_install/mariadb-connector-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get OS version
Expand Down Expand Up @@ -77,11 +78,24 @@ set -e
install_dir=/usr/local
${privileged_command_prefix} 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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} rsync -a . ${install_dir}/
install_cmd_args+=(
rsync
-a .
"${install_dir}/"
)
"${install_cmd_args[@]}"

# Update ld cache
${privileged_command_prefix} ldconfig ${install_dir}/lib/mariadb
Expand Down
5 changes: 3 additions & 2 deletions components/core/tools/scripts/lib_install/mongocxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,12 @@ set -e
if [ $checkinstall_installed -eq 0 ] ; then
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--nodoc
-y
--pakdir "${deb_output_dir}"
)
fi
Expand Down
23 changes: 18 additions & 5 deletions components/core/tools/scripts/lib_install/msgpack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Download
Expand All @@ -66,11 +66,24 @@ checkinstall_installed=$?
set -e

# Install
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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} cmake --build . --target install
install_cmd_args+=(
cmake
--build .
--target install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir
22 changes: 16 additions & 6 deletions components/core/tools/scripts/lib_install/spdlog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get number of cpu cores
Expand Down Expand Up @@ -81,12 +81,22 @@ checkinstall_installed=$?
set -e

# Install
install_command_prefix="${privileged_command_prefix}"
if [ $checkinstall_installed -eq 0 ] ; then
# NOTE: We use "1:${version}" to override the version installed by Ubuntu 18.04
install_command_prefix="${install_command_prefix} checkinstall --pkgname '${package_name}' --pkgversion '1:${version}' --provides '${package_name}' --nodoc -y --pakdir \"${deb_output_dir}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} make install
install_cmd_args+=(
make install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir
21 changes: 16 additions & 5 deletions components/core/tools/scripts/lib_install/zstandard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ if [ $installed -eq 0 ] ; then
fi

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

# Get number of cpu cores
Expand Down Expand Up @@ -74,11 +74,22 @@ checkinstall_installed=$?
set -e

# Install
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}\""
install_cmd_args+=(
checkinstall
--default
--fstrans=no
--nodoc
--pkgname "${package_name}"
--pkgversion "${version}"
--provides "${package_name}"
--pakdir "${deb_output_dir}"
)
fi
${install_command_prefix} make install
install_cmd_args+=(
make install
)
"${install_cmd_args[@]}"

# Clean up
rm -rf $temp_dir

0 comments on commit 7564ff5

Please sign in to comment.