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`.
pull/8362/head
Xℹ Ruoyao 4 years ago committed by Xavier Claessens
parent 110457543d
commit 3ed30cea6e
  1. 2
      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:],

Loading…
Cancel
Save