aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorStéphane Cerveau <scerveau@collabora.com>2021-08-05 10:32:51 +0200
committerXavier Claessens <xclaesse@gmail.com>2021-08-06 15:03:29 -0400
commit51cbb15335d324fae9df61a70fd716ef187a867a (patch)
treec83e8367fd11fe02f27eb85784d7828efcd615d5 /mesonbuild
parent2c3a68bc30cf6e08c2e3b77b64718ef3a0e5d78c (diff)
downloadmeson-51cbb15335d324fae9df61a70fd716ef187a867a.zip
meson-51cbb15335d324fae9df61a70fd716ef187a867a.tar.gz
meson-51cbb15335d324fae9df61a70fd716ef187a867a.tar.bz2
minstall: restore_selinux_contexts: fix env test
To avoid extra env test, test destdir presence upper in restore_selinux_contexts
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/minstall.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 7bacc00..d8faad6 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -229,9 +229,6 @@ def restore_selinux_contexts() -> None:
# is ignored quietly.
return
- if os.environ.get('DESTDIR'):
- return
-
if not shutil.which('restorecon'):
# If we don't have restorecon, failure is ignored quietly.
return
@@ -355,8 +352,8 @@ class Installer:
if not self.dry_run:
set_mode(*args, **kwargs)
- def restore_selinux_contexts(self) -> None:
- if not self.dry_run:
+ def restore_selinux_contexts(self, destdir: str) -> None:
+ if not self.dry_run and not destdir:
restore_selinux_contexts()
def apply_ldconfig(self, destdir: str) -> None:
@@ -536,7 +533,7 @@ class Installer:
self.install_headers(d, dm, destdir, fullprefix)
self.install_man(d, dm, destdir, fullprefix)
self.install_data(d, dm, destdir, fullprefix)
- self.restore_selinux_contexts()
+ self.restore_selinux_contexts(destdir)
self.apply_ldconfig(destdir)
self.run_install_script(d, destdir, fullprefix)
if not self.did_install_something: