summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian_installer_allowed_root.patch
blob: f0257c8db553af62c3a8ecc4857a44502cd44193 (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
From: Scott Kitterman <scott@kitterman.com>
Date: Tue, 7 Dec 2021 20:08:04 -0500
Subject: Short circuit root test for building Debian packages

Origin: vendor
Forwarded: not-needed
Last-Update: 2020-04-13

  * Patch install.Installer class not to error out when subclassed as
    DebianInstaller from dh-python
---
 flit/install.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/flit/install.py b/flit/install.py
index 3ea9a4b..f29326c 100644
--- a/flit/install.py
+++ b/flit/install.py
@@ -109,7 +109,8 @@ class Installer(object):
 
         if (hasattr(os, 'getuid') and (os.getuid() == 0) and
                 (not os.environ.get('FLIT_ROOT_INSTALL'))):
-            raise RootInstallError
+            if type(self).__name__ != 'DebianInstaller':
+                raise RootInstallError
 
         if user is None:
             self.user = self._auto_user(python)