mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
Meta: Remove unused functions from shell_include.sh
This commit is contained in:
parent
b3a009f521
commit
9356c967d7
Notes:
github-actions[bot]
2024-09-10 05:40:30 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/9356c967d7b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1349
1 changed files with 0 additions and 52 deletions
|
@ -35,41 +35,6 @@ check_program_version_at_least()
|
|||
fi
|
||||
}
|
||||
|
||||
find_executable() {
|
||||
paths=("/usr/sbin" "/sbin")
|
||||
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
if [ -n "${HOMEBREW_PREFIX}" ]; then
|
||||
paths+=("${HOMEBREW_PREFIX}/opt/e2fsprogs/bin" "${HOMEBREW_PREFIX}/opt/e2fsprogs/sbin")
|
||||
elif command -v brew > /dev/null 2>&1; then
|
||||
if prefix=$(brew --prefix e2fsprogs 2>/dev/null); then
|
||||
paths+=("${prefix}/bin" "${prefix}/sbin")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
executable="${1}"
|
||||
|
||||
# Prefer tools from PATH over fallback paths
|
||||
if command -v "${executable}"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
for path in "${paths[@]}"; do
|
||||
if command -v "${path}/${executable}"; then
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
# We return the executable's name back to provide meaningful messages on future failure
|
||||
echo "${executable}"
|
||||
}
|
||||
|
||||
FUSE2FS_PATH="$(find_executable fuse2fs)"
|
||||
RESIZE2FS_PATH="$(find_executable resize2fs)"
|
||||
E2FSCK_PATH="$(find_executable e2fsck)"
|
||||
MKE2FS_PATH="$(find_executable mke2fs)"
|
||||
|
||||
get_number_of_processing_units() {
|
||||
number_of_processing_units="nproc"
|
||||
SYSTEM_NAME="$(uname -s)"
|
||||
|
@ -84,20 +49,3 @@ get_number_of_processing_units() {
|
|||
|
||||
($number_of_processing_units)
|
||||
}
|
||||
|
||||
# We depend on GNU coreutils du for the --apparent-size extension.
|
||||
# GNU coreutils is a build dependency.
|
||||
if command -v gdu > /dev/null 2>&1 && gdu --version | grep -q "GNU coreutils"; then
|
||||
GNUDU="gdu"
|
||||
else
|
||||
GNUDU="du"
|
||||
fi
|
||||
|
||||
disk_usage() {
|
||||
# shellcheck disable=SC2003,SC2307
|
||||
expr "$(${GNUDU} -sbm "$1" | cut -f1)"
|
||||
}
|
||||
|
||||
inode_usage() {
|
||||
find "$1" | wc -l
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue