summaryrefslogtreecommitdiffstats
path: root/tools/repogen/repogen.cpp
diff options
context:
space:
mode:
authorNiels Weber <niels.2.weber@nokia.com>2012-04-02 14:13:02 +0200
committerNiels Weber <niels.2.weber@nokia.com>2012-04-02 16:34:13 +0200
commit22e6708d99a95b02dbb512daa9b70ebeb92b4bcf (patch)
treed66a754c2ddb92634a46e37cd33cbab9968e299b /tools/repogen/repogen.cpp
parent8fde1a8c6421ad7c4a3de67cf5ac66cc71a11541 (diff)
Specify config file instead of hardcoding config.xml
Fixes Task-number: QTIFW-83 Change-Id: I706e08492355e3502e76377f232c94ded5437029 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
Diffstat (limited to 'tools/repogen/repogen.cpp')
-rw-r--r--tools/repogen/repogen.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp
index fb4122bb4..8323f345a 100644
--- a/tools/repogen/repogen.cpp
+++ b/tools/repogen/repogen.cpp
@@ -98,7 +98,7 @@ int main(int argc, char** argv)
QStringList filteredPackages;
bool updateExistingRepository = false;
QString packagesDir;
- QString configDir;
+ QString configFile;
QString redirectUpdateUrl;
QInstallerTools::FilterType filterType = QInstallerTools::Exclude;
bool remove = false;
@@ -149,18 +149,18 @@ int main(int argc, char** argv)
return printErrorAndUsageAndExit(QObject::tr("Error: Config parameter missing argument"));
const QFileInfo fi(args.first());
if (!fi.exists()) {
- return printErrorAndUsageAndExit(QObject::tr("Error: Config directory %1 not found "
+ return printErrorAndUsageAndExit(QObject::tr("Error: Config file %1 not found "
"at the specified location").arg(args.first()));
}
- if (!fi.isDir()) {
+ if (!fi.isFile()) {
return printErrorAndUsageAndExit(QObject::tr("Error: Configuration %1 is not a "
- "directory").arg(args.first()));
+ "file").arg(args.first()));
}
if (!fi.isReadable()) {
- return printErrorAndUsageAndExit(QObject::tr("Error: Config directory %1 is not "
+ return printErrorAndUsageAndExit(QObject::tr("Error: Config file %1 is not "
"readable").arg(args.first()));
}
- configDir = args.first();
+ configFile = args.first();
args.removeFirst();
} else if (args.first() == QLatin1String("-u") || args.first() == QLatin1String("--updateurl")) {
args.removeFirst();
@@ -180,7 +180,7 @@ int main(int argc, char** argv)
}
}
- if ((packagesDir.isEmpty() || configDir.isEmpty() || args.count() != 1)) {
+ if ((packagesDir.isEmpty() || configFile.isEmpty() || args.count() != 1)) {
printUsage();
return 1;
}
@@ -215,8 +215,8 @@ int main(int argc, char** argv)
const QString metaTmp = createTemporaryDirectory();
tmpDeleter.add(metaTmp);
- const Settings &settings = Settings::fromFileAndPrefix(configDir + QLatin1String("/config.xml"),
- configDir);
+ QString configDir = QFileInfo(configFile).canonicalPath();
+ const Settings &settings = Settings::fromFileAndPrefix(configFile, configDir);
generateMetaDataDirectory(metaTmp, repositoryDir, packages, settings.applicationName(),
settings.applicationVersion(), redirectUpdateUrl);
QInstallerTools::compressMetaDirectories(metaTmp, metaTmp, pathToVersionMapping);