Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3767827
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/hotfixes/files/alias-python3-interpreter.sh b/hotfixes/files/alias-python3-interpreter.sh
new file mode 100755
index 0000000..6ecf999
--- /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
index 24a795b..9f77448 100644
--- a/hotfixes/init.sls
+++ b/hotfixes/init.sls
@@ -1,14 +1,15 @@
# -------------------------------------------------------------
# Salt — Hotfixes to mitigate bugs and security issues
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2017-02-27
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
include:
- .CVE-2017-6074
- .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
index 0000000..b718cab
--- /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/x-diff
Expires
Mon, Nov 25, 03:41 (1 d, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259466
Default Alt Text
(2 KB)
Attached To
Mode
rOPS Nasqueron Operations
Attached
Detach File
Event Timeline
Log In to Comment