Page MenuHomeDevCentral

D3288.id.diff
No OneTemporary

D3288.id.diff

diff --git a/hotfixes/files/alias-python3-interpreter.sh b/hotfixes/files/alias-python3-interpreter.sh
new file mode 100755
--- /dev/null
+++ b/hotfixes/files/alias-python3-interpreter.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+set -e
+
+TARGET=/usr/local/bin/python3
+
+if [ -f $TARGET ]; then
+ echo "The python3 command already exists." >&2
+ exit 2
+fi
+
+CANDIDATE=$(pkg info | grep python3 | awk '{print $1}' | xargs -n1 pkg info -l | grep /usr/local/bin/python3 | grep -v config | awk '{print $1}' | head -n1)
+
+if [ -z "$CANDIDATE" ]; then
+ echo "Can't find Python 3 interpreter" >&2
+ exit 1
+fi
+
+ln -s "$CANDIDATE" $TARGET
diff --git a/hotfixes/init.sls b/hotfixes/init.sls
--- a/hotfixes/init.sls
+++ b/hotfixes/init.sls
@@ -11,4 +11,5 @@
- .T1261-srv-data
- .T1345-drop-jails-from-ysul
- .MariaDB
+ - .python3
- .old-directories
diff --git a/hotfixes/python3.sls b/hotfixes/python3.sls
new file mode 100644
--- /dev/null
+++ b/hotfixes/python3.sls
@@ -0,0 +1,21 @@
+# -------------------------------------------------------------
+# Salt — Hotfixes to mitigate bugs and security issues
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+# -------------------------------------------------------------
+# Python 3 alias
+#
+# If a the python3 meta-port is missing, we only have executables
+# like python3.9 available. As most of our scripts uses `python3`,
+# it's probably best to ensure an alias by looking for an interpreter.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% if grains['os'] == 'FreeBSD' %}
+/usr/local/bin/python3:
+ cmd.script:
+ - source: salt://hotfixes/files/alias-python3-interpreter.sh
+ - creates: /usr/local/bin/python3
+{% endif %}

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 07:04 (4 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2207071
Default Alt Text
D3288.id.diff (1 KB)

Event Timeline