diff options
-rw-r--r-- | dist/config/config.xml | 4 | ||||
-rw-r--r-- | dist/packages/org.qtproject.ifw.binaries/meta/package.xml | 2 | ||||
-rw-r--r-- | dist/packages/org.qtproject.ifw/meta/package.xml | 2 | ||||
-rw-r--r-- | doc/installerfw.qdoc | 2 | ||||
-rw-r--r-- | src/libs/installer/binaryformat.cpp | 2 | ||||
-rw-r--r-- | src/libs/installer/resources/files-to-patch-linux-emb-arm | 3 | ||||
-rw-r--r-- | src/libs/installer/resources/files-to-patch-macx-emb-arm | 9 | ||||
-rw-r--r-- | src/libs/installer/resources/files-to-patch-windows-emb-arm | 3 | ||||
-rw-r--r-- | src/libs/installer/resources/patch_file_lists.qrc | 1 | ||||
-rw-r--r-- | src/libs/kdtools/kdupdaterfiledownloader.cpp | 6 | ||||
-rw-r--r-- | src/sdk/installerbase_p.cpp | 90 | ||||
-rw-r--r-- | tools/repogen/repogen.cpp | 69 |
12 files changed, 141 insertions, 52 deletions
diff --git a/dist/config/config.xml b/dist/config/config.xml index 5824b9d8f..e5bf2ffe6 100644 --- a/dist/config/config.xml +++ b/dist/config/config.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <Installer> <Name>Qt Installer Framework</Name> - <Title>Qt Installer Framework 1.4.0</Title> + <Title>Qt Installer Framework 1.4.1</Title> <Version>1.0.0</Version> <Publisher>Qt Project</Publisher> <ProductUrl>http://qt-project.org</ProductUrl> @@ -9,5 +9,5 @@ <UninstallerName>Uninstaller</UninstallerName> <!-- Tweaked for windows in installscript.qs --> - <TargetDir>@homeDir@/Qt/QtIFW-1.4.0</TargetDir> + <TargetDir>@homeDir@/Qt/QtIFW-1.4.1</TargetDir> </Installer> diff --git a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml index a7954497f..ac75cedfa 100644 --- a/dist/packages/org.qtproject.ifw.binaries/meta/package.xml +++ b/dist/packages/org.qtproject.ifw.binaries/meta/package.xml @@ -2,7 +2,7 @@ <Package> <DisplayName>Qt Installer Framework Binaries</DisplayName> <Description>Installs the binaries, examples and help files.</Description> - <Version>1.4.0</Version> + <Version>1.4.1</Version> <ReleaseDate>2013-07-03</ReleaseDate> <Default>True</Default> </Package> diff --git a/dist/packages/org.qtproject.ifw/meta/package.xml b/dist/packages/org.qtproject.ifw/meta/package.xml index dedb672df..443930a45 100644 --- a/dist/packages/org.qtproject.ifw/meta/package.xml +++ b/dist/packages/org.qtproject.ifw/meta/package.xml @@ -2,7 +2,7 @@ <Package> <DisplayName>Qt Installer Framework</DisplayName> <Description>Installs the Qt Installer Framework.</Description> - <Version>1.4.0</Version> + <Version>1.4.1</Version> <ReleaseDate>2013-07-03</ReleaseDate> <Licenses> <License name="LGPL 2.1" file="LICENSE.LGPL" /> diff --git a/doc/installerfw.qdoc b/doc/installerfw.qdoc index 682bca95a..baf6f1261 100644 --- a/doc/installerfw.qdoc +++ b/doc/installerfw.qdoc @@ -441,7 +441,7 @@ \row \o AutoDependOn \o Opposite of dependencies. Defines that this component should be - loaded if the specified component is loaded. + loaded if all of the specified components are loaded. \row \o Virtual \o Set to \c true to hide the component from the installer. diff --git a/src/libs/installer/binaryformat.cpp b/src/libs/installer/binaryformat.cpp index 1d257a1b4..b07cc90de 100644 --- a/src/libs/installer/binaryformat.cpp +++ b/src/libs/installer/binaryformat.cpp @@ -855,7 +855,7 @@ BinaryContent BinaryContent::readFromApplicationFile() { #ifdef Q_OS_MAC // On Mac, data is always in a separate file so that the binary can be signed - QDir dataPath(QCoreApplication::applicationFilePath()); + QDir dataPath(QCoreApplication::applicationDirPath()); dataPath.cdUp(); dataPath.cd(QLatin1String("Resources")); return BinaryContent::readFromBinary(dataPath.filePath(QLatin1String("installer.dat"))); diff --git a/src/libs/installer/resources/files-to-patch-linux-emb-arm b/src/libs/installer/resources/files-to-patch-linux-emb-arm index c01fe17a1..f6a4b59b7 100644 --- a/src/libs/installer/resources/files-to-patch-linux-emb-arm +++ b/src/libs/installer/resources/files-to-patch-linux-emb-arm @@ -1,6 +1,9 @@ bin/qmake bin/lrelease bin/qdoc +host-bin/qmake +host-bin/lrelease +host-bin/qdoc %% *.la *.prl diff --git a/src/libs/installer/resources/files-to-patch-macx-emb-arm b/src/libs/installer/resources/files-to-patch-macx-emb-arm new file mode 100644 index 000000000..c01fe17a1 --- /dev/null +++ b/src/libs/installer/resources/files-to-patch-macx-emb-arm @@ -0,0 +1,9 @@ +bin/qmake +bin/lrelease +bin/qdoc +%% +*.la +*.prl +*.pc + + diff --git a/src/libs/installer/resources/files-to-patch-windows-emb-arm b/src/libs/installer/resources/files-to-patch-windows-emb-arm index f0c1c3c73..674adaff6 100644 --- a/src/libs/installer/resources/files-to-patch-windows-emb-arm +++ b/src/libs/installer/resources/files-to-patch-windows-emb-arm @@ -1,6 +1,9 @@ bin/qmake.exe bin/lrelease.exe bin/qdoc.exe +host-bin/qmake.exe +host-bin/lrelease.exe +host-bin/qdoc.exe %% *.la *.prl diff --git a/src/libs/installer/resources/patch_file_lists.qrc b/src/libs/installer/resources/patch_file_lists.qrc index fe4b77046..e898b9b23 100644 --- a/src/libs/installer/resources/patch_file_lists.qrc +++ b/src/libs/installer/resources/patch_file_lists.qrc @@ -8,5 +8,6 @@ <file>files-to-patch-macx-qt5</file> <file>files-to-patch-linux-emb-arm</file> <file>files-to-patch-windows-emb-arm</file> + <file>files-to-patch-macx-emb-arm</file> </qresource> </RCC> diff --git a/src/libs/kdtools/kdupdaterfiledownloader.cpp b/src/libs/kdtools/kdupdaterfiledownloader.cpp index 19ba204c0..95b574b2f 100644 --- a/src/libs/kdtools/kdupdaterfiledownloader.cpp +++ b/src/libs/kdtools/kdupdaterfiledownloader.cpp @@ -979,6 +979,12 @@ void KDUpdater::HttpDownloader::httpReqFinished() void KDUpdater::HttpDownloader::httpReadProgress(qint64 done, qint64 total) { + if (d->http) { + const QUrl redirectUrl = d->http->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl(); + if (followRedirects() && redirectUrl.isValid()) + return; // if we are a redirection, do not emit the progress + } + setProgress(done, total); emit downloadProgress(calcProgress(done, total)); } diff --git a/src/sdk/installerbase_p.cpp b/src/sdk/installerbase_p.cpp index 0d59e541e..6e4002f30 100644 --- a/src/sdk/installerbase_p.cpp +++ b/src/sdk/installerbase_p.cpp @@ -298,59 +298,69 @@ int InstallerBase::replaceMaintenanceToolBinary(QStringList arguments) /* static*/ void InstallerBase::showUsage() { +#define WIDTH1 46 +#define WIDTH2 40 MyApplicationConsole c; std::cout << "Usage: SDKMaintenanceTool [OPTIONS]" << std::endl << std::endl; std::cout << "User:"<<std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --help" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --help" << std::setw(WIDTH2) << "Show commandline usage" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --version" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --version" << std::setw(WIDTH2) << "Show current version" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --checkupdates" << std::setw(40) - << "Check for updates and return an XML file of the available updates" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --proxy" << std::setw(40) - << "Set system proxy on Win and Mac. This option has no effect on Linux." << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --verbose" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --checkupdates" << std::setw(WIDTH2) + << "Check for updates and return an XML file describing" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "the available updates" << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --updater" << std::setw(WIDTH2) + << "Start in updater mode." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --manage-packages" << std::setw(WIDTH2) + << "Start in packagemanager mode." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --proxy" << std::setw(WIDTH2) + << "Set system proxy on Win and Mac." << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "This option has no effect on Linux." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --verbose" << std::setw(WIDTH2) << "Show debug output on the console" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --create-offline-repository" - << std::setw(40) << "Offline installer only: Create a local repository inside the installation " - "directory based on the offline installer's content" << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --create-offline-repository" + << std::setw(WIDTH2) << "Offline installer only: Create a local repository inside the" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "installation directory based on the offline" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "installer's content." << std::endl; std::cout << "\nDeveloper:"<< std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) - << " --runoperation [operationName] [arguments...]" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) + << " --runoperation [OPERATION] [arguments...]" << std::setw(WIDTH2) << "Perform an operation with a list of arguments" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) - << " --undooperation [operationName] [arguments...]" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) + << " --undooperation [OPERATION] [arguments...]" << std::setw(WIDTH2) << "Undo an operation with a list of arguments" <<std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) - << " --script [scriptName]" << std::setw(40) << "Execute a script" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --no-force-installations" - << std::setw(40) << "Enable deselection of forced components" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --addRepository [URI]" - << std::setw(40) << "Add a local or remote repo to the list of user defined repos." << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --addTempRepository [URI]" - << std::setw(40) << "Add a local or remote repo to the list of temporary available repos." - << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --setTempRepository [URI]" - << std::setw(40) << "Set a local or remote repo as tmp repo, it is the only one used during fetch." - << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " " << std::setw(40) << "Note: URI " - "must be prefixed with the protocol, i.e. file:/// , http:// or ftp://" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --show-virtual-components" - << std::setw(40) << "Show virtual components in package manager and updater" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) - << " --binarydatafile [path/to/binary/data/file]" << std::setw(40) << "Use the binary data of " + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) + << " --script [scriptName]" << std::setw(WIDTH2) << "Execute a script" << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --no-force-installations" + << std::setw(WIDTH2) << "Enable deselection of forced components" << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --addRepository [URI]" + << std::setw(WIDTH2) << "Add a local or remote repo to the list of user defined repos." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --addTempRepository [URI]" + << std::setw(WIDTH2) << "Add a local or remote repo to the list of temporary available" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "repos." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --setTempRepository [URI]" + << std::setw(WIDTH2) << "Set a local or remote repo as tmp repo, it is the only one" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "used during fetch." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " " << std::setw(WIDTH2) << "Note: URI " + "must be prefixed with the protocol, i.e. file:///" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "http:// or ftp://. It can consist of multiple" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "addresses separated by comma only." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --show-virtual-components" + << std::setw(WIDTH2) << "Show virtual components in package manager and updater" << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) + << " --binarydatafile [binary_data_file]" << std::setw(WIDTH2) << "Use the binary data of " "another installer or maintenance tool." << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) - << " --update-installerbase [path/to/new/installerbase]" << std::setw(40) + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) + << " --update-installerbase [new_installerbase]" << std::setw(WIDTH2) << "Patch a full installer with a new installer base" << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " --dump-binary-data [OPTION...] -o " - "path" << std::setw(40) << "Dumps the binary content into specified path (offline installer only)" - << std::endl; - std::cout << std::setw(55) << std::setiosflags(std::ios::left) << " -i " - << std::setw(40) << "Path to binary data file, otherwise the current application is assumed to be " - "the input file." << std::endl; + std::cout << std::setw(WIDTH1) << std::setiosflags(std::ios::left) << " --dump-binary-data -i [PATH] -o [PATH]" + << std::setw(WIDTH2) << "Dumps the binary content into specified output path (offline" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "installer only)." << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "Input path pointing to binary data file, if omitted" << std::endl + << std::setw(WIDTH1) << " " << std::setw(WIDTH2) << "the current application is used as input." << std::endl; } /* static*/ diff --git a/tools/repogen/repogen.cpp b/tools/repogen/repogen.cpp index 549fccb05..4273837d2 100644 --- a/tools/repogen/repogen.cpp +++ b/tools/repogen/repogen.cpp @@ -43,10 +43,12 @@ #include <errors.h> #include <fileutils.h> #include <init.h> +#include <kdupdater.h> #include <settings.h> #include <utils.h> #include <lib7z_facade.h> +#include <QDomDocument> #include <QtCore/QDir> #include <QtCore/QDirIterator> #include <QtCore/QFileInfo> @@ -73,12 +75,16 @@ static void printUsage() std::cout << " --update Update a set of existing components (defined by " << std::endl; std::cout << " --include or --exclude) in the repository" << std::endl; + std::cout << " --update-new-components Update a set of existing components (defined by " << std::endl; + std::cout << " --include or --exclude) in the repository with all new components" + << std::endl; + std::cout << " -v|--verbose Verbose output" << std::endl; std::cout << std::endl; std::cout << "Example:" << std::endl; - std::cout << " " << appName << " -p ../examples/packages -u " - "http://www.example.com:8080 repository/" << std::endl; + std::cout << " " << appName << " -p ../examples/packages -u http://www.example.com:8080 repository/" + << std::endl; } static int printErrorAndUsageAndExit(const QString &err) @@ -104,6 +110,7 @@ int main(int argc, char** argv) QStringList packagesDirectories; QInstallerTools::FilterType filterType = QInstallerTools::Exclude; bool remove = false; + bool updateExistingRepositoryWithNewComponents = false; //TODO: use a for loop without removing values from args like it is in binarycreator.cpp //for (QStringList::const_iterator it = args.begin(); it != args.end(); ++it) { @@ -133,6 +140,9 @@ int main(int argc, char** argv) } else if (args.first() == QLatin1String("--update")) { args.removeFirst(); updateExistingRepository = true; + } else if (args.first() == QLatin1String("--update-new-components")) { + args.removeFirst(); + updateExistingRepositoryWithNewComponents = true; } else if (args.first() == QLatin1String("-p") || args.first() == QLatin1String("--packages")) { args.removeFirst(); if (args.isEmpty()) { @@ -168,16 +178,17 @@ int main(int argc, char** argv) return 1; } - if (remove && updateExistingRepository) { - throw QInstaller::Error(QObject::tr("Argument -r|--remove and --update are mutually " - "exclusive!")); + const bool update = updateExistingRepository || updateExistingRepositoryWithNewComponents; + if (remove && update) { + throw QInstaller::Error(QObject::tr("Argument -r|--remove and --update|--update-new-components " + "are mutually exclusive!")); } const QString repositoryDir = QInstallerTools::makePathAbsolute(args.first()); if (remove) QInstaller::removeDirectory(repositoryDir); - if (!updateExistingRepository && QFile::exists(repositoryDir) && !QDir(repositoryDir).entryList( + if (!update && QFile::exists(repositoryDir) && !QDir(repositoryDir).entryList( QDir::AllEntries | QDir::NoDotAndDotDot).isEmpty()) { throw QInstaller::Error(QObject::tr("Repository target folder %1 already exists!") @@ -186,6 +197,52 @@ int main(int argc, char** argv) QInstallerTools::PackageInfoVector packages = QInstallerTools::createListOfPackages(packagesDirectories, &filteredPackages, filterType); + + if (updateExistingRepositoryWithNewComponents) { + QDomDocument doc; + QFile file(repositoryDir + QLatin1String("/Updates.xml")); + if (file.open(QFile::ReadOnly) && doc.setContent(&file)) { + const QDomElement root = doc.documentElement(); + if (root.tagName() != QLatin1String("Updates")) + throw QInstaller::Error(QObject::tr("Invalid content in '%1'.").arg(file.fileName())); + file.close(); // close the file, we read the content already + + // read the already existing updates xml content + const QDomNodeList children = root.childNodes(); + QHash <QString, QInstallerTools::PackageInfo> hash; + for (int i = 0; i < children.count(); ++i) { + const QDomElement el = children.at(i).toElement(); + if ((!el.isNull()) && (el.tagName() == QLatin1String("PackageUpdate"))) { + QInstallerTools::PackageInfo info; + const QDomNodeList c2 = el.childNodes(); + for (int j = 0; j < c2.count(); ++j) { + if (c2.at(j).toElement().tagName() == scName) + info.name = c2.at(j).toElement().text(); + else if (c2.at(j).toElement().tagName() == scRemoteVersion) + info.version = c2.at(j).toElement().text(); + } + hash.insert(info.name, info); + } + } + + // remove all components that have no update (decision based on the version tag) + for (int i = packages.count() - 1; i >= 0; --i) { + const QInstallerTools::PackageInfo info = packages.at(i); + if (!hash.contains(info.name)) + continue; // the component is not there, keep it + + if (KDUpdater::compareVersion(info.version, hash.value(info.name).version) < 1) + packages.remove(i); // the version did not change, no need to update the component + } + + if (packages.isEmpty()) { + std::cout << QString::fromLatin1("Could not find new components to update '%1'.") + .arg(repositoryDir); + return EXIT_SUCCESS; + } + } + } + QHash<QString, QString> pathToVersionMapping = QInstallerTools::buildPathToVersionMapping(packages); foreach (const QInstallerTools::PackageInfo &package, packages) { |