samba-log-parser: make python optional
authorMichael Tokarev <mjt@tls.msk.ru>
Sun, 26 May 2024 11:40:40 +0000 (14:40 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Mon, 10 Jun 2024 17:17:53 +0000 (20:17 +0300)
Forwarded: not-needed
Debian-Specific: yes

samba-log-parser is a rarely used utility written in python.
It is the only python program in the samba-common-bin package.
By using this simple trick (wrapping the script into #!/bin/sh)
we can make the python package optional, to be able to install
minimal samba client.

Gbp-Pq: Name make-python-optional.diff

source3/script/samba-log-parser

index a07dfdb4a6c56da76c4c375d859641729c39dd9d..0195fe2eef0fa729e607765541d3d9ccc4c64936 100755 (executable)
@@ -1,4 +1,9 @@
-#!/usr/bin/env python3
+#! /bin/sh
+""":"
+[ -x /usr/bin/python3 ] && exec /usr/bin/python3 "$0" "$@"
+echo "This program requires python3. Please install python3 package to use it." >&2
+exit 42
+":"""
 #
 #######################################################################
 #