aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
authorXℹ Ruoyao <xry111@mengyan1223.wang>2021-02-16 15:15:37 +0800
committerXavier Claessens <xclaesse@gmail.com>2021-02-16 08:39:29 -0500
commit3ed30cea6ed754fa9f519f15d8e322b8fcc2126b (patch)
treea5b1f6913e3432a81d640d7361ea424b2ad8bbe0 /mesonbuild/minstall.py
parent110457543dd051fbea17f767495ffd519d1f5e57 (diff)
downloadmeson-3ed30cea6ed754fa9f519f15d8e322b8fcc2126b.zip
meson-3ed30cea6ed754fa9f519f15d8e322b8fcc2126b.tar.gz
meson-3ed30cea6ed754fa9f519f15d8e322b8fcc2126b.tar.bz2
Fix destdir detection for installation via polkit
In 0.57.0 installation via polkit won't work anymore. `destdir` is defaulted to an empty string ('') instead of None. But polkit installation code incorrectly tests `destdir is None`.
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 6c1810a..212568a 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -512,7 +512,7 @@ class Installer:
self.log('Preserved {} unchanged files, see {} for the full list'
.format(self.preserved_file_count, os.path.normpath(self.lf.name)))
except PermissionError:
- if shutil.which('pkexec') is not None and 'PKEXEC_UID' not in os.environ and destdir is None:
+ if shutil.which('pkexec') is not None and 'PKEXEC_UID' not in os.environ and destdir == '':
print('Installation failed due to insufficient permissions.')
print('Attempting to use polkit to gain elevated privileges...')
os.execlp('pkexec', 'pkexec', sys.executable, main_file, *sys.argv[1:],