From d7f513412168a8fc614c2c93609fb54e131b34e2 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 7 Jun 2019 13:32:31 +0200 Subject: [PATCH] [libcalamares] Be more verbose in error situations - runCommand can return NoWorkingDirectory in multiple places, make sure the log contains a more specific reason. --- src/libcalamares/utils/CalamaresUtilsSystem.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libcalamares/utils/CalamaresUtilsSystem.cpp b/src/libcalamares/utils/CalamaresUtilsSystem.cpp index 0d227c88f..c74243ecc 100644 --- a/src/libcalamares/utils/CalamaresUtilsSystem.cpp +++ b/src/libcalamares/utils/CalamaresUtilsSystem.cpp @@ -114,14 +114,24 @@ System::mount( const QString& devicePath, const QString& options ) { if ( devicePath.isEmpty() || mountPoint.isEmpty() ) + { + if ( devicePath.isEmpty() ) + cWarning() << "Can't mount an empty device."; + if ( mountPoint.isEmpty() ) + cWarning() << "Can't mount on an empty mountpoint."; + return static_cast(ProcessResult::Code::NoWorkingDirectory); + } QDir mountPointDir( mountPoint ); if ( !mountPointDir.exists() ) { bool ok = mountPointDir.mkpath( mountPoint ); if ( !ok ) + { + cWarning() << "Could not create mountpoint" << mountPoint; return static_cast(ProcessResult::Code::NoWorkingDirectory); + } } QString program( "mount" ); @@ -147,7 +157,10 @@ System::runCommand( QString output; if ( !Calamares::JobQueue::instance() ) + { + cError() << "No JobQueue"; return ProcessResult::Code::NoWorkingDirectory; + } Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage(); if ( ( location == System::RunLocation::RunInTarget ) &&