diff options
author | Alexander Lenhardt <alexander.lenhardt@nokia.com> | 2012-03-19 13:16:06 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@nokia.com> | 2012-03-19 15:21:43 +0100 |
commit | 3bfccb51aa49cde261965867e7b4ba285208fab9 (patch) | |
tree | c45acf9da4b54d6b4cd2bb74cfb3e166c425ce01 | |
parent | a4f2360e3d68cec0c9a95ede6fa23aa157accc56 (diff) |
fixed repogen commandline parsing
Change-Id: I838af6e8398a74d59829eb1250678a24568169f9
Reviewed-by: Niels Weber <niels.2.weber@nokia.com>
Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
-rw-r--r-- | installerbuilder/repogen/repogen.cpp | 38 |
1 files changed, 2 insertions, 36 deletions
diff --git a/installerbuilder/repogen/repogen.cpp b/installerbuilder/repogen/repogen.cpp index 48609f9da..c38018e6d 100644 --- a/installerbuilder/repogen/repogen.cpp +++ b/installerbuilder/repogen/repogen.cpp @@ -175,46 +175,12 @@ int main(int argc, char** argv) } } - //TODO: adjust to the new argument/option usage - if ((packagesDir.isEmpty() && configDir.isEmpty() && args.count() < 4) - || ((packagesDir.isEmpty() || configDir.isEmpty()) && args.count() < 3) //use the old check - || (updateExistingRepository && args.count() != 1) - || (!updateExistingRepository && args.count() < 2)) { //only one dir set by the new options - // both dirs set by the new options + if ((packagesDir.isEmpty() || configDir.isEmpty() || args.count() != 1)) { printUsage(); return 1; } - int argsPosition = 0; - bool needPrintUsage = false; - if (packagesDir.isEmpty()) { - std::cout << "!!! A stand alone package directory argument is deprecated. Please use the pre " - "argument." << std::endl; - needPrintUsage |= true; - packagesDir = makeAbsolute(args[argsPosition++]); - } - - if (configDir.isEmpty()) { - std::cout << "!!! A stand alone config directory argument is deprecated. Please use the pre " - "argument." << std::endl; - needPrintUsage |= true; - configDir = makeAbsolute(args[argsPosition++]); - } - if (needPrintUsage) { - printUsage(); - } - - const QString repositoryDir = makeAbsolute(args[argsPosition++]); - const QStringList components = args.mid(argsPosition); - - if (!components.isEmpty()) { - std::cout << "Package names at the end of the command are deprecated" - " - please use --include or --exclude" << std::endl; - if (updateExistingRepository) { - filteredPackages.append(components); - filterType = QInstallerTools::Include; - } - } + const QString repositoryDir = makeAbsolute(args.first()); if (!updateExistingRepository && QFile::exists(repositoryDir)) { throw QInstaller::Error(QObject::tr("Repository target folder %1 already exists!") |