#ifndef ZYPP_PACKAGE_H
#define ZYPP_PACKAGE_H
-#include "zypp/ResObject.h"
-#include "zypp/PackageKeyword.h"
-#include "zypp/Changelog.h"
+#include <zypp/ResObject.h>
+#include <zypp/PackageKeyword.h>
+#include <zypp/Changelog.h>
+#include <zypp/VendorSupportOptions.h>
///////////////////////////////////////////////////////////////////
namespace zypp
public:
typedef sat::ArrayAttr<PackageKeyword,IdString> Keywords;
+ typedef sat::ArrayAttr<std::string,std::string> FileList;
public:
+ /**
+ * Returns the level of supportability the vendor
+ * gives to this package.
+ *
+ * If the identical package happens to appear in multiple
+ * repos with different support levels, the maximum
+ * level is returned.
+ *
+ * This is one value from \ref VendorSupportOption.
+ */
+ VendorSupportOption vendorSupport() const;
+
+ /**
+ * True if the vendor support for this package
+ * is unknown or explictly unsupported.
+ */
+ bool maybeUnsupported() const;
+
/** Get the package change log */
Changelog changelog() const;
/** */
ByteCount sourcesize() const;
/** */
std::list<std::string> authors() const;
- /** */
- std::list<std::string> filenames() const;
+ /** Return the packages filelist (if available).
+ * The returned \ref FileList appears to be a container of
+ * \c std::string. In fact it is a query, so it does not
+ * consume much memory.
+ */
+ FileList filelist() const;
+
+ /** \name Source package handling
+ */
+ //@{
/** Name of the source rpm this package was built from.
*/
std::string sourcePkgName() const;
*/
Edition sourcePkgEdition() const;
+ /** The type of the source rpm (\c "src" or \c "nosrc").
+ */
+ std::string sourcePkgType() const;
+
+ /** The source rpms \c "name-version-release.type"
+ */
+ std::string sourcePkgLongName() const;
+ //@}
+
/**
* Checksum the source says this package should have.
* \see \ref location
*/
OnMediaLocation location() const;
+ /** Location of the downloaded package in cache or an empty path. */
+ Pathname cachedLocation() const;
- /** \deprecated no metadata always empty */
- ZYPP_DEPRECATED std::string os() const { return std::string(); }
- /** \deprecated no metadata always empty */
- ZYPP_DEPRECATED std::string prein() const { return std::string(); }
- /** \deprecated no metadata always empty */
- ZYPP_DEPRECATED std::string postin() const { return std::string(); }
- /** \deprecated no metadata always empty */
- ZYPP_DEPRECATED std::string preun() const { return std::string(); }
- /** \deprecated no metadata always empty */
- ZYPP_DEPRECATED std::string postun() const { return std::string(); }
+ /** Whether the package is cached. */
+ bool isCached() const
+ { return ! cachedLocation().empty(); }
protected:
friend Ptr make<Self>( const sat::Solvable & solvable_r );
/** Dtor */
virtual ~Package();
};
+
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////