Adapt to changes in c++utilities
This commit is contained in:
parent
d3aed9cb74
commit
fa81042d86
11
cli/main.cpp
11
cli/main.cpp
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <c++utilities/application/argumentparser.h>
|
#include <c++utilities/application/argumentparser.h>
|
||||||
#include <c++utilities/conversion/stringconversion.h>
|
#include <c++utilities/conversion/stringconversion.h>
|
||||||
#include <c++utilities/application/failure.h>
|
#include <c++utilities/misc/parseerror.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ApplicationUtilities;
|
using namespace CppUtilities;
|
||||||
using namespace RepoIndex;
|
using namespace RepoIndex;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -33,12 +33,7 @@ int main(int argc, char *argv[])
|
||||||
ArgumentParser parser;
|
ArgumentParser parser;
|
||||||
ConfigArgs configArgs(parser);
|
ConfigArgs configArgs(parser);
|
||||||
// parse command line arguments
|
// parse command line arguments
|
||||||
try {
|
parser.parseArgs(argc, argv);
|
||||||
parser.parseArgs(argc, argv);
|
|
||||||
} catch (const Failure &e) {
|
|
||||||
cerr << shchar << "Unable to parse arguments: " << e.what() << endl;
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// load configuration
|
// load configuration
|
||||||
Config config;
|
Config config;
|
||||||
|
|
10
gui/main.cpp
10
gui/main.cpp
|
@ -13,14 +13,13 @@
|
||||||
|
|
||||||
#include <c++utilities/application/argumentparser.h>
|
#include <c++utilities/application/argumentparser.h>
|
||||||
#include <c++utilities/conversion/stringconversion.h>
|
#include <c++utilities/conversion/stringconversion.h>
|
||||||
#include <c++utilities/application/failure.h>
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ApplicationUtilities;
|
using namespace CppUtilities;
|
||||||
using namespace RepoIndex;
|
using namespace RepoIndex;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
|
@ -40,12 +39,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &configArgs.repoindexConfArg, &configArgs.repoindexConfArg, &webdirArg, &configArgs.cacheDirArg, &configArgs.storageDirArg, &configArgs.helpArg});
|
parser.setMainArguments({&qtConfigArgs.qtWidgetsGuiArg(), &configArgs.repoindexConfArg, &configArgs.repoindexConfArg, &webdirArg, &configArgs.cacheDirArg, &configArgs.storageDirArg, &configArgs.helpArg});
|
||||||
// parse command line arguments
|
// parse command line arguments
|
||||||
try {
|
parser.parseArgs(argc, argv, ParseArgumentBehavior::CheckConstraints | ParseArgumentBehavior::InvokeCallbacks);
|
||||||
parser.parseArgs(argc, argv);
|
|
||||||
} catch (const Failure &e) {
|
|
||||||
cerr << shchar << "Unable to parse arguments: " << e.what() << endl;
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// load configuration
|
// load configuration
|
||||||
Config config;
|
Config config;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ private:
|
||||||
const DateTime m_descriptionsLastModified;
|
const DateTime m_descriptionsLastModified;
|
||||||
};
|
};
|
||||||
|
|
||||||
DatabaseError AlpmDatabase::loadDescriptions(QList<QPair<QString, QList<QByteArray> > > &descriptions, ChronoUtilities::DateTime *lastModified)
|
DatabaseError AlpmDatabase::loadDescriptions(QList<QPair<QString, QList<QByteArray> > > &descriptions, CppUtilities::DateTime *lastModified)
|
||||||
{
|
{
|
||||||
if(!databasePath().isEmpty()) {
|
if(!databasePath().isEmpty()) {
|
||||||
QFileInfo pathInfo(databasePath());
|
QFileInfo pathInfo(databasePath());
|
||||||
|
|
|
@ -38,7 +38,7 @@ private:
|
||||||
AlpmDatabase *const m_db;
|
AlpmDatabase *const m_db;
|
||||||
DatabaseError m_error;
|
DatabaseError m_error;
|
||||||
QList<QPair<QString, QList<QByteArray> > > m_descriptions;
|
QList<QPair<QString, QList<QByteArray> > > m_descriptions;
|
||||||
ChronoUtilities::DateTime m_descriptionsLastModified;
|
CppUtilities::DateTime m_descriptionsLastModified;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -84,7 +84,7 @@ private slots:
|
||||||
void databaseDownloadFinished();
|
void databaseDownloadFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DatabaseError loadDescriptions(QList<QPair<QString, QList<QByteArray> > > &descriptions, ChronoUtilities::DateTime *lastModified = nullptr);
|
DatabaseError loadDescriptions(QList<QPair<QString, QList<QByteArray> > > &descriptions, CppUtilities::DateTime *lastModified = nullptr);
|
||||||
QNetworkRequest regularDatabaseRequest();
|
QNetworkRequest regularDatabaseRequest();
|
||||||
QNetworkRequest filesDatabaseRequest();
|
QNetworkRequest filesDatabaseRequest();
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <QJsonObject>
|
#include <QJsonObject>
|
||||||
|
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ApplicationUtilities;
|
using namespace CppUtilities;
|
||||||
using namespace ConversionUtilities;
|
|
||||||
using namespace ChronoUtilities;
|
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
@ -65,7 +63,7 @@ ConfigArgs::ConfigArgs(ArgumentParser &parser) :
|
||||||
{
|
{
|
||||||
const initializer_list<const char *> pathValueName = {"path"};
|
const initializer_list<const char *> pathValueName = {"path"};
|
||||||
const initializer_list<const char *> pkgValueNames = {"package 1", "package 2", "package 3"};
|
const initializer_list<const char *> pkgValueNames = {"package 1", "package 2", "package 3"};
|
||||||
packagesArg.setRequiredValueCount(-1);
|
packagesArg.setRequiredValueCount(Argument::varValueCount);
|
||||||
packagesArg.setRequired(true);
|
packagesArg.setRequired(true);
|
||||||
packagesArg.setImplicit(true);
|
packagesArg.setImplicit(true);
|
||||||
packagesArg.setValueNames(pkgValueNames);
|
packagesArg.setValueNames(pkgValueNames);
|
||||||
|
@ -129,10 +127,10 @@ ConfigArgs::ConfigArgs(ArgumentParser &parser) :
|
||||||
defaultIconThemeArg.setRequiredValueCount(1);
|
defaultIconThemeArg.setRequiredValueCount(1);
|
||||||
defaultIconThemeArg.setValueNames({"theme name"});
|
defaultIconThemeArg.setValueNames({"theme name"});
|
||||||
extraPackagesArg.setCombinable(true);
|
extraPackagesArg.setCombinable(true);
|
||||||
extraPackagesArg.setRequiredValueCount(-1);
|
extraPackagesArg.setRequiredValueCount(Argument::varValueCount);
|
||||||
extraPackagesArg.setValueNames(pkgValueNames);
|
extraPackagesArg.setValueNames(pkgValueNames);
|
||||||
qtPluginsArg.setCombinable(true);
|
qtPluginsArg.setCombinable(true);
|
||||||
qtPluginsArg.setRequiredValueCount(-1);
|
qtPluginsArg.setRequiredValueCount(Argument::varValueCount);
|
||||||
qtPluginsArg.setValueNames({"plugin 1", "plugin 2"});
|
qtPluginsArg.setValueNames({"plugin 1", "plugin 2"});
|
||||||
addSourceOnlyDepsArg.setCombinable(true);
|
addSourceOnlyDepsArg.setCombinable(true);
|
||||||
shSyntaxArg.setCombinable(true);
|
shSyntaxArg.setCombinable(true);
|
||||||
|
@ -265,7 +263,7 @@ void Config::loadFromConfigFile(const QString &configFilePath)
|
||||||
auto reposObj = mainObj.value(QStringLiteral("repos")).toObject();
|
auto reposObj = mainObj.value(QStringLiteral("repos")).toObject();
|
||||||
m_localEnabled = reposObj.value(QStringLiteral("localEnabled")).toBool(m_localEnabled);
|
m_localEnabled = reposObj.value(QStringLiteral("localEnabled")).toBool(m_localEnabled);
|
||||||
m_reposFromPacmanConfEnabled = reposObj.value(QStringLiteral("fromPacmanConfig")).toBool(m_reposFromPacmanConfEnabled);
|
m_reposFromPacmanConfEnabled = reposObj.value(QStringLiteral("fromPacmanConfig")).toBool(m_reposFromPacmanConfEnabled);
|
||||||
for(const auto &repo : reposObj.value(QStringLiteral("add")).toArray()) {
|
for(const auto repo : reposObj.value(QStringLiteral("add")).toArray()) {
|
||||||
m_repoEntries << RepoEntry();
|
m_repoEntries << RepoEntry();
|
||||||
m_repoEntries.back().load(repo);
|
m_repoEntries.back().load(repo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ QT_FORWARD_DECLARE_CLASS(QJsonValue)
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
enum class SignatureLevel;
|
enum class SignatureLevel : unsigned int;
|
||||||
|
|
||||||
// these are needed from the beginning and are initialized in the main()
|
// these are needed from the beginning and are initialized in the main()
|
||||||
extern bool useShSyntax;
|
extern bool useShSyntax;
|
||||||
|
@ -21,39 +21,39 @@ extern const char *shchar;
|
||||||
class ConfigArgs
|
class ConfigArgs
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConfigArgs(ApplicationUtilities::ArgumentParser &parser);
|
ConfigArgs(CppUtilities::ArgumentParser &parser);
|
||||||
ApplicationUtilities::HelpArgument helpArg;
|
CppUtilities::HelpArgument helpArg;
|
||||||
ApplicationUtilities::Argument packagesArg;
|
CppUtilities::Argument packagesArg;
|
||||||
ApplicationUtilities::Argument buildOrderArg;
|
CppUtilities::Argument buildOrderArg;
|
||||||
ApplicationUtilities::Argument addSourceOnlyDepsArg;
|
CppUtilities::Argument addSourceOnlyDepsArg;
|
||||||
ApplicationUtilities::Argument requireSourcesArg;
|
CppUtilities::Argument requireSourcesArg;
|
||||||
ApplicationUtilities::Argument serverArg;
|
CppUtilities::Argument serverArg;
|
||||||
ApplicationUtilities::Argument repoNameArg;
|
CppUtilities::Argument repoNameArg;
|
||||||
ApplicationUtilities::Argument upgradeLookupArg;
|
CppUtilities::Argument upgradeLookupArg;
|
||||||
ApplicationUtilities::Argument mingwBundleArg;
|
CppUtilities::Argument mingwBundleArg;
|
||||||
ApplicationUtilities::Argument repoindexConfArg;
|
CppUtilities::Argument repoindexConfArg;
|
||||||
ApplicationUtilities::Argument rootdirArg;
|
CppUtilities::Argument rootdirArg;
|
||||||
ApplicationUtilities::Argument dbpathArg;
|
CppUtilities::Argument dbpathArg;
|
||||||
ApplicationUtilities::Argument pacmanConfArg;
|
CppUtilities::Argument pacmanConfArg;
|
||||||
ApplicationUtilities::Argument reposFromPacmanConfEnabled;
|
CppUtilities::Argument reposFromPacmanConfEnabled;
|
||||||
ApplicationUtilities::Argument websocketAddrArg;
|
CppUtilities::Argument websocketAddrArg;
|
||||||
ApplicationUtilities::Argument websocketPortArg;
|
CppUtilities::Argument websocketPortArg;
|
||||||
ApplicationUtilities::Argument certFileArg;
|
CppUtilities::Argument certFileArg;
|
||||||
ApplicationUtilities::Argument keyFileArg;
|
CppUtilities::Argument keyFileArg;
|
||||||
ApplicationUtilities::Argument insecureArg;
|
CppUtilities::Argument insecureArg;
|
||||||
ApplicationUtilities::Argument aurArg;
|
CppUtilities::Argument aurArg;
|
||||||
ApplicationUtilities::Argument verboseArg;
|
CppUtilities::Argument verboseArg;
|
||||||
ApplicationUtilities::Argument outputFileArg;
|
CppUtilities::Argument outputFileArg;
|
||||||
ApplicationUtilities::Argument targetDirArg;
|
CppUtilities::Argument targetDirArg;
|
||||||
ApplicationUtilities::Argument targetNameArg;
|
CppUtilities::Argument targetNameArg;
|
||||||
ApplicationUtilities::Argument targetFormatArg;
|
CppUtilities::Argument targetFormatArg;
|
||||||
ApplicationUtilities::Argument iconThemesArg;
|
CppUtilities::Argument iconThemesArg;
|
||||||
ApplicationUtilities::Argument defaultIconThemeArg;
|
CppUtilities::Argument defaultIconThemeArg;
|
||||||
ApplicationUtilities::Argument extraPackagesArg;
|
CppUtilities::Argument extraPackagesArg;
|
||||||
ApplicationUtilities::Argument qtPluginsArg;
|
CppUtilities::Argument qtPluginsArg;
|
||||||
ApplicationUtilities::Argument cacheDirArg;
|
CppUtilities::Argument cacheDirArg;
|
||||||
ApplicationUtilities::Argument storageDirArg;
|
CppUtilities::Argument storageDirArg;
|
||||||
ApplicationUtilities::Argument shSyntaxArg;
|
CppUtilities::Argument shSyntaxArg;
|
||||||
};
|
};
|
||||||
|
|
||||||
class Config;
|
class Config;
|
||||||
|
@ -70,7 +70,7 @@ public:
|
||||||
const QStringList &server() const;
|
const QStringList &server() const;
|
||||||
const QStringList &upgradeSources() const;
|
const QStringList &upgradeSources() const;
|
||||||
SignatureLevel sigLevel() const;
|
SignatureLevel sigLevel() const;
|
||||||
ChronoUtilities::TimeSpan maxDatabaseAge() const;
|
CppUtilities::TimeSpan maxDatabaseAge() const;
|
||||||
bool isIgnored() const;
|
bool isIgnored() const;
|
||||||
void load(const QJsonValue &jsonValue);
|
void load(const QJsonValue &jsonValue);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ private:
|
||||||
QStringList m_server;
|
QStringList m_server;
|
||||||
QStringList m_upgradeSources;
|
QStringList m_upgradeSources;
|
||||||
SignatureLevel m_sigLevel;
|
SignatureLevel m_sigLevel;
|
||||||
ChronoUtilities::TimeSpan m_maxDatabaseAge;
|
CppUtilities::TimeSpan m_maxDatabaseAge;
|
||||||
bool m_ignored;
|
bool m_ignored;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ inline SignatureLevel RepoEntry::sigLevel() const
|
||||||
return m_sigLevel;
|
return m_sigLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ChronoUtilities::TimeSpan RepoEntry::maxDatabaseAge() const
|
inline CppUtilities::TimeSpan RepoEntry::maxDatabaseAge() const
|
||||||
{
|
{
|
||||||
return m_maxDatabaseAge;
|
return m_maxDatabaseAge;
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,8 +26,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace IoUtilities;
|
using namespace CppUtilities;
|
||||||
using namespace ConversionUtilities;
|
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ApplicationUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ void makeArchive(const list<PkgFileInfo> &pkgFiles, const QByteArray &pkgList, c
|
||||||
targetArchive = make_unique<K7Zip>(targetPath);
|
targetArchive = make_unique<K7Zip>(targetPath);
|
||||||
} else if(targetFormat == "zip") {
|
} else if(targetFormat == "zip") {
|
||||||
targetArchive = make_unique<KZip>(targetPath);
|
targetArchive = make_unique<KZip>(targetPath);
|
||||||
} else if(ConversionUtilities::startsWith<string>(targetFormat, "tar")) {
|
} else if(startsWith<string>(targetFormat, "tar")) {
|
||||||
targetArchive = make_unique<KTar>(targetPath);
|
targetArchive = make_unique<KTar>(targetPath);
|
||||||
} else {
|
} else {
|
||||||
throw runtime_error("Specified archive format \"" + targetFormat + "\" is unknown.");
|
throw runtime_error("Specified archive format \"" + targetFormat + "\" is unknown.");
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace std::placeholders;
|
using namespace std::placeholders;
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ inline PackageValidation &operator &=(PackageValidation &lhs, int rhs)
|
||||||
/*!
|
/*!
|
||||||
* \brief The SignatureLevel enum specifies PGP signature verification options.
|
* \brief The SignatureLevel enum specifies PGP signature verification options.
|
||||||
*/
|
*/
|
||||||
enum class SignatureLevel {
|
enum class SignatureLevel : unsigned int {
|
||||||
Package = (1 << 0),
|
Package = (1 << 0),
|
||||||
PackageOptional = (1 << 1),
|
PackageOptional = (1 << 1),
|
||||||
PackageMarginalOk = (1 << 2),
|
PackageMarginalOk = (1 << 2),
|
||||||
|
@ -124,7 +124,7 @@ enum class SignatureLevel {
|
||||||
DatabaseMarginalOk = (1 << 12),
|
DatabaseMarginalOk = (1 << 12),
|
||||||
DatabaseUnknownOk = (1 << 13),
|
DatabaseUnknownOk = (1 << 13),
|
||||||
|
|
||||||
UseDefault = (1 << 31)
|
UseDefault = (1u << 31)
|
||||||
};
|
};
|
||||||
|
|
||||||
constexpr SignatureLevel operator |(SignatureLevel lhs, SignatureLevel rhs)
|
constexpr SignatureLevel operator |(SignatureLevel lhs, SignatureLevel rhs)
|
||||||
|
@ -238,8 +238,8 @@ public:
|
||||||
// general package meta data
|
// general package meta data
|
||||||
PackageOrigin origin() const;
|
PackageOrigin origin() const;
|
||||||
Repository *repository() const;
|
Repository *repository() const;
|
||||||
ChronoUtilities::DateTime timeStamp() const;
|
CppUtilities::DateTime timeStamp() const;
|
||||||
void setTimeStamp(ChronoUtilities::DateTime timeStamp);
|
void setTimeStamp(CppUtilities::DateTime timeStamp);
|
||||||
bool hasGeneralInfo() const;
|
bool hasGeneralInfo() const;
|
||||||
bool hasAllGeneralInfo() const;
|
bool hasAllGeneralInfo() const;
|
||||||
const QString &name() const;
|
const QString &name() const;
|
||||||
|
@ -266,7 +266,7 @@ public:
|
||||||
bool hasBuildRelatedMetaData() const;
|
bool hasBuildRelatedMetaData() const;
|
||||||
const QString &fileName() const;
|
const QString &fileName() const;
|
||||||
const QJsonArray &files() const;
|
const QJsonArray &files() const;
|
||||||
ChronoUtilities::DateTime buildDate() const;
|
CppUtilities::DateTime buildDate() const;
|
||||||
const QString &packager() const;
|
const QString &packager() const;
|
||||||
const QString &md5() const;
|
const QString &md5() const;
|
||||||
const QString &sha256() const;
|
const QString &sha256() const;
|
||||||
|
@ -277,7 +277,7 @@ public:
|
||||||
|
|
||||||
// installation related meta data
|
// installation related meta data
|
||||||
bool hasInstallRelatedMetaData() const;
|
bool hasInstallRelatedMetaData() const;
|
||||||
ChronoUtilities::DateTime installDate() const;
|
CppUtilities::DateTime installDate() const;
|
||||||
std::uint32_t installedSize() const;
|
std::uint32_t installedSize() const;
|
||||||
const QStringList &backupFiles() const;
|
const QStringList &backupFiles() const;
|
||||||
PackageValidation validationMethods() const;
|
PackageValidation validationMethods() const;
|
||||||
|
@ -290,10 +290,10 @@ public:
|
||||||
std::int32_t id() const;
|
std::int32_t id() const;
|
||||||
std::int32_t categoryId() const;
|
std::int32_t categoryId() const;
|
||||||
std::int32_t votes() const;
|
std::int32_t votes() const;
|
||||||
ChronoUtilities::DateTime outOfDate() const;
|
CppUtilities::DateTime outOfDate() const;
|
||||||
const QString &maintainer() const;
|
const QString &maintainer() const;
|
||||||
ChronoUtilities::DateTime firstSubmitted() const;
|
CppUtilities::DateTime firstSubmitted() const;
|
||||||
ChronoUtilities::DateTime lastModified() const;
|
CppUtilities::DateTime lastModified() const;
|
||||||
const QString &tarUrl() const;
|
const QString &tarUrl() const;
|
||||||
const std::map<QString, QByteArray> &sourceFiles() const;
|
const std::map<QString, QByteArray> &sourceFiles() const;
|
||||||
QList<const QList<Dependency> *> allDependencies() const;
|
QList<const QList<Dependency> *> allDependencies() const;
|
||||||
|
@ -326,7 +326,7 @@ protected:
|
||||||
|
|
||||||
PackageOrigin m_origin;
|
PackageOrigin m_origin;
|
||||||
Repository *m_repository;
|
Repository *m_repository;
|
||||||
ChronoUtilities::DateTime m_timeStamp;
|
CppUtilities::DateTime m_timeStamp;
|
||||||
|
|
||||||
// general package meta data
|
// general package meta data
|
||||||
bool m_hasGeneralInfo;
|
bool m_hasGeneralInfo;
|
||||||
|
@ -351,7 +351,7 @@ protected:
|
||||||
bool m_hasBuildRelatedMetaData;
|
bool m_hasBuildRelatedMetaData;
|
||||||
QString m_fileName;
|
QString m_fileName;
|
||||||
QJsonArray m_files;
|
QJsonArray m_files;
|
||||||
ChronoUtilities::DateTime m_buildDate;
|
CppUtilities::DateTime m_buildDate;
|
||||||
QString m_packager;
|
QString m_packager;
|
||||||
QString m_md5;
|
QString m_md5;
|
||||||
QString m_sha256;
|
QString m_sha256;
|
||||||
|
@ -363,7 +363,7 @@ protected:
|
||||||
|
|
||||||
// installation related meta data
|
// installation related meta data
|
||||||
bool m_hasInstallRelatedMetaData;
|
bool m_hasInstallRelatedMetaData;
|
||||||
ChronoUtilities::DateTime m_installDate;
|
CppUtilities::DateTime m_installDate;
|
||||||
std::uint32_t m_installedSize;
|
std::uint32_t m_installedSize;
|
||||||
QStringList m_backupFiles;
|
QStringList m_backupFiles;
|
||||||
PackageValidation m_validationMethods;
|
PackageValidation m_validationMethods;
|
||||||
|
@ -376,10 +376,10 @@ protected:
|
||||||
std::int32_t m_id;
|
std::int32_t m_id;
|
||||||
std::int32_t m_categoryId;
|
std::int32_t m_categoryId;
|
||||||
std::int32_t m_votes;
|
std::int32_t m_votes;
|
||||||
ChronoUtilities::DateTime m_outOfDate;
|
CppUtilities::DateTime m_outOfDate;
|
||||||
QString m_maintainer;
|
QString m_maintainer;
|
||||||
ChronoUtilities::DateTime m_firstSubmitted;
|
CppUtilities::DateTime m_firstSubmitted;
|
||||||
ChronoUtilities::DateTime m_lastModified;
|
CppUtilities::DateTime m_lastModified;
|
||||||
QString m_tarUrl;
|
QString m_tarUrl;
|
||||||
std::map<QString, QByteArray> m_sourceFiles;
|
std::map<QString, QByteArray> m_sourceFiles;
|
||||||
|
|
||||||
|
@ -433,7 +433,7 @@ inline Repository *Package::repository() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the package's timestamp.
|
* \brief Returns the package's timestamp.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::timeStamp() const
|
inline CppUtilities::DateTime Package::timeStamp() const
|
||||||
{
|
{
|
||||||
return m_timeStamp;
|
return m_timeStamp;
|
||||||
}
|
}
|
||||||
|
@ -441,7 +441,7 @@ inline ChronoUtilities::DateTime Package::timeStamp() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Sets the package's timestamp.
|
* \brief Sets the package's timestamp.
|
||||||
*/
|
*/
|
||||||
inline void Package::setTimeStamp(ChronoUtilities::DateTime timeStamp)
|
inline void Package::setTimeStamp(CppUtilities::DateTime timeStamp)
|
||||||
{
|
{
|
||||||
m_timeStamp = timeStamp;
|
m_timeStamp = timeStamp;
|
||||||
}
|
}
|
||||||
|
@ -637,7 +637,7 @@ inline const QJsonArray &Package::files() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the build date of the package file.
|
* \brief Returns the build date of the package file.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::buildDate() const
|
inline CppUtilities::DateTime Package::buildDate() const
|
||||||
{
|
{
|
||||||
return m_buildDate;
|
return m_buildDate;
|
||||||
}
|
}
|
||||||
|
@ -715,7 +715,7 @@ inline bool Package::hasInstallRelatedMetaData() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the install date.
|
* \brief Returns the install date.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::installDate() const
|
inline CppUtilities::DateTime Package::installDate() const
|
||||||
{
|
{
|
||||||
return m_installDate;
|
return m_installDate;
|
||||||
}
|
}
|
||||||
|
@ -808,7 +808,7 @@ inline std::int32_t Package::votes() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the flag date.
|
* \brief Returns the flag date.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::outOfDate() const
|
inline CppUtilities::DateTime Package::outOfDate() const
|
||||||
{
|
{
|
||||||
return m_outOfDate;
|
return m_outOfDate;
|
||||||
}
|
}
|
||||||
|
@ -824,7 +824,7 @@ inline const QString &Package::maintainer() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns when the package was first submitted.
|
* \brief Returns when the package was first submitted.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::firstSubmitted() const
|
inline CppUtilities::DateTime Package::firstSubmitted() const
|
||||||
{
|
{
|
||||||
return m_firstSubmitted;
|
return m_firstSubmitted;
|
||||||
}
|
}
|
||||||
|
@ -832,7 +832,7 @@ inline ChronoUtilities::DateTime Package::firstSubmitted() const
|
||||||
/*!
|
/*!
|
||||||
* \brief Returns the last time when the package was modified.
|
* \brief Returns the last time when the package was modified.
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::DateTime Package::lastModified() const
|
inline CppUtilities::DateTime Package::lastModified() const
|
||||||
{
|
{
|
||||||
return m_lastModified;
|
return m_lastModified;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
@ -863,7 +863,7 @@ void Repository::parseDescriptions(const QList<QByteArray> &descriptions, QStrin
|
||||||
* \returns Returns the added/updated packages. In the case of a split package more then
|
* \returns Returns the added/updated packages. In the case of a split package more then
|
||||||
* one package is returned.
|
* one package is returned.
|
||||||
*/
|
*/
|
||||||
QList<Package *> Repository::addPackagesFromSrcInfo(const QByteArray &srcInfo, ChronoUtilities::DateTime timeStamp)
|
QList<Package *> Repository::addPackagesFromSrcInfo(const QByteArray &srcInfo, CppUtilities::DateTime timeStamp)
|
||||||
{
|
{
|
||||||
// define states
|
// define states
|
||||||
enum {
|
enum {
|
||||||
|
|
|
@ -264,8 +264,8 @@ public:
|
||||||
virtual void writeSpecificCacheHeader(QDataStream &out);
|
virtual void writeSpecificCacheHeader(QDataStream &out);
|
||||||
virtual std::unique_ptr<Package> emptyPackage();
|
virtual std::unique_ptr<Package> emptyPackage();
|
||||||
virtual void restoreSpecificCacheHeader(QDataStream &in);
|
virtual void restoreSpecificCacheHeader(QDataStream &in);
|
||||||
ChronoUtilities::TimeSpan maxPackageAge() const;
|
CppUtilities::TimeSpan maxPackageAge() const;
|
||||||
void setMaxPackageAge(ChronoUtilities::TimeSpan maxPackageAge);
|
void setMaxPackageAge(CppUtilities::TimeSpan maxPackageAge);
|
||||||
void cleanOutdatedPackages();
|
void cleanOutdatedPackages();
|
||||||
bool hasOutdatedPackages();
|
bool hasOutdatedPackages();
|
||||||
void wipePackages();
|
void wipePackages();
|
||||||
|
@ -273,8 +273,8 @@ public:
|
||||||
// parsing src/pkg info
|
// parsing src/pkg info
|
||||||
static void parsePkgInfo(const QByteArray &pkgInfo, QString &name, QList<QPair<QString, QString> > packageInfo);
|
static void parsePkgInfo(const QByteArray &pkgInfo, QString &name, QList<QPair<QString, QString> > packageInfo);
|
||||||
static void parseDescriptions(const QList<QByteArray> &descriptions, QString &name, QList<QPair<QString, QStringList> > &fields);
|
static void parseDescriptions(const QList<QByteArray> &descriptions, QString &name, QList<QPair<QString, QStringList> > &fields);
|
||||||
QList<Package *> addPackagesFromSrcInfo(const QByteArray &srcInfo, ChronoUtilities::DateTime timeStamp);
|
QList<Package *> addPackagesFromSrcInfo(const QByteArray &srcInfo, CppUtilities::DateTime timeStamp);
|
||||||
Package *addPackageFromDescription(QString name, const QList<QByteArray> &descriptions, PackageOrigin origin, ChronoUtilities::DateTime timeStamp);
|
Package *addPackageFromDescription(QString name, const QList<QByteArray> &descriptions, PackageOrigin origin, CppUtilities::DateTime timeStamp);
|
||||||
|
|
||||||
// thread synchronization
|
// thread synchronization
|
||||||
QReadWriteLock *lock() const;
|
QReadWriteLock *lock() const;
|
||||||
|
@ -311,7 +311,7 @@ protected:
|
||||||
QString m_name;
|
QString m_name;
|
||||||
QString m_description;
|
QString m_description;
|
||||||
std::map<QString, std::unique_ptr<Package> > m_packages;
|
std::map<QString, std::unique_ptr<Package> > m_packages;
|
||||||
ChronoUtilities::TimeSpan m_maxPackageAge;
|
CppUtilities::TimeSpan m_maxPackageAge;
|
||||||
RepositoryUsage m_usage;
|
RepositoryUsage m_usage;
|
||||||
std::map<QString, QList<Package *> > m_groups;
|
std::map<QString, QList<Package *> > m_groups;
|
||||||
QStringList m_serverUrls;
|
QStringList m_serverUrls;
|
||||||
|
@ -560,7 +560,7 @@ inline bool Repository::isCachingUseful() const
|
||||||
* \brief Returns the max package age.
|
* \brief Returns the max package age.
|
||||||
* \sa setMaxPackageAge()
|
* \sa setMaxPackageAge()
|
||||||
*/
|
*/
|
||||||
inline ChronoUtilities::TimeSpan Repository::maxPackageAge() const
|
inline CppUtilities::TimeSpan Repository::maxPackageAge() const
|
||||||
{
|
{
|
||||||
return m_maxPackageAge;
|
return m_maxPackageAge;
|
||||||
}
|
}
|
||||||
|
@ -569,7 +569,7 @@ inline ChronoUtilities::TimeSpan Repository::maxPackageAge() const
|
||||||
* \brief Sets the max package age which is used by the cleanOutdatedPackages() and
|
* \brief Sets the max package age which is used by the cleanOutdatedPackages() and
|
||||||
* the hasOutdatedPackages() method.
|
* the hasOutdatedPackages() method.
|
||||||
*/
|
*/
|
||||||
inline void Repository::setMaxPackageAge(ChronoUtilities::TimeSpan maxPackageAge)
|
inline void Repository::setMaxPackageAge(CppUtilities::TimeSpan maxPackageAge)
|
||||||
{
|
{
|
||||||
m_maxPackageAge = maxPackageAge;
|
m_maxPackageAge = maxPackageAge;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ApplicationUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
@ -154,7 +156,7 @@ void printError(const QString &message)
|
||||||
void printError(string &message)
|
void printError(string &message)
|
||||||
{
|
{
|
||||||
if(useShSyntax) {
|
if(useShSyntax) {
|
||||||
ConversionUtilities::findAndReplace<string>(message, "'", "\'");
|
findAndReplace<string>(message, "'", "\'");
|
||||||
cerr << "export REPOINDEX_ERROR='" << message << '\'' << endl;
|
cerr << "export REPOINDEX_ERROR='" << message << '\'' << endl;
|
||||||
} else {
|
} else {
|
||||||
cerr << shchar << "Error: " << message << endl;
|
cerr << shchar << "Error: " << message << endl;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace ChronoUtilities;
|
using namespace CppUtilities;
|
||||||
|
|
||||||
namespace RepoIndex {
|
namespace RepoIndex {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue