From 99361dcae65c82c6e1df830be849226a1715b50c Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Mon, 19 May 2025 17:18:06 +0200
Subject: multiarchanalyze: improve pycompile detection

 * Write tabs as \t to prevent auto formatters from turning them into
   spaces.
 * Allow colon in package names as some of them are arch qualified.
---
 multiarchimport.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/multiarchimport.py b/multiarchimport.py
index 7d43938..33bf9dd 100755
--- a/multiarchimport.py
+++ b/multiarchimport.py
@@ -23,10 +23,10 @@ set -e
 
 # Automatically added by dh_python3
 if command -v py3compile >/dev/null 2>&1; then
-	py3compile
+\tpy3compile
 fi
 if command -v pypy3compile >/dev/null 2>&1; then
-	pypy3compile || true
+\tpypy3compile || true
 fi
 
 # End automatically added section
@@ -36,10 +36,10 @@ set -e
 
 # Automatically added by dh_python3
 if command -v py3clean >/dev/null 2>&1; then
-	py3clean
+\tpy3clean
 else
-	dpkg| sed -En -e '/^(.*)\\/(.+)\\.py$/s,,rm "\\1/__pycache__/\\2".*,e'
-	find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
+\tdpkg| sed -En -e '/^(.*)\\/(.+)\\.py$/s,,rm "\\1/__pycache__/\\2".*,e'
+\tfind /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
 fi
 
 # End automatically added section
@@ -49,10 +49,10 @@ set -e
 
 # Automatically added by dh_python3
 if which py3compile >/dev/null 2>&1; then
-	py3compile
+\tpy3compile
 fi
 if which pypy3compile >/dev/null 2>&1; then
-	pypy3compile || true
+\tpypy3compile || true
 fi
 
 # End automatically added section
@@ -62,10 +62,10 @@ set -e
 
 # Automatically added by dh_python3
 if which py3clean >/dev/null 2>&1; then
-	py3clean
+\tpy3clean
 else
-	dpkg| perl -ne 's,/([^/]*)\\.py$,/__pycache__/\\1.*, or next; unlink $_ or die $! foreach glob($_)'
-	find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
+\tdpkg| perl -ne 's,/([^/]*)\\.py$,/__pycache__/\\1.*, or next; unlink $_ or die $! foreach glob($_)'
+\tfind /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
 fi
 
 # End automatically added section
@@ -145,7 +145,7 @@ class MultiarchExtractor(DebExtractor):
     def handle_control_member(self, name, content):
         if name in ("preinst", "postinst", "prerm", "postrm"):
             if b"dh_python3" in content:
-                generic_content = re.sub(b" -(p|L) python3-[a-z0-9+.-]+ ", b"", content)
+                generic_content = re.sub(b" -[pL] python3-[a-z0-9+.:-]+ ", b"", content)
                 if generic_content in PYTHON_MAINT_CONTENT:
                     return
             self.result["hasscripts"] = True
-- 
cgit v1.2.3