summaryrefslogtreecommitdiff
path: root/dev-python/proton-vpn-network-manager/files/proton-vpn-network-manager-0.12.13-remove-call-to-apt.patch
blob: e6258c312f5b5e14abbdcf7981951cc2de3f869e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From a58f2e046f2e7dcb008158b54db2f0bdace0cc1e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matt=C3=A9o=20Rossillol=E2=80=91=E2=80=91Laruelle?=
 <beatussum@protonmail.com>
Date: Fri, 25 Apr 2025 15:14:48 +0200
Subject: [PATCH] remove call to `apt`
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In Gentoo, `apt` is a part of the Java upstream and is installed by
`app-eselect/eselect-java`. This executable is not the `apt` package manager of
Debian. Its call has to be removed to avoid an annoying notification.

Signed-off-by: Mattéo Rossillol‑‑Laruelle <beatussum@protonmail.com>
---
 .../killswitch/default/nmkillswitch.py        | 21 -------------------
 .../killswitch/wireguard/wgkillswitch.py      | 21 -------------------
 2 files changed, 42 deletions(-)

diff --git a/proton/vpn/backend/linux/networkmanager/killswitch/default/nmkillswitch.py b/proton/vpn/backend/linux/networkmanager/killswitch/default/nmkillswitch.py
index 6650a97..a2e2cfd 100644
--- a/proton/vpn/backend/linux/networkmanager/killswitch/default/nmkillswitch.py
+++ b/proton/vpn/backend/linux/networkmanager/killswitch/default/nmkillswitch.py
@@ -101,25 +101,4 @@ class NMKillSwitch(KillSwitch):
             logger.error("NetworkManager is not running.")
             return False
 
-        # libnetplan0 is the first version that is present in Ubuntu 22.04. In Ubuntu 24.04
-        # the package name changes to libnetplan1, and it's not compatible with this kill
-        # switch implementation when IPv6 is disabled via the ipv6.disabled kernel option.
-        try:
-            result = subprocess.run(
-                ["/usr/bin/apt", "show", "libnetplan1"],
-                capture_output=True,
-                check=True, shell=False
-            )  # nosec B603:subprocess_without_shell_equals_true
-        except (FileNotFoundError, subprocess.CalledProcessError):
-            pass
-        else:
-            stdout_decoded = result.stdout.decode("utf8").split("\n")
-            for package_info_line in stdout_decoded:
-                if package_info_line.startswith("Version: 1.0.0"):
-                    logger.warning(
-                        "Kill switch is not compatible with libnetplan1 v1.0.0. "
-                        "Please upgrade libnetplan1 package to v1.1.1"
-                    )
-                    break
-
         return True
diff --git a/proton/vpn/backend/linux/networkmanager/killswitch/wireguard/wgkillswitch.py b/proton/vpn/backend/linux/networkmanager/killswitch/wireguard/wgkillswitch.py
index aff3cd4..0123b43 100644
--- a/proton/vpn/backend/linux/networkmanager/killswitch/wireguard/wgkillswitch.py
+++ b/proton/vpn/backend/linux/networkmanager/killswitch/wireguard/wgkillswitch.py
@@ -104,25 +104,4 @@ class WGKillSwitch(KillSwitch):
             logger.error("NetworkManager is not running.")
             return False
 
-        # libnetplan0 is the first version that is present in Ubuntu 22.04. In Ubuntu 24.04
-        # the package name changes to libnetplan1, and it's not compatible with this kill
-        # switch implementation when IPv6 is disabled via the ipv6.disabled kernel option.
-        try:
-            result = subprocess.run(
-                ["/usr/bin/apt", "show", "libnetplan1"],
-                capture_output=True,
-                check=True, shell=False
-            )  # nosec B603:subprocess_without_shell_equals_true
-        except (FileNotFoundError, subprocess.CalledProcessError):
-            pass
-        else:
-            stdout_decoded = result.stdout.decode("utf8").split("\n")
-            for package_info_line in stdout_decoded:
-                if package_info_line.startswith("Version: 1.0.0"):
-                    logger.warning(
-                        "Kill switch is not compatible with libnetplan1 v1.0.0. "
-                        "Please upgrade libnetplan1 package to v1.1.1"
-                    )
-                    break
-
         return True
-- 
2.49.0