From d7046f79cdc4197377800d61427fb528020a6ca1 Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin Date: Mon, 11 Dec 2023 11:24:58 +0100 Subject: [PATCH] misc: bilingual shebang for Python executable scripts. --- mkhelper/depgen.py | 12 +++++++++++- mkhelper/deplist.py | 12 +++++++++++- mkhelper/fortmodcmp.py | 12 +++++++++++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/mkhelper/depgen.py b/mkhelper/depgen.py index 2fa91bb..52ae5c7 100755 --- a/mkhelper/depgen.py +++ b/mkhelper/depgen.py @@ -1,4 +1,14 @@ -#!/usr/bin/env python +#!/bin/sh +""":" +for cmd in python3 python; do + if command -v > /dev/null "${cmd}"; then + exec "${cmd}" "$0" "$@" + fi +done +echo "Error: could not find a python interpreter!" >&2 +exit 1 +":""" + import argparse import os import sys diff --git a/mkhelper/deplist.py b/mkhelper/deplist.py index 9b9ca27..d626c24 100755 --- a/mkhelper/deplist.py +++ b/mkhelper/deplist.py @@ -1,4 +1,14 @@ -#!/usr/bin/env python +#!/bin/sh +""":" +for cmd in python3 python; do + if command -v > /dev/null "${cmd}"; then + exec "${cmd}" "$0" "$@" + fi +done +echo "Error: could not find a python interpreter!" >&2 +exit 1 +":""" + import argparse import collections import fnmatch diff --git a/mkhelper/fortmodcmp.py b/mkhelper/fortmodcmp.py index 0326d89..4cc7369 100755 --- a/mkhelper/fortmodcmp.py +++ b/mkhelper/fortmodcmp.py @@ -1,4 +1,14 @@ -#!/usr/bin/env python +#!/bin/sh +""":" +for cmd in python3 python; do + if command -v > /dev/null "${cmd}"; then + exec "${cmd}" "$0" "$@" + fi +done +echo "Error: could not find a python interpreter!" >&2 +exit 1 +":""" + import sys BUF_MAX_SIZE = 512