Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3767882
D3288.id8465.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3288.id8465.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 04:02 (20 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259498
Default Alt Text
D3288.id8465.diff (1 KB)
Attached To
Mode
D3288: Provide Python 3 interpreter as python3 executable
Attached
Detach File
Event Timeline
Log In to Comment