[PATCH] dim: Try to find python harder

Daniel Vetter daniel.vetter at ffwll.ch
Thu Sep 10 07:01:35 UTC 2020


debian stopped having a python link for reasons, so try to find one a
bit harder.

Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>
---
 dim | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dim b/dim
index df7fc1dd4791..e8bf2bb4f058 100755
--- a/dim
+++ b/dim
@@ -76,6 +76,8 @@ dim=$(basename $0)
 dim_today=$(date +%Y-%m-%d)
 dim_timestamp="$(date --utc +%Yy-%mm-%dd-%Hh-%Mm-%Ss) UTC"
 
+dim_python=$(which python || which python3)
+
 dim_fdo_cookie="--push-option fdo.pushedWithDim=this-was-pushed-with-dim-and-not-manually"
 
 maintainer_tools_https=https://gitlab.freedesktop.org/drm/maintainer-tools.git
@@ -427,7 +429,7 @@ function check_dim_config
 # $1 = file
 message_get_id ()
 {
-	python <<EOF
+	$dim_python <<EOF
 from email.parser import Parser
 headers = Parser().parse(open('$1', 'r'))
 message_id = headers['message-id']
@@ -438,7 +440,7 @@ EOF
 
 message_print_body ()
 {
-	python2 <<EOF
+	$dim_python <<EOF
 import email
 
 def print_msg(file):
-- 
2.28.0



More information about the dim-tools mailing list