File tree Expand file tree Collapse file tree 4 files changed +35
-4
lines changed
Expand file tree Collapse file tree 4 files changed +35
-4
lines changed Original file line number Diff line number Diff line change 2828#
2929# Contact: thomas.dreibholz@gmail.com
3030
31- import distro
3231import glob
3332import http .client
3433import os
@@ -43,8 +42,18 @@ import time
4342import urllib .error
4443import urllib .request
4544
45+ if sys .version_info < (3 , 9 ):
46+ sys .stderr .write ('ERROR: ' + sys .argv [0 ] + ' requires Python 3.9 or later!\n ' )
47+ sys .exit (1 )
48+
4649from typing import Any , Final , TextIO , cast
4750
51+ try :
52+ import distro
53+ except ImportError :
54+ sys .stderr .write ('ERROR: ' + sys .argv [0 ] + ' requires the Python distro package!\n ' )
55+ sys .exit (1 )
56+
4857
4958# ###########################################################################
5059# #### Constants ####
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ set -eu
3434
3535# ====== Check arguments ====================================================
3636if [ $# -lt 1 ] ; then
37- echo >&2 " Usage: $0 compile|package|... ..."
37+ echo >&2 " Usage: $0 compile|package ..."
3838 exit 1
3939fi
4040
Original file line number Diff line number Diff line change 3232set -eu
3333
3434
35+ # ====== Check arguments ====================================================
36+ if [ $# -lt 1 ] ; then
37+ echo >&2 " Usage: $0 compile|package ..."
38+ exit 1
39+ fi
40+
41+
3542# ====== Check arguments ====================================================
3643USE_PACKAGING=0
3744while [ $# -gt 0 ] ; do
38- if [ " $1 " == " package" ] ; then
45+ TOOL=" $1 "
46+ if [ " ${TOOL} " == " compile" ] ; then
47+ USE_PACKAGING=0
48+ elif [ " $1 " == " package" ] ; then
3949 USE_PACKAGING=1
50+ else
51+ echo >&2 " ERROR: Invalid setting of TOOL=${TOOL} !"
52+ exit 1
4053 fi
4154 shift
4255done
Original file line number Diff line number Diff line change 2828#
2929# Contact: thomas.dreibholz@gmail.com
3030
31- import distro
3231import glob
3332import os
3433import re
3534import subprocess
3635import sys
3736
37+ if sys .version_info < (3 , 9 ):
38+ sys .stderr .write ('ERROR: ' + sys .argv [0 ] + ' requires Python 3.9 or later!\n ' )
39+ sys .exit (1 )
40+
3841from typing import Final , TextIO
3942
43+ try :
44+ import distro
45+ except ImportError :
46+ sys .stderr .write ('ERROR: ' + sys .argv [0 ] + ' requires the Python distro package!\n ' )
47+ sys .exit (1 )
48+
4049
4150# ###### Extract Deb file dependencies ######################################
4251debDepLine : Final [re .Pattern [str ]] = re .compile (r'^(.*:[ \t]*)(.*)$' )
You can’t perform that action at this time.
0 commit comments