From 1e1d9274f070d66c9fc32721bb318328809c8040 Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Mon, 27 May 2024 19:34:32 +0300 Subject: [PATCH] Handle complaints about shebangs during RPM build When building the Dangerzone RPMs, we were seeing the following shebang warnings: + /usr/lib/rpm/redhat/brp-mangle-shebangs mangling shebang in /usr/lib/python3.12/site-packages/dangerzone/conversion/doc_to_pixels.py from /usr/bin/env python3 to #!/usr/bin/python3 mangling shebang in /usr/lib/python3.12/site-packages/dangerzone/conversion/common.py from /usr/bin/env python3 to #!/usr/bin/python3 mangling shebang in /usr/lib/python3.12/site-packages/dangerzone/conversion/pixels_to_pdf.py from /usr/bin/env python3 to #!/usr/bin/python3 mangling shebang in /etc/qubes-rpc/dz.ConvertDev from /usr/bin/env python3 to #!/usr/bin/python3 mangling shebang in /etc/qubes-rpc/dz.Convert from /bin/sh to #!/usr/bin/sh These warnings are benign in nature, but coupled with #727, they could lead to incorrect file permissions. Remove shebangs from the following files, since they are not executed directly, but are imported instead: dangerzone/conversion/common.py dangerzone/conversion/doc_to_pixels.py dangerzone/conversion/pixels_to_pdf.py Also, accept the suggestions by Fedora (/bin/sh -> /usr/bin/sh, /usr/bin/env python3 -> /usr/bin/python3) for the following files: qubes/dz.Convert qubes/dz.ConvertDev Refs #727 --- dangerzone/conversion/common.py | 2 -- dangerzone/conversion/doc_to_pixels.py | 1 - dangerzone/conversion/pixels_to_pdf.py | 1 - qubes/dz.Convert | 2 +- qubes/dz.ConvertDev | 2 +- 5 files changed, 2 insertions(+), 6 deletions(-) diff --git a/dangerzone/conversion/common.py b/dangerzone/conversion/common.py index e0a9f39..1745827 100644 --- a/dangerzone/conversion/common.py +++ b/dangerzone/conversion/common.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python3 - import asyncio import glob import json diff --git a/dangerzone/conversion/doc_to_pixels.py b/dangerzone/conversion/doc_to_pixels.py index 5f1abf3..b67d038 100644 --- a/dangerzone/conversion/doc_to_pixels.py +++ b/dangerzone/conversion/doc_to_pixels.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 import asyncio import glob import os diff --git a/dangerzone/conversion/pixels_to_pdf.py b/dangerzone/conversion/pixels_to_pdf.py index d69c7a3..823611e 100644 --- a/dangerzone/conversion/pixels_to_pdf.py +++ b/dangerzone/conversion/pixels_to_pdf.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python3 """ Here are the steps, with progress bar percentages: diff --git a/qubes/dz.Convert b/qubes/dz.Convert index b9dded3..513348a 100755 --- a/qubes/dz.Convert +++ b/qubes/dz.Convert @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/sh python -m dangerzone.conversion.doc_to_pixels diff --git a/qubes/dz.ConvertDev b/qubes/dz.ConvertDev index 74a9845..f0597bb 100755 --- a/qubes/dz.ConvertDev +++ b/qubes/dz.ConvertDev @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 import asyncio import glob