From 0eb397ba65a23a09eb3673bd4fbe3e3248ceb00a Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Wed, 27 Feb 2013 13:32:40 +0100 Subject: Fix incorrect error message in binarycreator. This happened when calling binarycreator with -i and -n at the same time. Also fix a similar error when calling with -f -n. Also improve the error message when using -n together with -i or -e. Task-number: QTIFW-189 Change-Id: I369b218172997d2b46b3209ab13dfc4101767a5c Reviewed-by: Leena Miettinen Reviewed-by: Kai Koehne Reviewed-by: Karsten Heimrich Reviewed-by: Tim Jenssen --- tools/binarycreator/binarycreator.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/tools/binarycreator/binarycreator.cpp b/tools/binarycreator/binarycreator.cpp index 33fd8175a..ac160d57c 100644 --- a/tools/binarycreator/binarycreator.cpp +++ b/tools/binarycreator/binarycreator.cpp @@ -621,17 +621,12 @@ int main(int argc, char **argv) QInstaller::setVerbose(true); } else if (*it == QLatin1String("-n") || *it == QLatin1String("--online-only")) { if (!filteredPackages.isEmpty()) { - return printErrorAndUsageAndExit(QString::fromLatin1("for the --include and --exclude case you also " - "have to ensure that online-only==false, as that means include nothing")); + return printErrorAndUsageAndExit(QString::fromLatin1("Error: 'online-only' option cannot be used " + "in conjunction with the 'include' or 'exclude' option. An 'online-only' installer will never " + "contain any components apart from the root component.")); } - filteredPackages.append(QLatin1String("XXXXXXXXXXXXXXXXX_online_XXXXXXXXXXXXXXXXX")); - ftype = QInstallerTools::Include; onlineOnly = true; } else if (*it == QLatin1String("-f") || *it == QLatin1String("--offline-only")) { - if (onlineOnly) { - return printErrorAndUsageAndExit(QString::fromLatin1("You cannot use --online-only and " - "--offline-only at the same time.")); - } offlineOnly = true; } else if (*it == QLatin1String("-t") || *it == QLatin1String("--template")) { ++it; @@ -691,6 +686,16 @@ int main(int argc, char **argv) } } + if (onlineOnly && offlineOnly) { + return printErrorAndUsageAndExit(QString::fromLatin1("You cannot use --online-only and " + "--offline-only at the same time.")); + } + + if (onlineOnly) { + filteredPackages.append(QLatin1String("XXXXXXXXXXXXXXXXX_online_XXXXXXXXXXXXXXXXX")); + ftype = QInstallerTools::Include; + } + if (target.isEmpty()) return printErrorAndUsageAndExit(QString::fromLatin1("Error: Target parameter missing.")); -- cgit v1.2.3