From 1bb29b1b329ec056c61a54070024b6b003cf5ca4 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 19 Jul 2023 15:21:36 +1000 Subject: minstall: move the "Installing foo to bar" message up Move this message up before we attempt to change anything in the file system (in this case creating the directory structure). If an error occurs it will thus occur immediately after the message, allowing us to debug what failed to install. --- mesonbuild/minstall.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index a9c561f..0d397b2 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -403,13 +403,15 @@ class Installer: append_to_log(self.lf, f'# Preserving old file {to_file}\n') self.preserved_file_count += 1 return False + self.log(f'Installing {from_file} to {outdir}') self.remove(to_file) - elif makedirs: - # Unpack tuple - dirmaker, outdir = makedirs - # Create dirs if needed - dirmaker.makedirs(outdir, exist_ok=True) - self.log(f'Installing {from_file} to {outdir}') + else: + self.log(f'Installing {from_file} to {outdir}') + if makedirs: + # Unpack tuple + dirmaker, outdir = makedirs + # Create dirs if needed + dirmaker.makedirs(outdir, exist_ok=True) if os.path.islink(from_file): if not os.path.exists(from_file): # Dangling symlink. Replicate as is. -- cgit v1.1