From a23a404d83f70d1927cf921ed2ed03d442e819e6 Mon Sep 17 00:00:00 2001
From: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Thu, 10 Sep 2020 09:01:03 +0200
Subject: [PATCH] dim: Try to find python harder

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

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

diff --git a/dim b/dim
index 64145d5..f6b3a6c 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):
-- 
GitLab