mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-09 18:49:14 +01:00
Compare commits
2 Commits
fix/alpine
...
fix/frigat
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ae65fccda | ||
|
|
28b95fc394 |
@@ -208,7 +208,7 @@ msg_info "Building OpenVino Model"
|
||||
cd /models
|
||||
wget -q http://download.tensorflow.org/models/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz
|
||||
$STD tar -zxf ssdlite_mobilenet_v2_coco_2018_05_09.tar.gz --no-same-owner
|
||||
if $STD python3 /opt/frigate/docker/main/build_ov_model.py; then
|
||||
if python3 /opt/frigate/docker/main/build_ov_model.py &>/dev/null; then
|
||||
cp /models/ssdlite_mobilenet_v2.xml /openvino-model/
|
||||
cp /models/ssdlite_mobilenet_v2.bin /openvino-model/
|
||||
wget -q https://github.com/openvinotoolkit/open_model_zoo/raw/master/data/dataset_classes/coco_91cl_bkgr.txt -O /openvino-model/coco_91cl_bkgr.txt
|
||||
|
||||
@@ -969,43 +969,13 @@ verify_repo_available() {
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Ensure dependencies are installed (with apt/apk update caching)
|
||||
# Supports both Debian (apt/dpkg) and Alpine (apk) systems
|
||||
# Ensure dependencies are installed (with apt update caching)
|
||||
# ------------------------------------------------------------------------------
|
||||
ensure_dependencies() {
|
||||
local deps=("$@")
|
||||
local missing=()
|
||||
|
||||
# Detect Alpine Linux
|
||||
if [[ -f /etc/alpine-release ]]; then
|
||||
for dep in "${deps[@]}"; do
|
||||
if command -v "$dep" &>/dev/null; then
|
||||
continue
|
||||
fi
|
||||
if apk info -e "$dep" &>/dev/null; then
|
||||
continue
|
||||
fi
|
||||
missing+=("$dep")
|
||||
done
|
||||
|
||||
if [[ ${#missing[@]} -gt 0 ]]; then
|
||||
$STD apk add --no-cache "${missing[@]}" || {
|
||||
local failed=()
|
||||
for pkg in "${missing[@]}"; do
|
||||
if ! $STD apk add --no-cache "$pkg" 2>/dev/null; then
|
||||
failed+=("$pkg")
|
||||
fi
|
||||
done
|
||||
if [[ ${#failed[@]} -gt 0 ]]; then
|
||||
msg_error "Failed to install dependencies: ${failed[*]}"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
|
||||
# Debian/Ubuntu: Fast batch check using dpkg-query
|
||||
# Fast batch check using dpkg-query (much faster than individual checks)
|
||||
local installed_pkgs
|
||||
installed_pkgs=$(dpkg-query -W -f='${Package}\n' 2>/dev/null | sort -u)
|
||||
|
||||
@@ -1102,15 +1072,11 @@ create_temp_dir() {
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
# Check if package is installed (supports both Debian and Alpine)
|
||||
# Check if package is installed (faster than dpkg -l | grep)
|
||||
# ------------------------------------------------------------------------------
|
||||
is_package_installed() {
|
||||
local package="$1"
|
||||
if [[ -f /etc/alpine-release ]]; then
|
||||
apk info -e "$package" &>/dev/null
|
||||
else
|
||||
dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -q "^install ok installed$"
|
||||
fi
|
||||
dpkg-query -W -f='${Status}' "$package" 2>/dev/null | grep -q "^install ok installed$"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user