repoindex/alpm/package.h

638 lines
15 KiB
C
Raw Normal View History

2015-08-10 22:46:01 +02:00
#ifndef ALPM_PACKAGE_H
#define ALPM_PACKAGE_H
#include "./list.h"
2015-08-10 22:46:01 +02:00
#include <c++utilities/chrono/datetime.h>
#include <alpm.h>
#include <QString>
#include <QHash>
2015-09-04 14:37:01 +02:00
#include <QJsonArray>
2015-08-10 22:46:01 +02:00
#include <map>
2015-09-04 14:37:01 +02:00
QT_FORWARD_DECLARE_CLASS(QJsonObject)
QT_FORWARD_DECLARE_CLASS(QJsonValue)
2015-08-10 22:46:01 +02:00
namespace RepoIndex {
2015-08-10 22:46:01 +02:00
2015-09-04 14:37:01 +02:00
class Repository;
2015-08-10 22:46:01 +02:00
/*!
* \brief The PackageVersionComparsion enum defines possible results of packages version comparison.
*/
enum class PackageVersionComparsion
{
Equal, /*!< The version of this package is the same as the version of the package from the sync db. */
SoftwareUpgrade, /*!< The software version of the package from the sync db is newer. */
PackageUpgradeOnly, /*!< The package release number of the package from the sync db is newer. */
NewerThenSyncVersion /*!< The version of this package is NEWER then the version of the package from the sync db. */
};
/*!
* \brief The ComparsionResult enum defines possible results of package version part comparsion.
*/
enum class PackageVersionPartComparsion
{
Equal, /*!< Both parts are equal. */
Newer, /*!< Part 1 is newer then part 2. */
Older /*!< Part 2 is newer then part 1. */
};
2015-09-04 14:37:01 +02:00
/*!
* \brief The PackageOrigin enum describes where a Package instance comes from.
*/
enum class PackageOrigin
{
Unknown = 20, /*! The origin is unknown. */
File = ALPM_PKG_FROM_FILE, /*!< The instance has been created from a package file; source() returns nullptr in this case. */
LocalDb = ALPM_PKG_FROM_LOCALDB, /*! The instance is from the local data base; source() is an AlpmDataBase instance. */
SyncDb = ALPM_PKG_FROM_SYNCDB, /*! The instance is from a sync data base; source() is an AlpmDataBase instance. */
Aur = 21 /*! The instance is from the AUR; source() is a UserRepository instance. */
};
enum class InstallStatus
{
Explicit = ALPM_PKG_REASON_EXPLICIT,
AsDependency = ALPM_PKG_REASON_DEPEND,
None = 20
};
2015-08-10 22:46:01 +02:00
class PackageVersion
{
public:
2015-09-04 14:37:01 +02:00
explicit PackageVersion(const QString &versionStr);
2015-08-10 22:46:01 +02:00
static PackageVersionPartComparsion compareParts(const QString &part1, const QString &part2);
PackageVersionComparsion compare(const PackageVersion &other) const;
QString epoch;
QString version;
QString release;
};
2015-09-04 14:37:01 +02:00
class Dependency
{
public:
explicit Dependency(const QString &name, const QString &version = QString(), _alpm_depmod_t mode = ALPM_DEP_MOD_ANY);
2015-09-04 14:37:01 +02:00
QString name;
QString version;
_alpm_depmod_t mode;
};
inline Dependency::Dependency(const QString &name, const QString &version, _alpm_depmod_t mode) :
name(name),
version(version),
mode(mode)
{}
class Manager;
2015-09-04 14:37:01 +02:00
class Package
2015-08-10 22:46:01 +02:00
{
public:
2015-09-04 14:37:01 +02:00
virtual ~Package();
2015-08-10 22:46:01 +02:00
2015-09-04 14:37:01 +02:00
// general package meta data
PackageOrigin origin() const;
2015-09-12 20:37:04 +02:00
Repository *repository() const;
2015-09-04 14:37:01 +02:00
bool hasGeneralInfo() const;
2015-08-10 22:46:01 +02:00
const QString &name() const;
const QString &version() const;
2015-08-10 22:46:01 +02:00
const QString &description() const;
const QString &upstreamUrl() const;
2015-09-04 14:37:01 +02:00
const QStringList &licenses() const;
const QStringList &groups() const;
const QList<Dependency> &dependencies() const;
const QList<Dependency> &optionalDependencies() const;
const QList<Dependency> &conflicts() const;
const QList<Dependency> &provides() const;
const QList<Dependency> &replaces() const;
bool isRequiredByComputed() const;
void computeRequiredBy(Manager &manager);
2015-09-04 14:37:01 +02:00
const QStringList &requiredBy() const;
const QStringList &optionalFor() const;
bool hasInstallScript() const;
// build related meta data
bool hasBuildRelatedMetaData() const;
const QString &fileName() const;
const QJsonArray &files() const;
ChronoUtilities::DateTime buildDate() const;
const QString &packer() const;
const QString &md5() const;
const QString &sha256() const;
const QString &buildArchitecture() const;
uint32 packageSize() const;
const QList<Dependency> &makeDependencies() const;
// installation related meta data
bool hasInstallRelatedMetaData() const;
ChronoUtilities::DateTime installDate() const;
uint32 installedSize() const;
const QStringList &backupFiles() const;
alpm_pkgvalidation_t validationMethods() const;
alpm_pkgreason_t installReason() const;
// source related meta data
bool hasSourceRelatedMetaData() const;
const QString &baseName() const;
const QStringList &architectures() const;
int32 id() const;
int32 categoryId() const;
int32 votes() const;
ChronoUtilities::DateTime outOfDate() const;
2015-08-10 22:46:01 +02:00
const QString &maintainer() const;
ChronoUtilities::DateTime firstSubmitted() const;
ChronoUtilities::DateTime lastModified() const;
const QString &tarUrl() const;
const std::map<QString, QByteArray> &sourceFiles() const;
2015-08-10 22:46:01 +02:00
2015-09-04 14:37:01 +02:00
// version comparsion
PackageVersionComparsion compareVersion(const Package *syncPackage) const;
PackageVersionComparsion compareVersion(const Dependency &dependency) const;
static bool matches(const QString &name, const QString &version, const Dependency &dependency);
bool matches(const Dependency &dependency);
// JSON serialization
2015-09-04 14:37:01 +02:00
QJsonObject basicInfo(bool includeRepoAndName = false) const;
QJsonObject fullInfo(bool includeRepoAndName = false) const;
// caching
void writeToCacheStream(QDataStream &out);
void restoreFromCacheStream(QDataStream &in);
2015-09-04 14:37:01 +02:00
protected:
2015-09-12 20:37:04 +02:00
explicit Package(const QString &name, Repository *repository);
virtual void writeSpecificCacheHeader(QDataStream &out);
virtual void restoreSpecificCacheHeader(QDataStream &in);
2015-09-04 14:37:01 +02:00
PackageOrigin m_origin;
2015-09-12 20:37:04 +02:00
Repository *m_repository;
2015-09-04 14:37:01 +02:00
// general package meta data
bool m_hasGeneralInfo;
2015-08-10 22:46:01 +02:00
QString m_name;
QString m_version;
2015-08-10 22:46:01 +02:00
QString m_description;
QString m_upstreamUrl;
2015-09-04 14:37:01 +02:00
QStringList m_licenses;
QStringList m_groups;
QList<Dependency> m_dependencies;
QList<Dependency> m_optionalDependencies;
QList<Dependency> m_conflicts;
QList<Dependency> m_provides;
QList<Dependency> m_replaces;
bool m_requiredByComputed;
2015-09-04 14:37:01 +02:00
QStringList m_requiredBy;
QStringList m_optionalFor;
bool m_hasInstallScript;
// build related meta data
bool m_hasBuildRelatedMetaData;
QString m_fileName;
QJsonArray m_files;
ChronoUtilities::DateTime m_buildDate;
QString m_packer;
QString m_md5;
QString m_sha256;
QString m_buildArchitecture;
uint32 m_packageSize;
QList<Dependency> m_makeDependencies;
// installation related meta data
bool m_hasInstallRelatedMetaData;
ChronoUtilities::DateTime m_installDate;
uint32 m_installedSize;
QStringList m_backupFiles;
alpm_pkgvalidation_t m_validationMethods;
alpm_pkgreason_t m_installReason;
// source related meta data
bool m_hasSourceRelatedMetaData;
QString m_baseName;
QStringList m_architectures;
int32 m_id;
int32 m_categoryId;
int32 m_votes;
ChronoUtilities::DateTime m_outOfDate;
2015-08-10 22:46:01 +02:00
QString m_maintainer;
ChronoUtilities::DateTime m_firstSubmitted;
ChronoUtilities::DateTime m_lastModified;
QString m_tarUrl;
std::map<QString, QByteArray> m_sourceFiles;
2015-08-10 22:46:01 +02:00
};
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns where the package instance comes from (local db, sync db, pkg file, AUR).
*/
2015-09-04 14:37:01 +02:00
inline PackageOrigin Package::origin() const
{
2015-09-04 14:37:01 +02:00
return m_origin;
}
2015-08-10 22:46:01 +02:00
/*!
2015-09-12 20:37:04 +02:00
* \brief Returns the repository.
* \remarks Might be nullptr if no repository is associated.
2015-08-10 22:46:01 +02:00
*/
2015-09-12 20:37:04 +02:00
inline Repository *Package::repository() const
2015-08-10 22:46:01 +02:00
{
2015-09-12 20:37:04 +02:00
return m_repository;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns whether general information is available for the package.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline bool Package::hasGeneralInfo() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_hasGeneralInfo;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the name.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QString &Package::name() const
2015-08-10 22:46:01 +02:00
{
return m_name;
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the version.
*/
2015-09-04 14:37:01 +02:00
inline const QString &Package::version() const
{
return m_version;
}
2015-08-10 22:46:01 +02:00
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the description.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QString &Package::description() const
2015-08-10 22:46:01 +02:00
{
return m_description;
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the upstream URL.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QString &Package::upstreamUrl() const
2015-08-10 22:46:01 +02:00
{
return m_upstreamUrl;
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the licenses.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QStringList &Package::licenses() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_licenses;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the groups.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QStringList &Package::groups() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_groups;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the dependencies.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QList<Dependency> &Package::dependencies() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_dependencies;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns the optional dependencies.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QList<Dependency> &Package::optionalDependencies() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_optionalDependencies;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns conflicting packages.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QList<Dependency> &Package::conflicts() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_conflicts;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns provides.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QList<Dependency> &Package::provides() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_provides;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns packages which are replaced by this package.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QList<Dependency> &Package::replaces() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_replaces;
}
/*!
* \brief Returns whether required-by and optional-for have been computed.
*/
inline bool Package::isRequiredByComputed() const
{
return m_requiredByComputed;
}
2015-08-10 22:46:01 +02:00
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns packages requiring this packages.
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline const QStringList &Package::requiredBy() const
{
2015-09-04 14:37:01 +02:00
return m_requiredBy;
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns packages having this package as optional dependency.
*/
inline const QStringList &Package::optionalFor() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_optionalFor;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns whether the package has an install script.
*/
inline bool Package::hasInstallScript() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_hasInstallScript;
2015-08-10 22:46:01 +02:00
}
/*!
2015-09-04 14:37:01 +02:00
* \brief Returns whether the package has build-related meta data.
2015-08-10 22:46:01 +02:00
*
2015-09-04 14:37:01 +02:00
* Build-related meta data is information about a particular package file such
* as architecture, file name, build date, ....
2015-08-10 22:46:01 +02:00
*/
2015-09-04 14:37:01 +02:00
inline bool Package::hasBuildRelatedMetaData() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_hasBuildRelatedMetaData;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the file name of the package file.
*/
inline const QString &Package::fileName() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_fileName;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the file of the package as JSON array.
*/
inline const QJsonArray &Package::files() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_files;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the build date of the package file.
*/
inline ChronoUtilities::DateTime Package::buildDate() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_buildDate;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the packer of the package file.
*/
inline const QString &Package::packer() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_packer;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the MD5 hash of the package file.
*/
inline const QString &Package::md5() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_md5;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the SHA-256 hash of the package file.
*/
inline const QString &Package::sha256() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_sha256;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the architecture of the package file.
*/
inline const QString &Package::buildArchitecture() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_buildArchitecture;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the size of the package file.
*/
inline uint32 Package::packageSize() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_packageSize;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns make dependencies.
*/
inline const QList<Dependency> &Package::makeDependencies() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_makeDependencies;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns whether install-related meta data is available.
*
* Install-related meta data is information such as the install date,
* the installed size, files backuped during installation, ...
*
* Most of the install-related meta data is only available for packages
* from the local data base (see origin()).
*/
inline bool Package::hasInstallRelatedMetaData() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_hasInstallRelatedMetaData;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the install date.
*/
inline ChronoUtilities::DateTime Package::installDate() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_installDate;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the installed size.
*/
inline uint32 Package::installedSize() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_installedSize;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the files which have been backued up during installation.
*/
inline const QStringList &Package::backupFiles() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_backupFiles;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the validation methods used during installation.
*/
inline alpm_pkgvalidation_t Package::validationMethods() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_validationMethods;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns whether the package has been installed explicitely or as a dependency.
*/
inline alpm_pkgreason_t Package::installReason() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_installReason;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns whether source-related meta data is available.
*
* Source-related meta data is information about the PKGBUILD file such has
* its AUR IDs, AUR votes, maintainer, flag date, ...
*/
inline bool Package::hasSourceRelatedMetaData() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_hasSourceRelatedMetaData;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the base name.
*/
inline const QString &Package::baseName() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_baseName;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the architecutes (from the PKGBUILD file).
* \remarks For the architecture of the particular package file
2015-09-04 14:37:01 +02:00
* see buildArchitecture().
*/
inline const QStringList &Package::architectures() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_architectures;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the ID.
*/
inline int32 Package::id() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_id;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the category ID.
*/
inline int32 Package::categoryId() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_categoryId;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the votes of the package.
*/
inline int32 Package::votes() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_votes;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the flag date.
*/
inline ChronoUtilities::DateTime Package::outOfDate() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_outOfDate;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the maintainer.
*/
inline const QString &Package::maintainer() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_maintainer;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns when the package was first submitted.
*/
inline ChronoUtilities::DateTime Package::firstSubmitted() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_firstSubmitted;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns the last time when the package was modified.
*/
inline ChronoUtilities::DateTime Package::lastModified() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_lastModified;
2015-08-10 22:46:01 +02:00
}
2015-09-04 14:37:01 +02:00
/*!
* \brief Returns a URL to a tar file with the sources.
*/
inline const QString &Package::tarUrl() const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return m_tarUrl;
2015-08-10 22:46:01 +02:00
}
/*!
* \brief Returns the source files of the package.
*/
inline const std::map<QString, QByteArray> &Package::sourceFiles() const
{
return m_sourceFiles;
}
/*!
* \brief Compares the version of the package with the specified sync package.
*/
2015-09-04 14:37:01 +02:00
inline PackageVersionComparsion Package::compareVersion(const Package *syncPackage) const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return PackageVersion(version()).compare(PackageVersion(syncPackage->version()));
2015-08-10 22:46:01 +02:00
}
/*!
* \brief Compares the version of the package with the version of the specified \a dependency.
*/
2015-09-04 14:37:01 +02:00
inline PackageVersionComparsion Package::compareVersion(const Dependency &dependency) const
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return PackageVersion(version()).compare(PackageVersion(dependency.version));
2015-08-10 22:46:01 +02:00
}
/*!
* \brief Checks whether the package matches the specified \a dependency.
*/
2015-09-04 14:37:01 +02:00
inline bool Package::matches(const Dependency &dependency)
2015-08-10 22:46:01 +02:00
{
2015-09-04 14:37:01 +02:00
return matches(name(), version(), dependency);
2015-08-10 22:46:01 +02:00
}
}
#endif // ALPM_PACKAGE_H