diff options
author | Michael Kuhn <michael.kuhn@informatik.uni-hamburg.de> | 2020-03-25 15:33:49 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-03-29 20:52:43 +0300 |
commit | 6952f9f6c95ac4a04f23776174d53e01e4c58091 (patch) | |
tree | 66a1c26e33ffbecf476664ad5adc6820a46aebff /mesonbuild/minstall.py | |
parent | 41485f3ecac6fdd474834b9735c41019d8889c32 (diff) | |
download | meson-6952f9f6c95ac4a04f23776174d53e01e4c58091.zip meson-6952f9f6c95ac4a04f23776174d53e01e4c58091.tar.gz meson-6952f9f6c95ac4a04f23776174d53e01e4c58091.tar.bz2 |
Do not call restorecon if there are no files to install
Fixes #6452
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r-- | mesonbuild/minstall.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index ace0569..9c64429 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -171,6 +171,10 @@ def restore_selinux_contexts(): # If we don't have restorecon, failure is ignored quietly. return + if not selinux_updates: + # If the list of files is empty, do not try to call restorecon. + return + with subprocess.Popen(['restorecon', '-F', '-f-', '-0'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as proc: out, err = proc.communicate(input=b'\0'.join(os.fsencode(f) for f in selinux_updates) + b'\0') |