'Generic Commit'
This commit is contained in:
parent
401902ee05
commit
b05f1d1ac9
@ -35,53 +35,6 @@ function version() {
|
|||||||
echo "2025.0531.0942"
|
echo "2025.0531.0942"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------
|
|
||||||
# CHECK PACKAGES
|
|
||||||
# ----------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
OS=""
|
|
||||||
|
|
||||||
# Function to check if a package is installed
|
|
||||||
is_package_installed() {
|
|
||||||
if [ "$OS" = "Alpine Linux" ]; then
|
|
||||||
apk info | grep -q "^$1$"
|
|
||||||
else
|
|
||||||
dpkg -l "$1" 2>/dev/null 1>/dev/null
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function check_packages() {
|
|
||||||
if [ -f /etc/os-release ]; then
|
|
||||||
OS=$(source /etc/os-release && echo $NAME)
|
|
||||||
fi
|
|
||||||
|
|
||||||
[ -n "$OS" ] || die "Could not detect distribution (no /etc/os-release file?)"
|
|
||||||
|
|
||||||
# Define packages based on distribution
|
|
||||||
case $OS in
|
|
||||||
"Ubuntu"|"Debian GNU/Linux")
|
|
||||||
# Common packages for both Ubuntu and Debian
|
|
||||||
PACKAGES="build-essential cmake git wget tar curl ninja-build mold nodejs npm perl jq ccache"
|
|
||||||
;;
|
|
||||||
"Alpine Linux")
|
|
||||||
PACKAGES="build-base cmake git wget tar curl ninja mold nodejs npm linux-headers perl jq ccache"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Unsupported distribution: $OS"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "Checking required packages..."
|
|
||||||
for pkg in $PACKAGES; do
|
|
||||||
if ! is_package_installed "$pkg"; then
|
|
||||||
echo "Missing package: $pkg"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "Package $pkg is installed"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
# BUILD
|
# BUILD
|
||||||
@ -271,8 +224,6 @@ function buildspawn() {
|
|||||||
# ----------------------------------------------------------------------------------------------------------
|
# ----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function main() {
|
function main() {
|
||||||
check_packages
|
|
||||||
|
|
||||||
while getopts "rm" opt; do
|
while getopts "rm" opt; do
|
||||||
case $opt in
|
case $opt in
|
||||||
r)
|
r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user