From c4c46a0a8d9c9a7a8ac5208f68fa2c3ff46faade Mon Sep 17 00:00:00 2001 From: Alex Pyrgiotis Date: Thu, 5 Oct 2023 18:26:36 +0300 Subject: [PATCH] Small fixes for Qubes PRM This commit fixes 3 small issues with the way we produce our Qubes RPM: 1. The `.exists()` method follows symlinks by default, whereas we want to check if a symlink exists. This functionality has been added in Python 3.12. Instead of checking if a symlink exists and then removing it, simply remove it and don't throw an error if it doesn't exist in the first place. 2. The `dz.Convert*` policies were not installed with the executable bit set, therefore the qube could not start. 3. The `dz.ConvertDev` policy in particular had an ambiguous shebang, thus we change it to explicitly call Python3 --- install/linux/build-rpm.py | 3 +-- install/linux/dangerzone.spec | 2 +- qubes/dz.ConvertDev | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/install/linux/build-rpm.py b/install/linux/build-rpm.py index a1ad25c..1421ec1 100755 --- a/install/linux/build-rpm.py +++ b/install/linux/build-rpm.py @@ -59,8 +59,7 @@ def build(qubes=False): shutil.copy2(specfile_path, build_dir / "SPECS") rpm_dir = build_dir / "RPMS" / "x86_64" srpm_dir = build_dir / "SRPMS" - if srpm_dir.exists(): - os.unlink(srpm_dir) + srpm_dir.unlink(missing_ok=True) os.symlink(dist_path, rpm_dir) os.symlink(dist_path, srpm_dir) diff --git a/install/linux/dangerzone.spec b/install/linux/dangerzone.spec index d24092c..99886e0 100644 --- a/install/linux/dangerzone.spec +++ b/install/linux/dangerzone.spec @@ -268,7 +268,7 @@ install -m 644 share/* %{buildroot}/usr/share/dangerzone # /etc/qubes-rpc. %if 0%{?_qubes} install -m 755 -d %{buildroot}/etc/qubes-rpc -install -m 644 qubes/* %{buildroot}/etc/qubes-rpc +install -m 755 qubes/* %{buildroot}/etc/qubes-rpc %endif # The following files are included in the top level of the Python source diff --git a/qubes/dz.ConvertDev b/qubes/dz.ConvertDev index a663081..cb93b79 100755 --- a/qubes/dz.ConvertDev +++ b/qubes/dz.ConvertDev @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import asyncio import glob