summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian_installer_allowed_root.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/debian_installer_allowed_root.patch')
-rw-r--r--debian/patches/debian_installer_allowed_root.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/debian/patches/debian_installer_allowed_root.patch b/debian/patches/debian_installer_allowed_root.patch
new file mode 100644
index 0000000..f0257c8
--- /dev/null
+++ b/debian/patches/debian_installer_allowed_root.patch
@@ -0,0 +1,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)