feat(PROJ-67): Manticore-Upgrade-Pfad für Bestandsinstallationen
install.sh/update.sh übersprangen den Manticore-Block komplett, sobald irgendeine Version schon lief — der Versions-Pin aus dem letzten Fix wirkte dadurch nie auf existierende Installationen (nur Neuinstallationen). Jetzt per dpkg --compare-versions: ist die installierte Version älter als _MANTICORE_VERSION, wird der Dienst gestoppt, das neue Paket eingespielt und neu gestartet. Downgrade-Schutz durch "lt"-Vergleich. Spec PROJ-67 dokumentiert die Recherche zum Versionssprung 25.0.0 -> 27.1.5 (u.a. offene Frage zur neuen v27-Auth-Funktionalität) und den geplanten Produktiv-Test auf 131.
This commit is contained in:
+23
-10
@@ -432,21 +432,34 @@ install_native() {
|
||||
# dynamisch "latest" ermitteln (vorhersagbar, kein Parsing-Risiko) — zum
|
||||
# Aktualisieren: https://repo.manticoresearch.com/repository/manticoresearch_bookworm/dists/bookworm/main/binary-amd64/Packages
|
||||
_MANTICORE_VERSION="27.1.5-26061911-5a1cf9399"
|
||||
info "Installiere Manticore Search ${_MANTICORE_VERSION}..."
|
||||
if ! command -v searchd >/dev/null 2>&1 && ! systemctl is-active --quiet manticore 2>/dev/null; then
|
||||
_mc_arch="$(dpkg --print-architecture)"
|
||||
_mc_installed_version="$(dpkg-query -W -f='${Version}' manticore 2>/dev/null || true)"
|
||||
_mc_fetch_and_install() {
|
||||
local _mc_arch="$(dpkg --print-architecture)"
|
||||
wget -q -O /tmp/manticore.deb \
|
||||
"https://repo.manticoresearch.com/repository/manticoresearch_bookworm/dists/bookworm/main/binary-${_mc_arch}/manticore_${_MANTICORE_VERSION}_${_mc_arch}.deb" \
|
||||
|| true
|
||||
if [[ -f /tmp/manticore.deb ]]; then
|
||||
dpkg -i /tmp/manticore.deb 2>/dev/null || apt-get install -f -y -qq 2>/dev/null || true
|
||||
rm -f /tmp/manticore.deb
|
||||
log "Manticore Search installiert"
|
||||
else
|
||||
die "Manticore Search konnte nicht installiert werden — siehe: https://manticoresearch.com/install/"
|
||||
if [[ ! -f /tmp/manticore.deb ]]; then
|
||||
return 1
|
||||
fi
|
||||
dpkg -i /tmp/manticore.deb 2>/dev/null || apt-get install -f -y -qq 2>/dev/null || true
|
||||
rm -f /tmp/manticore.deb
|
||||
return 0
|
||||
}
|
||||
if [[ -z "$_mc_installed_version" ]]; then
|
||||
info "Installiere Manticore Search ${_MANTICORE_VERSION}..."
|
||||
_mc_fetch_and_install && log "Manticore Search installiert" \
|
||||
|| die "Manticore Search konnte nicht installiert werden — siehe: https://manticoresearch.com/install/"
|
||||
elif dpkg --compare-versions "$_mc_installed_version" lt "$_MANTICORE_VERSION"; then
|
||||
# PROJ-67: Upgrade statt Skip, damit auch Bestandsinstallationen beim
|
||||
# nächsten install.sh-/update.sh-Lauf mitgezogen werden. "lt"-Vergleich
|
||||
# schützt gegen versehentliches Downgrade.
|
||||
info "Manticore Search ${_mc_installed_version} gefunden, aktualisiere auf ${_MANTICORE_VERSION}..."
|
||||
systemctl stop manticore 2>/dev/null || true
|
||||
_mc_fetch_and_install \
|
||||
&& log "Manticore Search aktualisiert: ${_mc_installed_version} → ${_MANTICORE_VERSION}" \
|
||||
|| warn "Upgrade fehlgeschlagen — vorherige Version bleibt installiert"
|
||||
else
|
||||
log "Manticore Search bereits installiert"
|
||||
log "Manticore Search ${_mc_installed_version} bereits aktuell (>= ${_MANTICORE_VERSION})"
|
||||
fi
|
||||
systemctl enable --now manticore 2>/dev/null || warn "Manticore-Dienst konnte nicht gestartet werden"
|
||||
systemctl is-active --quiet manticore && log "Manticore Search läuft"
|
||||
|
||||
Reference in New Issue
Block a user