SET(LIBZYPP_MAJOR "3")
SET(LIBZYPP_MINOR "13")
SET(LIBZYPP_COMPATMINOR "13")
-SET(LIBZYPP_PATCH "3")
+SET(LIBZYPP_PATCH "4")
{
bool operator()( const PoolItem & obj_r )
{
- MIL << obj_r << " " << obj_r->summary() << endl;
- MIL << obj_r << " " << obj_r->description() << endl;
+ Package::constPtr p( asKind<Package>(obj_r) );
+ if ( p )
+ {
+ MIL << p << " \t" << p->sourcePkgName() << '-' << p->sourcePkgEdition() << endl;
+ }
return true;
}
//zypp::base::LogControl::instance().logfile( "log.restrict" );
INT << "===[START]==========================================" << endl;
- Capability c( CapFactory().parse( ResTraits<Package>::kind,
- "modalias(kernel-bigsmp:pci:kfghkskd***k)" ) );
-
- capability::ModaliasCap::constPtr mc( capability::asKind<capability::ModaliasCap>(c) );
-
- DBG << c << endl;
- DBG << c.index() << endl;
-
- MIL << mc << endl;
- MIL << mc->name() << endl;
- MIL << mc->pkgname() << endl;
-
-
-
- ///////////////////////////////////////////////////////////////////
- INT << "===[END]============================================" << endl << endl;
- zypp::base::LogControl::instance().logNothing();
- return 0;
-
RepoManager repoManager( makeRepoManager( "/Local/ROOT" ) );
RepoInfoList repos = repoManager.knownRepositories();
SEC << repos << endl;
SEC << pool.knownRepositoriesSize() << endl;
std::for_each( pool.knownRepositoriesBegin(), pool.knownRepositoriesEnd(), Print() );
- std::for_each( pool.byNameBegin("glibc"), pool.byNameEnd("glibc"), Xprint() );
+ std::for_each( pool.begin(), pool.end(), Xprint() );
///////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
OnMediaLocation Package::location() const
{ return pimpl().location(); }
-
+
+ std::string Package::sourcePkgName() const
+ { return pimpl().sourcePkgName(); }
+
+ Edition Package::sourcePkgEdition() const
+ { return pimpl().sourcePkgEdition(); }
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
typedef std::set<PackageKeyword> Keywords;
public:
-
+
/** Get the package change log */
Changelog changelog() const;
/** */
/** Disk usage per directory */
DiskUsage diskusage() const;
-
+
+ /** Name of the source rpm this package was built from.
+ * Empty if unknown.
+ */
+ std::string sourcePkgName() const;
+
+ /** Edition of the source rpm this package was built from.
+ * Empty if unknown.
+ */
+ Edition sourcePkgEdition() const;
+
/**
* Checksum the source says this package should have
* \deprecated Use location().checksum()
*/
ZYPP_DEPRECATED CheckSum checksum() const
{ return location().checksum(); }
-
+
/**
* \short Location of the resolvable in the repository
*/
OnMediaLocation location() const;
-
+
protected:
Package( const NVRAD & nvrad_r );
/** Dtor */
void ZYpp::initTarget(const Pathname & root, bool commit_only )
{ _pimpl->initTarget(root, commit_only); }
-
+
void ZYpp::initializeTarget(const Pathname & root)
{ _pimpl->initializeTarget(root); }
ZYppCommitResult ZYpp::commit( const ZYppCommitPolicy & policy_r )
{ return _pimpl->commit( policy_r ); }
+ void ZYpp::installSrcPackage( const ResTraits<SrcPackage>::constPtrType & srcPackage_r )
+ { _pimpl->installSrcPackage( srcPackage_r ); }
+
///////////////////////////////////////////////////////////////////
void ZYpp::setTextLocale( const Locale & textLocale_r )
Pathname ZYpp::tmpPath() const
{ return _pimpl->tmpPath(); }
-
+
void ZYpp::setHomePath( const Pathname & path )
{ _pimpl->setHomePath(path); }
#include "zypp/base/Deprecated.h"
#include "zypp/ZYppCommit.h"
+#include "zypp/ResTraits.h"
#include "zypp/Target.h"
#include "zypp/Resolver.h"
public:
- /**
+ /**
* Access to the main resolvable pool
* \ref zypp::ResPool
*/
DiskUsageCounter::MountPointSet diskUsage();
void setPartitions(const DiskUsageCounter::MountPointSet &mp);
-
+
DiskUsageCounter::MountPointSet getPartitions() const;
public:
* \throws Exception
* if commit_only == true, just init the target, dont populate store or pool
*/
- ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only = false);
-
+ ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only = false);
+
/**
* \throws Exception
*/
*/
ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
+ /** Install a source package on the Target.
+ * \throws Exception
+ */
+ void installSrcPackage( const ResTraits<SrcPackage>::constPtrType & srcPackage_r );
+
public:
/** */
Resolver_Ptr resolver() const;
public:
/** Get the path where zypp related plugins store persistent data and caches */
Pathname homePath() const;
-
+
/** Get the path where zypp related plugins store temp data */
Pathname tmpPath() const;
-
+
/** set the home, if you need to change it */
void setHomePath( const Pathname & path );
namespace detail
{ /////////////////////////////////////////////////////////////////
+ ByteCount PackageImplIf::downloadSize() const
+ { return location().downloadSize(); }
+
unsigned PackageImplIf::mediaNr() const
{ return location().medianr(); }
ByteCount PackageImplIf::sourcesize() const
{ return ByteCount(); }
- ByteCount PackageImplIf::downloadSize() const
- { return location().downloadSize(); }
-
OnMediaLocation PackageImplIf::location() const
{ return OnMediaLocation(); }
std::list<PackageImplIf::PatchRpm> PackageImplIf::patchRpms() const
{ return std::list<PatchRpm>(); }
+ std::string PackageImplIf::sourcePkgName() const
+ { return std::string(); }
+
+ Edition PackageImplIf::sourcePkgEdition() const
+ { return Edition(); }
+
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
typedef packagedelta::PatchRpm PatchRpm;
typedef std::set<PackageKeyword> Keywords;
- public:
- /** Overloaded ResObjectImpl attribute.
+ public:
+ /** Overloaded ResObjectImpl attribute.
* \return The \ref location media number.
*/
virtual unsigned mediaNr() const;
- public:
+ /** Overloaded ResObjectImpl attribute.
+ * \return The \ref location downloadSize.
+ */
+ virtual ByteCount downloadSize() const;
+
+ public:
/** \name Rpm Package Attributes. */
//@{
/** */
virtual std::list<PatchRpm> patchRpms() const PURE_VIRTUAL;
- virtual ByteCount downloadSize() const PURE_VIRTUAL;
-
virtual OnMediaLocation location() const PURE_VIRTUAL;
+ /** Name of the source rpm this package was built from.
+ * Empty if unknown.
+ */
+ virtual std::string sourcePkgName() const PURE_VIRTUAL;
+
+ /** Edition of the source rpm this package was built from.
+ * Empty if unknown.
+ */
+ virtual Edition sourcePkgEdition() const PURE_VIRTUAL;
+
//@}
};
namespace detail
{ /////////////////////////////////////////////////////////////////
+ ByteCount SrcPackageImplIf::downloadSize() const
+ { return location().downloadSize(); }
+
+ unsigned SrcPackageImplIf::mediaNr() const
+ { return location().medianr(); }
+
/////////////////////////////////////////////////////////////////
// Default implementation of SrcPackageImplIf attributes,
// as far as resonable.
/////////////////////////////////////////////////////////////////
- OnMediaLocation SrcPackageImplIf::location() const
- { return OnMediaLocation(); }
-
- ByteCount SrcPackageImplIf::downloadSize() const
- { return location().downloadSize(); }
+ OnMediaLocation SrcPackageImplIf::location() const
+ { return OnMediaLocation(); }
- DiskUsage SrcPackageImplIf::diskusage() const
- { return DiskUsage(); }
+ DiskUsage SrcPackageImplIf::diskusage() const
+ { return DiskUsage(); }
/////////////////////////////////////////////////////////////////
} // namespace detail
typedef SrcPackage ResType;
public:
- virtual OnMediaLocation location() const PURE_VIRTUAL;
+ /** Overloaded ResObjectImpl attribute.
+ * \return The \ref location media number.
+ */
+ virtual unsigned mediaNr() const;
+
+ /** Overloaded ResObjectImpl attribute.
+ * \return The \ref location downloadSize.
+ */
+ virtual ByteCount downloadSize() const;
+
+ public:
/** */
- virtual ByteCount downloadSize() const PURE_VIRTUAL;
+ virtual OnMediaLocation location() const PURE_VIRTUAL;
/** */
virtual DiskUsage diskusage() const PURE_VIRTUAL;
-
+
};
///////////////////////////////////////////////////////////////////
return std::list<std::string>();
}
+std::string PackageImpl::sourcePkgName() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageSourcePkgName() );
+}
+
+Edition PackageImpl::sourcePkgEdition() const
+{
+ return _repository->resolvableQuery().queryStringAttribute( _id, cache::attrPackageSourcePkgEdition() );
+}
+
/////////////////////////////////////////////////////////////////
} } } // namespace zypp::repo::cached
///////////////////////////////////////////////////////////////////
public:
PackageImpl( const data::RecordId &id, repo::cached::RepoImpl::Ptr repository_r );
-
+
virtual TranslatedText summary() const;
virtual TranslatedText description() const;
virtual TranslatedText insnotify() const;
virtual bool installOnly() const;
virtual Date buildtime() const;
virtual Date installtime() const;
-
+
// PACKAGE
virtual std::string buildhost() const;
virtual std::string distribution() const;
virtual std::list<std::string> authors() const;
virtual std::list<std::string> filenames() const;
virtual OnMediaLocation location() const;
-
- /*virtual std::list<DeltaRpm> deltaRpms() const;
- virtual std::list<PatchRpm> patchRpms() const;
- */
+ virtual std::string sourcePkgName() const;
+ virtual Edition sourcePkgEdition() const;
+
virtual Repository repository() const;
-
+
private:
repo::cached::RepoImpl::Ptr _repository;
#include "zypp/Resolvable.h"
#include "zypp/ResObject.h"
#include "zypp/Package.h"
+#include "zypp/SrcPackage.h"
#include "zypp/Pattern.h"
#include "zypp/Selection.h"
#include "zypp/Script.h"
}
}
+ void TargetImpl::installSrcPackage( const SrcPackage::constPtr & srcPackage_r )
+ {
+ ZYPP_THROW( Exception("srcPackage install not yet implemented") );
+#warning IMPLEMENT IT
+ // Provide srcPackage_r on the local disk and install it using
+ // _rpm.installPackage( localfile );
+ }
+
+
/////////////////////////////////////////////////////////////////
} // namespace target
///////////////////////////////////////////////////////////////////
*/
PoolItemList commit( const PoolItemList & items_r, const ZYppCommitPolicy & policy_r, const ResPool & pool_r );
+ /** Install a source package on the Target. */
+ void installSrcPackage( const ResTraits<SrcPackage>::constPtrType & srcPackage_r );
+
/** Overload to realize stream output. */
virtual std::ostream & dumpOn( std::ostream & str ) const
{
/** return the last modification date of the target */
Date timestamp() const;
-
- /**
+
+ /**
* reload the target in future calls if
* needed.
* note the loading can actually be delayed, but
- * the next call to resolvables must reflect the
+ * the next call to resolvables must reflect the
* status of the system.
*/
void reset();
return res;
}
+ void ZYppImpl::installSrcPackage( const ResTraits<SrcPackage>::constPtrType & srcPackage_r )
+ {
+ if (! _target)
+ ZYPP_THROW( Exception("Target not initialized.") );
+ _target->_pimpl->installSrcPackage( srcPackage_r );
+ }
//------------------------------------------------------------------------
// locales
#include "zypp/Locale.h"
#include "zypp/KeyRing.h"
#include "zypp/ZYppCommit.h"
+#include "zypp/ResTraits.h"
#include "zypp/DiskUsageCounter.h"
using namespace zypp::filesystem;
* true, just init the target, dont populate store or pool
*/
void initializeTarget(const Pathname & root);
-
+
/**
* \throws Exception
* if commit_only == true, just init the target, dont populate store or pool
*/
ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only);
-
+
/**
* \throws Exception
*/
/** Commit changes and transactions. */
ZYppCommitResult commit( const ZYppCommitPolicy & policy_r );
+ /** Install a source package on the Target. */
+ void installSrcPackage( const ResTraits<SrcPackage>::constPtrType & srcPackage_r );
+
public:
/** \todo Signal locale change. */
void setTextLocale( const Locale & textLocale_r )
/** Get the path where zypp related plugins store persistent data and caches */
Pathname homePath() const;
-
+
/** Get the path where zypp related plugins store tmp data */
Pathname tmpPath() const;
-
+
/** set the home, if you need to change it */
void setHomePath( const Pathname & path );