修改离线脚本

This commit is contained in:
Tian jianyong 2024-12-19 19:46:15 +08:00
parent cc5488b1d3
commit 4e068dba50

View File

@ -112,13 +112,18 @@ log_info "Downloading system packages and their dependencies..."
# Define base packages
PACKAGES=(
"cmake3.x86_64"
"nlohmann-json-devel.x86_64"
"boost-devel.x86_64"
"openssl-devel.x86_64"
"python3.x86_64"
"python3-pip.x86_64"
"@Development Tools"
"cmake3"
"json-c-devel"
"boost-devel"
"openssl-devel"
"python3"
"python3-pip"
"gcc"
"gcc-c++"
"make"
"autoconf"
"automake"
"libtool"
)
# Create a temporary file for all packages including dependencies
@ -127,16 +132,8 @@ TEMP_PKGS=$(mktemp)
# Get all dependencies
for pkg in "${PACKAGES[@]}"; do
log_info "Checking dependencies for $pkg..."
if [[ "$pkg" == @* ]]; then
# Handle package groups
# Remove '+' prefix and leading/trailing whitespace from package names
yum groupinfo "${pkg#@}" | grep "Mandatory Packages:" -A 100 | \
grep "^[[:space:]]*[^[:space:]]*" | \
sed 's/^[[:space:]]*+*//;s/[[:space:]]*$//' >> "$TEMP_PKGS"
else
echo "$pkg" >> "$TEMP_PKGS"
get_dependencies "$pkg" >> "$TEMP_PKGS"
fi
echo "$pkg" >> "$TEMP_PKGS"
get_dependencies "$pkg" >> "$TEMP_PKGS"
done
# Remove duplicates and sort