summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@nokia.com>2012-02-28 17:52:24 +0100
committerKarsten Heimrich <karsten.heimrich@nokia.com>2012-03-01 11:58:02 +0100
commit61dc9d1d03f039e5155978e1407c3682803d7088 (patch)
treea1b12c96feba27a7f79835fe2eff9c29edac5c16 /installerbuilder
parent1c1c5a08575ffe9117094edbf6db80c828809b01 (diff)
Use the same code to copy the archives.
This makes sure online and offline installers have the same files and naming scheme for the 7z archives. Change-Id: I5fb8d3be041f0828f5971d5128116c1376aef6fa Reviewed-by: Tim Jenssen <tim.jenssen@nokia.com>
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/binarycreator/binarycreator.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/installerbuilder/binarycreator/binarycreator.cpp b/installerbuilder/binarycreator/binarycreator.cpp
index adde45b2f..83fdb264a 100644
--- a/installerbuilder/binarycreator/binarycreator.cpp
+++ b/installerbuilder/binarycreator/binarycreator.cpp
@@ -620,8 +620,8 @@ int main(int argc, char **argv)
qDebug() << "Parsed arguments, ok.";
try {
- const PackageInfoVector packageList = createListOfPackages(components, packagesDirectory, !nodeps);
- const PackageInfoVector packages = QInstaller::filterBlacklisted(packageList, excludedPackages);
+ PackageInfoVector packages = QInstaller::filterBlacklisted(createListOfPackages(components,
+ packagesDirectory, !nodeps), excludedPackages);
const QString metaDir = createMetaDataDirectory(packages, packagesDirectory, configDir);
{
QSettings confInternal(metaDir + "/config/config-internal.ini", QSettings::IniFormat);
@@ -638,41 +638,41 @@ int main(int argc, char **argv)
if (!target.endsWith(QLatin1String(".exe")))
target += QLatin1String(".exe");
#endif
-
- Input input;
- input.outputPath = target;
- input.installerExePath = templateBinary;
- input.binaryResourcePath = createBinaryResourceFile(metaDir);
- input.binaryResources = createBinaryResourceFiles(resources);
-
- // now put the packages into the components section of the binary:
- for (PackageInfoVector::const_iterator it = packages.begin(); it != packages.end(); ++it) {
- qDebug() << "Creating component info for" << it->name;
-
- Component comp;
- comp.setName(it->name.toUtf8());
- // append everything within the data directory
- const QFileInfoList archives = QDir(QString::fromLatin1("%1/data").arg(it->directory))
- .entryInfoList(QDir::NoDotAndDotDot | QDir::Dirs | QDir::Files);
- foreach (const QFileInfo &archive, archives) {
- const QSharedPointer<Archive> arch(new Archive(archive.absoluteFilePath()));
- qDebug() << QString::fromLatin1("\tAppending %1 (%2 bytes)").arg(archive.filePath(),
- QString::number(arch->size()));
- comp.appendArchive(arch);
+ int result = EXIT_FAILURE;
+ {
+ Input input;
+ input.outputPath = target;
+ input.installerExePath = templateBinary;
+ input.binaryResourcePath = createBinaryResourceFile(metaDir);
+ input.binaryResources = createBinaryResourceFiles(resources);
+
+ QInstaller::copyComponentData(packagesDirectory, metaDir, packages);
+
+ // now put the packages into the components section of the binary
+ foreach (const PackageInfo &info, packages) {
+ Component comp;
+ comp.setName(info.name.toUtf8());
+
+ qDebug() << "Creating component info for" << info.name;
+ foreach (const QString &archive, info.copiedArchives) {
+ const QSharedPointer<Archive> arch(new Archive(archive));
+ qDebug() << QString::fromLatin1("\tAppending %1 (%2 bytes)").arg(archive,
+ QString::number(arch->size()));
+ comp.appendArchive(arch);
+ }
+ input.components.insertComponent(comp);
}
- input.components.insertComponent(comp);
- }
- qDebug() << "Creating the binary";
- const int result = assemble(input, configDir);
+ qDebug() << "Creating the binary";
+ result = assemble(input, configDir);
- // cleanup
- qDebug() << "Cleaning up...";
- QFile::remove(input.binaryResourcePath);
- foreach (const QString &resource, input.binaryResources)
- QFile::remove(resource);
+ // cleanup
+ qDebug() << "Cleaning up...";
+ QFile::remove(input.binaryResourcePath);
+ foreach (const QString &resource, input.binaryResources)
+ QFile::remove(resource);
+ }
removeDirectory(metaDir);
-
return result;
} catch (const Error &e) {
std::cerr << e.message() << std::endl;