--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMAtomImpl.cc
+ *
+*/
+
+#include "zypp/source/yum/YUMAtomImpl.h"
+
+using namespace std;
+using namespace zypp::detail;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ {
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMAtomImpl
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ /** Default ctor
+ */
+ YUMAtomImpl::YUMAtomImpl(
+ Source_Ref source_r
+ )
+ : _source(source_r)
+ {
+ }
+
+ Source_Ref YUMAtomImpl::source() const
+ { return _source; }
+
+
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMAtomImpl.h
+ *
+*/
+#ifndef ZYPP_SOURCE_YUM_YUMATOMIMPL_H
+#define ZYPP_SOURCE_YUM_YUMATOMIMPL_H
+
+#include "zypp/source/SourceImpl.h"
+#include "zypp/detail/AtomImpl.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ { //////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMAtomImpl
+ //
+ /** Class representing a message
+ */
+ class YUMAtomImpl : public detail::AtomImplIf
+ {
+ public:
+ /** Default ctor */
+ YUMAtomImpl(
+ Source_Ref source_r
+ );
+
+ private:
+ Source_Ref _source;
+ public:
+ Source_Ref source() const;
+ };
+ ///////////////////////////////////////////////////////////////////
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_YUM_YUMATOMIMPL_H
*/
#include "zypp/source/yum/YUMSourceImpl.h"
+#include "zypp/source/yum/YUMAtomImpl.h"
#include "zypp/source/yum/YUMPackageImpl.h"
#include "zypp/source/yum/YUMScriptImpl.h"
#include "zypp/source/yum/YUMMessageImpl.h"
}
}
- static void augmentCapSet( const CapSet & from, CapSet & to )
- {
- for (CapSet::const_iterator it = from.begin(); it != from.end(); ++it) {
- to.insert( *it );
- }
- return;
- }
-
- static void augmentDependencies( const Dependencies & from, Dependencies & to )
- {
-MIL << "augmentDependencies(" << from << ")" << endl;
-#define AUG_CAP_SET(tag) augmentCapSet( from[Dep::tag], to[Dep::tag] )
- AUG_CAP_SET(PROVIDES);
- AUG_CAP_SET(REQUIRES);
- AUG_CAP_SET(PREREQUIRES);
- AUG_CAP_SET(OBSOLETES);
- AUG_CAP_SET(CONFLICTS);
- AUG_CAP_SET(FRESHENS);
- AUG_CAP_SET(RECOMMENDS);
- AUG_CAP_SET(SUGGESTS);
- AUG_CAP_SET(SUPPLEMENTS);
- AUG_CAP_SET(ENHANCES);
-#undef AUG_CAP_SET
-MIL << "=> (" << to << ")" << endl;
- }
-
void YUMSourceImpl::augmentPackage(
const zypp::parser::yum::YUMPatchPackage & parsed
)
{
try
{
+ Edition edition( parsed.ver, parsed.rel, parsed.epoch );
NVRA nvra( parsed.name,
- Edition( parsed.ver, parsed.rel, parsed.epoch ),
+ edition,
Arch( parsed.arch ) );
-DBG << "augmentPackage(" << nvra << ")" << endl;
+ DBG << "augmentPackage(" << nvra << ")" << endl;
PackageImplMapT::const_iterator it = _package_impl.find( nvra );
if (it == _package_impl.end()) {
}
ResImplTraits<YUMPackageImpl>::Ptr impl = it->second.impl;
Package::Ptr package = it->second.package;
-DBG << "found " << *package << ", impl " << impl << endl;
+ //DBG << "found " << *package << ", impl " << impl << endl;
_store.erase( package );
impl->unmanage();
-DBG << "Erased old package " << endl;
- Dependencies deps = createDependencies( parsed, ResTraits<Package>::kind );
-
-DBG << "augmenting " << deps << endl;
-
- augmentDependencies( package->deps(), deps );
+ // create Atom
-DBG << "augmenting done " << endl;
+ CapFactory f;
+ Dependencies deps = createDependencies( parsed, ResTraits<Package>::kind );
+ deps[Dep::REQUIRES].insert( f.parse( ResTraits<Package>::kind, parsed.name, Rel::EQ, edition ) );
+ NVRAD atomdata( nvra, deps );
+ ResImplTraits<YUMAtomImpl>::Ptr atomimpl = new YUMAtomImpl( package->source() );
+ Atom::Ptr atom = detail::makeResolvableFromImpl(
+ atomdata, atomimpl
+ );
+ DBG << "Inserting atom " << *atom << endl;
+ //DBG << "with deps " << deps << endl;
+ _store.insert( atom );
// Collect augmented package data
- NVRAD dataCollect( nvra, deps );
+ NVRAD packagedata( nvra, package->deps() );
-DBG << "NVRAD " << (NVRA)dataCollect << endl;
+ //DBG << "NVRAD " << (NVRA)packagedata << endl;
- Package::Ptr augmented_package = detail::makeResolvableFromImpl(
- dataCollect, impl
+#warning add patchrpm, deltarpm, etc. to YUMPackageImpl here
+ Package::Ptr new_package = detail::makeResolvableFromImpl(
+ packagedata, impl
);
-DBG << "augmented_package " << *augmented_package << endl;
+ //DBG << "new_package " << *new_package << endl;
+
+ _store.insert( new_package );
-DBG << "Inserting augmented package " << endl;
- _store.insert( augmented_package );
-DBG << "Done" << endl;
return;
}
catch (const Exception & excpt_r)