summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortjenssen <tim.jenssen@nokia.com>2012-03-13 16:16:36 +0100
committerKarsten Heimrich <karsten.heimrich@nokia.com>2012-03-13 17:35:42 +0100
commit9dfa0c6e7221906f07927266f4f2c91405fa7acd (patch)
treee61651ee92aac29cca2f706c0af7e487e0482557
parent640c7e6fb8ab113edb69455d75d3bc05856fdf0f (diff)
remove unused methods in repositorygen.cpp
Change-Id: I5ff1a0580fec21e23fe262a6f605ba5eb76e0bd3 Reviewed-by: Karsten Heimrich <karsten.heimrich@nokia.com>
-rw-r--r--installerbuilder/common/repositorygen.cpp99
1 files changed, 0 insertions, 99 deletions
diff --git a/installerbuilder/common/repositorygen.cpp b/installerbuilder/common/repositorygen.cpp
index 0f2f174da..b4610f3a4 100644
--- a/installerbuilder/common/repositorygen.cpp
+++ b/installerbuilder/common/repositorygen.cpp
@@ -98,105 +98,6 @@ static PackageInfo findMatchingPackage(const QString &name, const PackageInfoVec
return PackageInfo();
}
-/*!
- Returns true, when the \a package's identifier starts with, but not equals \a prefix.
-*/
-static bool packageHasPrefix(const PackageInfo &package, const QString &prefix)
-{
- return package.name.startsWith(prefix)
- && package.name.mid(prefix.length(), 1) == QLatin1String(".");
-}
-
-/*!
- Returns true, when all \a packages start with \a prefix
-*/
-static bool allPackagesHavePrefix(const PackageInfoVector &packages, const QString &prefix)
-{
- for (PackageInfoVector::const_iterator it = packages.begin(); it != packages.end(); ++it) {
- if (!packageHasPrefix(*it, prefix))
- return false;
- }
- return true;
-}
-
-/*!
- Returns all packages out of \a all starting with \a prefix.
-*/
-static PackageInfoVector packagesWithPrefix(const PackageInfoVector &all, const QString &prefix)
-{
- PackageInfoVector result;
- for (PackageInfoVector::const_iterator it = all.begin(); it != all.end(); ++it) {
- if (packageHasPrefix(*it, prefix))
- result.push_back(*it);
- }
- return result;
-}
-
-static PackageInfoVector calculateNeededPackages(const QStringList &components,
- const PackageInfoVector &available, bool addDependencies = true)
-{
- PackageInfoVector result;
-
- for (QStringList::const_iterator it = components.begin(); it != components.end(); ++it) {
- static bool recursion = false;
- static QStringList hitComponents;
-
- if (!recursion)
- hitComponents.clear();
-
- if (hitComponents.contains(*it))
- throw Error(QObject::tr("Circular dependencies detected.").arg(*it));
- hitComponents.push_back(*it);
-
- recursion = true;
-
- qDebug() << "Trying to find a package for name" << *it << "... ";
- const PackageInfo info = findMatchingPackage(*it, available);
- if (info.name.isEmpty()) {
- qDebug() << "Not found :-o";
- qDebug() << "\tCouldn't find package for component " << *it << " bailing out...";
- throw Error(QObject::tr("Couldn't find package for component %1.").arg(*it));
- }
- qDebug() << "Found.";
- if (!result.contains(info)) {
- result.push_back(info);
-
- if (addDependencies) {
- PackageInfoVector dependencies;
-
- if (!info.dependencies.isEmpty()) {
- qDebug() << "\tIt depends on:";
- for (QStringList::const_iterator dep = info.dependencies.begin();
- dep != info.dependencies.end(); ++dep) {
- qDebug() << "\t\t" << *dep;
- }
- dependencies += calculateNeededPackages(info.dependencies, available);
- }
- // append all child items, as this package was requested explicitly
- dependencies += packagesWithPrefix(available, info.name);
-
- for (PackageInfoVector::const_iterator dep = dependencies.begin();
- dep != dependencies.end(); ++dep) {
- if (result.contains(*dep))
- continue;
-
- result += *dep;
- const PackageInfoVector depdeps = calculateNeededPackages(QStringList()
- << dep->name, available);
- for (PackageInfoVector::const_iterator dep2 = depdeps.begin();
- dep2 != depdeps.end(); ++dep2)
- if (!result.contains(*dep2))
- result += *dep2;
- }
- }
- }
-
- recursion = false;
- }
-
- return result;
-}
-
void QInstaller::compressDirectory(const QStringList &paths, const QString &archivePath)
{
foreach (const QString &path, paths) {