From 892964978c4a75287ccdc2a062524890e5708efe Mon Sep 17 00:00:00 2001 From: probonopd Date: Fri, 7 Jul 2017 20:36:48 +0200 Subject: [PATCH] Exit if appDirPath == "/", closes #144 --- tools/linuxdeployqt/main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/linuxdeployqt/main.cpp b/tools/linuxdeployqt/main.cpp index 67baecc..78a1355 100644 --- a/tools/linuxdeployqt/main.cpp +++ b/tools/linuxdeployqt/main.cpp @@ -185,7 +185,7 @@ int main(int argc, char **argv) if (QDir().exists(appBinaryPath)) { qDebug() << "app-binary:" << appBinaryPath; } else { - qDebug() << "Error: Could not find app-binary" << appBinaryPath; + LogError() << "Error: Could not find app-binary" << appBinaryPath; return 1; } @@ -199,6 +199,11 @@ int main(int argc, char **argv) QString relativePrefix = fhsPrefix.replace(appDirPath+"/", ""); relativeBinPath = relativePrefix + "/bin/" + appName; } + if(appDirPath == "/"){ + LogError() << "'/' is not a valid AppDir. Please refer to the documentation."; + LogError() << "Consider adding INSTALL_ROOT or DESTDIR to your install steps."; + return 1; + } qDebug() << "appDirPath:" << appDirPath; qDebug() << "relativeBinPath:" << relativeBinPath;