fix(shim-version-parse): anchor awk regex on literal version key (H2)
This commit is contained in:
@@ -5,7 +5,7 @@ description: |
|
||||
Variation between instances is expressed via values.yaml only.
|
||||
No chart variants. No string-templating in Tower.
|
||||
type: application
|
||||
version: 0.1.5
|
||||
version: 0.1.6
|
||||
appVersion: "1.0"
|
||||
keywords:
|
||||
- odoo
|
||||
|
||||
@@ -298,7 +298,17 @@ spec:
|
||||
fi
|
||||
# Manifest version is the source of truth — on bump, run -u
|
||||
# so Odoo re-reads assets and regenerates affected bundles.
|
||||
SHIM_MANIFEST_VER=$(awk -F"'" '/version/{print $4; exit}' /mnt/extra-addons/odoosky_hoot_dom_shim/__manifest__.py)
|
||||
# H2: anchor on the literal `'version':` key (with optional
|
||||
# leading whitespace) so we don't accidentally match other
|
||||
# lines containing the substring "version" (e.g. a future
|
||||
# 'description' or 'summary' that mentions "versioning").
|
||||
# Falls back to the python parser if awk produces empty —
|
||||
# that path also catches the case where the manifest has
|
||||
# been switched to double-quoted values.
|
||||
SHIM_MANIFEST_VER=$(awk -F"'" '/^[[:space:]]*.version.:/{print $4; exit}' /mnt/extra-addons/odoosky_hoot_dom_shim/__manifest__.py)
|
||||
if [ -z "$SHIM_MANIFEST_VER" ]; then
|
||||
SHIM_MANIFEST_VER=$(python3 -c "import ast,sys; print(ast.literal_eval(open(sys.argv[1]).read()).get('version',''))" /mnt/extra-addons/odoosky_hoot_dom_shim/__manifest__.py 2>/dev/null || echo "")
|
||||
fi
|
||||
if [ -z "$SHIM_INSTALLED_VER" ]; then
|
||||
echo "── installing odoosky_hoot_dom_shim ($SHIM_MANIFEST_VER) — hoot-dom workaround ──"
|
||||
odoo -i odoosky_hoot_dom_shim -d "$DBNAME" --stop-after-init --no-http \
|
||||
|
||||
Reference in New Issue
Block a user