YUM source 1st draft
authorJiri Srain <jsrain@suse.cz>
Tue, 22 Nov 2005 15:00:16 +0000 (15:00 +0000)
committerJiri Srain <jsrain@suse.cz>
Tue, 22 Nov 2005 15:00:16 +0000 (15:00 +0000)
14 files changed:
devel/devel.jsrain/PatchRead.cc
devel/devel.jsrain/yum/YUMtest.cc
zypp/parser/yum/YUMParserData.cc
zypp/source/yum/Makefile.am
zypp/source/yum/YUMMessageImpl.cc
zypp/source/yum/YUMMessageImpl.h
zypp/source/yum/YUMPackageImpl.cc
zypp/source/yum/YUMPackageImpl.h
zypp/source/yum/YUMPatchImpl.cc [new file with mode: 0644]
zypp/source/yum/YUMPatchImpl.h [new file with mode: 0644]
zypp/source/yum/YUMScriptImpl.cc
zypp/source/yum/YUMScriptImpl.h
zypp/source/yum/YUMSource.cc [new file with mode: 0644]
zypp/source/yum/YUMSource.h [new file with mode: 0644]

index b35d117..497e7d7 100644 (file)
@@ -6,6 +6,7 @@
 #include <zypp/Message.h>
 #include <zypp/detail/MessageImpl.h>
 #include <zypp/detail/PatchImpl.h>
+#include <zypp/Patch.h>
 #include <zypp/Package.h>
 #include <zypp/detail/PackageImpl.h>
 #include <zypp/Script.h>
@@ -20,7 +21,7 @@
 #include <zypp/source/yum/YUMScriptImpl.h>
 #include <zypp/source/yum/YUMMessageImpl.h>
 #include <zypp/source/yum/YUMPackageImpl.h>
-
+#include <zypp/source/yum/YUMSource.h>
 
 #include <map>
 #include <set>
@@ -31,81 +32,14 @@ using namespace zypp::detail;
 
 using namespace std;
 using namespace zypp;
-using namespace zypp::parser::YUM;
-using namespace zypp::source::YUM;
-
-
-CapFactory _f;
+using namespace zypp::parser::yum;
+using namespace zypp::source::yum;
 
-void AddDependency (detail::ResolvableImplPtr res, Capability& cap) {
-  Dependencies deps = res->deps();
-  CapSet req = deps.requires();
-  req.insert( cap );
-  deps.setRequires( req );
-  res->setDeps( deps );
-}
-
-void AddAllRequires( detail::ResolvableImplPtr res, list<Capability> & caps) {
-    for (list<Capability>::iterator it = caps.begin();
-         it != caps.end();
-        it++)
-    {
-      AddDependency( res, *it );
-    }
-}
 
-DEFINE_PTR_TYPE(MyPatchImpl)
-
-class MyPatchImpl : public detail::PatchImpl
-{
-  public:
-    MyPatchImpl( YUMPatchData & p )
-    : PatchImpl (p.name,
-                Edition (),
-                Arch ("noarch"))
-    {
-      // Create a requires capability to the patch itself
-      Capability cap( _f.parse( p.name, ResKind( "patch" )));
-
-      // Process atoms
-      detail::PatchImpl::AtomList atoms;
-
-      for (std::list<YUMPatchAtom>::iterator it = p.atoms.begin();
-       it != p.atoms.end();
-       it++)
-      {
-       if (it->type == "script")
-       {
-         ScriptImplPtr impl = new YUMScriptImpl( *it->script );
-         AddDependency(impl, cap);
-         ScriptPtr script = new Script(impl);
-         cout << *script << endl;
-         cout << script->deps() << endl;
-         atoms.push_back(script);
-       }
-       else if (it->type == "message")
-       {
-         MessageImplPtr impl = new YUMMessageImpl( *it->message );
-         AddDependency(impl, cap);
-         MessagePtr message = new Message(impl);
-         cout << *message << endl;
-         cout << message->deps() << endl;
-         atoms.push_back(message);
-       }
-       else if (it->type == "package")
-       {
-         PackageImplPtr impl = new YUMPackageImpl( *it->package );
-         AddDependency(impl, cap);
-         PackagePtr package = new Package(impl);
-         cout << *package << endl;
-         cout << package->deps() << endl;
-         atoms.push_back(package);
-       }
-      }
-
-      // FIXME mve this piece of code after solutions are selected
+      // FIXME me this piece of code after solutions are selected
       // this orders the atoms of a patch
-      ResolvablePtr previous;
+/*
+      Resolvable::Ptr previous;
       bool first = true;
       for (detail::PatchImpl::AtomList::iterator it = atoms.begin();
            it != atoms.end();
@@ -122,15 +56,7 @@ class MyPatchImpl : public detail::PatchImpl
        first = false;
        previous = *it;
       }
-
-      _reboot_needed = false; // FIXME
-      _atoms = atoms;
-      _category = "recommended"; // FIXME
-    }
-};
-
-IMPL_PTR_TYPE(MyPatchImpl)
-
+*/
 
 /******************************************************************
 **
@@ -144,13 +70,13 @@ int main( int argc, char * argv[] )
 {
   INT << "===[START]==========================================" << endl;
 
-PatchPtr patch1;
+YUMSource src;
+Patch::Ptr patch1;
 YUMPatchParser iter(cin,"");
 for (;
      !iter.atEnd();
      ++iter) {
-       MyPatchImplPtr q(new MyPatchImpl(**iter));
-       patch1 = new Patch (q);
+       patch1 = src.createPatch(**iter);
      }
 if (iter.errorStatus())
   throw *iter.errorStatus();
index ad3b875..3b6b477 100644 (file)
@@ -23,7 +23,7 @@ Purpose:    main() to test the YUM parsers
 
 using namespace zypp;
 using namespace zypp::parser;
-using namespace zypp::parser::YUM;
+using namespace zypp::parser::yum;
 using namespace std;
 
 namespace {
index c011739..4d9ed18 100644 (file)
@@ -361,13 +361,6 @@ ostream& operator<<(ostream &out, const YUMPatchData& data)
     << "  affects package manager: " << data.packageManager << endl
     << "  update script: " << data.updateScript << endl
     << "  atoms:" << endl
-/*  for (std::list<shared_ptr<YUMPatchAtom> >::const_iterator it = data.atoms.begin();
-       it != data.atoms.end();
-       it++)
-  {
-    out << *it;
-  }*/
-// FIXME here
     << data.atoms;
   return out;
 }
@@ -375,7 +368,6 @@ ostream& operator<<(ostream &out, const YUMPatchData& data)
 std::ostream& operator<<(std::ostream& out, const shared_ptr<YUMPatchAtom> data)
 {
   out << "Atom data" << endl;
-//  out << "  atom type: " << data->atomType() << endl;
   switch (data->atomType())
   {
     case YUMPatchAtom::Package:
index 7721cd3..deea0cf 100644 (file)
@@ -5,10 +5,12 @@ SUBDIRS =
 
 ## ##################################################
 
-include_HEADERS =              \
-       YUMScriptImpl.h         \
+include_HEADERS =                      \
+       YUMSource.h                     \
+       YUMScriptImpl.h                 \
        YUMMessageImpl.h                \
-       YUMPackageImpl.h
+       YUMPackageImpl.h                \
+       YUMPatchImpl.h
 
 
 noinst_LTLIBRARIES =   lib@PACKAGE@_source_yum.la
@@ -16,8 +18,10 @@ noinst_LTLIBRARIES = lib@PACKAGE@_source_yum.la
 ## ##################################################
 
 lib@PACKAGE@_source_yum_la_SOURCES =   \
+       YUMSource.cc                    \
        YUMScriptImpl.cc                \
        YUMMessageImpl.cc               \
-       YUMPackageImpl.cc
+       YUMPackageImpl.cc               \
+       YUMPatchImpl.cc
 
 ## ##################################################
index 1d6c937..3a5c7e1 100644 (file)
@@ -35,23 +35,8 @@ namespace zypp
       YUMMessageImpl::YUMMessageImpl(
        const zypp::parser::yum::YUMPatchMessage & parsed
       )
-#warning MA cannot be constructed that way
-#if 0
-      : MessageImpl(
-       parsed.name,
-       Edition(parsed.ver, parsed.rel, strtol(parsed.epoch.c_str(), NULL, 10)),
-       Arch("noarch")
-      )
-#endif
       {
        _text = parsed.text;
-/*
-    std::list<YUMDependency> provides;
-    std::list<YUMDependency> conflicts;
-    std::list<YUMDependency> obsoletes;
-    std::list<YUMDependency> freshen;
-    std::list<YUMDependency> requires;
-*/
       }
     } // namespace yum
     /////////////////////////////////////////////////////////////////
index c4d46c3..598d660 100644 (file)
@@ -28,16 +28,14 @@ namespace zypp
       //
       //        CLASS NAME : YUMMessageImpl
       //
-      /** Class representing an update script
-       * \todo Fix brief descriptions, or delete them. This is not an update
-       * script, It's implementation of zypp::Message for YUM source.
+      /** Class representing a message
       */
       class YUMMessageImpl : public detail::MessageImpl
       {
       public:
         /** Default ctor */
         YUMMessageImpl( const zypp::parser::yum::YUMPatchMessage & parsed );
-       };
+      };
       ///////////////////////////////////////////////////////////////////
     } // namespace yum
     /////////////////////////////////////////////////////////////////
index e51bb57..fff2b1e 100644 (file)
@@ -35,14 +35,6 @@ namespace zypp
       YUMPackageImpl::YUMPackageImpl(
        const zypp::parser::yum::YUMPatchPackage & parsed
       )
-#warning MA cannot be constructed that way
-#if 0
-      : PackageImpl(
-       parsed.name,
-       Edition(parsed.ver, parsed.rel, strtol(parsed.epoch.c_str(), NULL, 10)),
-       Arch(parsed.arch)
-      )
-#endif
       {
 /*
     std::string type;
@@ -66,17 +58,12 @@ namespace zypp
     std::string sourcerpm;
     std::string headerStart;
     std::string headerEnd;
-    std::list<YUMDependency> provides;
-    std::list<YUMDependency> conflicts;
-    std::list<YUMDependency> obsoletes;
-    std::list<YUMDependency> requires;
     std::list<FileData> files;
     // SuSE specific data
     std::list<std::string> authors;
     std::list<std::string> keywords;
     std::string  media;
     std::list<YUMDirSize> dirSizes;
-    std::list<YUMDependency> freshen;
     bool installOnly;
     // Change Log
     std::list<ChangelogEntry> changelog;
index cca4616..f22dd41 100644 (file)
@@ -28,10 +28,7 @@ namespace zypp
       //
       //        CLASS NAME : YUMPackageImpl
       //
-      /** Class representing an update script
-       *
-       * \todo Fix brief descriptions, or delete them. This is not an update
-       * script, It's implementation of zypp::Package for YUM source.
+      /** Class representing a package
        *
        * \todo Deriving from detail::PackageImpl is useless here. PackageImpl
        * is dumb, i.e. it provides nothing, but the dtor needed to instanciate
diff --git a/zypp/source/yum/YUMPatchImpl.cc b/zypp/source/yum/YUMPatchImpl.cc
new file mode 100644 (file)
index 0000000..43046d0
--- /dev/null
@@ -0,0 +1,109 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMPatchImpl.cc
+ *
+*/
+
+#include "zypp/source/yum/YUMPatchImpl.h"
+#include "zypp/source/yum/YUMSource.h"
+#include <zypp/CapFactory.h>
+#include "zypp/parser/yum/YUMParserData.h"
+#include <zypp/parser/yum/YUMParser.h>
+#include "zypp/Package.h"
+#include "zypp/Script.h"
+#include "zypp/Message.h"
+#include "zypp/base/Logger.h"
+
+
+using namespace std;
+using namespace zypp::detail;
+using namespace zypp::parser::yum;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace source
+  { /////////////////////////////////////////////////////////////////
+    namespace yum
+    {
+      ///////////////////////////////////////////////////////////////////
+      //
+      //        CLASS NAME : YUMPatchImpl
+      //
+      ///////////////////////////////////////////////////////////////////
+
+      /** Default ctor
+       * \bug CANT BE CONSTUCTED THAT WAY ANYMORE
+      */
+      YUMPatchImpl::YUMPatchImpl(
+       const zypp::parser::yum::YUMPatchData & parsed,
+       YUMSource * src
+      )
+      {
+       CapFactory _f;
+       Capability cap( _f.parse(
+         Resolvable::Kind("Patch"),
+         parsed.name,
+         Edition(),
+         Arch("noarch")));
+
+       for (std::list<shared_ptr<YUMPatchAtom> >::const_iterator it
+                                       = parsed.atoms.begin();
+            it != parsed.atoms.end();
+            it++)
+       {
+          switch ((*it)->atomType())
+          {
+            case YUMPatchAtom::Package: {
+              shared_ptr<YUMPatchPackage> package_data
+                = dynamic_pointer_cast<YUMPatchPackage>(*it);
+              Package::Ptr package = src->createPackage(*package_data);
+              _atoms.push_back(package);
+              break;
+            }
+            case YUMPatchAtom::Message: {
+              shared_ptr<YUMPatchMessage> message_data
+                = dynamic_pointer_cast<YUMPatchMessage>(*it);
+              Message::Ptr message = src->createMessage(*message_data);
+              _atoms.push_back(message);
+              break;
+            }
+            case YUMPatchAtom::Script: {
+              shared_ptr<YUMPatchScript> script_data
+                = dynamic_pointer_cast<YUMPatchScript>(*it);
+              Script::Ptr script = src->createScript(*script_data);
+              _atoms.push_back(script);
+              break;
+            }
+            default:
+              ERR << "Unknown type of atom" << endl;
+          }
+         for (AtomList::iterator it = _atoms.begin();
+              it != _atoms.end();
+              it++)
+         {
+           Dependencies _deps = (*it)->deps();
+           CapSet _req = _deps.requires();
+           _req.insert(cap);
+           _deps.setRequires(_req);
+           (*it)->setDeps(_deps);
+         }
+         
+       }
+      }
+
+
+    } // namespace yum
+    /////////////////////////////////////////////////////////////////
+  } // namespace source
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/source/yum/YUMPatchImpl.h b/zypp/source/yum/YUMPatchImpl.h
new file mode 100644 (file)
index 0000000..5147c20
--- /dev/null
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMPatchImpl.h
+ *
+*/
+#ifndef ZYPP_SOURCE_YUM_YUMPATCHIMPL_H
+#define ZYPP_SOURCE_YUM_YUMPATCHIMPL_H
+
+#include "zypp/detail/PatchImpl.h"
+#include "zypp/parser/yum/YUMParserData.h"
+#include "zypp/source/yum/YUMSource.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace source
+  { /////////////////////////////////////////////////////////////////
+    namespace yum
+    { //////////////////////////////////////////////////////////////
+
+      ///////////////////////////////////////////////////////////////////
+      //
+      //        CLASS NAME : YUMPatchImpl
+      //
+      /** Class representing a patch
+      */
+      class YUMPatchImpl : public detail::PatchImpl
+      {
+      public:
+        /** Default ctor */
+        YUMPatchImpl(
+         const zypp::parser::yum::YUMPatchData & parsed,
+         YUMSource * src
+       );
+       };
+      ///////////////////////////////////////////////////////////////////
+    } // namespace yum
+    /////////////////////////////////////////////////////////////////
+  } // namespace source
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_YUM_YUMPATCHIMPL_H
index 7a7dbd7..fe29dd1 100644 (file)
 */
 
 #include "zypp/source/yum/YUMScriptImpl.h"
+#include "zypp/Arch.h"
+#include "zypp/Edition.h"
+#include <zypp/detail/ResObjectFactory.h>
+
 
 using namespace std;
 using namespace zypp::detail;
@@ -37,27 +41,9 @@ namespace zypp
       YUMScriptImpl::YUMScriptImpl(
        const zypp::parser::yum::YUMPatchScript & parsed
       )
-#warning MA: CANT BE CONSTUCTED THAT WAY ANYMORE
-#if 0
-      : ScriptImpl(
-       parsed.name,
-       Edition(parsed.ver, parsed.rel, strtol(parsed.epoch.c_str(), NULL, 10)),
-       Arch("noarch")
-
-      )
-#endif
       {
        _do_script = parsed.do_script;
        _undo_script = parsed.undo_script;
-/*
-    std::list<YUMDependency> provides;
-    std::list<YUMDependency> conflicts;
-    std::list<YUMDependency> obsoletes;
-    std::list<YUMDependency> freshen;
-    std::list<YUMDependency> requires;
-
-
-*/
       }
     } // namespace yum
     /////////////////////////////////////////////////////////////////
index be312f7..adfabdc 100644 (file)
@@ -34,7 +34,7 @@ namespace zypp
       public:
         /** Default ctor */
         YUMScriptImpl( const zypp::parser::yum::YUMPatchScript & parsed );
-       };
+      };
       ///////////////////////////////////////////////////////////////////
     } // namespace yum
     /////////////////////////////////////////////////////////////////
diff --git a/zypp/source/yum/YUMSource.cc b/zypp/source/yum/YUMSource.cc
new file mode 100644 (file)
index 0000000..1962664
--- /dev/null
@@ -0,0 +1,191 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMSource.cc
+ *
+*/
+
+#include "zypp/source/yum/YUMSource.h"
+#include "zypp/source/yum/YUMPackageImpl.h"
+#include "zypp/source/yum/YUMScriptImpl.h"
+#include "zypp/source/yum/YUMMessageImpl.h"
+#include "zypp/source/yum/YUMPatchImpl.h"
+
+#include <zypp/CapFactory.h>
+
+using namespace std;
+using namespace zypp::detail;
+using namespace zypp::parser::yum;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace source
+  { /////////////////////////////////////////////////////////////////
+    namespace yum
+    {
+      ///////////////////////////////////////////////////////////////////
+      //
+      //        CLASS NAME : YUMSource
+      //
+      ///////////////////////////////////////////////////////////////////
+
+      /** Default ctor
+      */
+        YUMSource::YUMSource()
+       {}
+
+
+       Package::Ptr YUMSource::createPackage(
+         const zypp::parser::yum::YUMPatchPackage & parsed
+       )
+       {
+         shared_ptr<YUMPackageImpl> impl(new YUMPackageImpl(parsed));
+         Dependencies _deps = createDependencies(parsed);
+         Package::Ptr package = detail::makeResolvableFromImpl(
+           parsed.name,
+           Edition( parsed.ver, parsed.rel ),
+           Arch( parsed.arch ),
+           impl
+         );
+         package->setDeps(_deps);
+         return package;
+       }
+       Message::Ptr YUMSource::createMessage(
+         const zypp::parser::yum::YUMPatchMessage & parsed
+       )
+       {
+         shared_ptr<YUMMessageImpl> impl(new YUMMessageImpl(parsed));
+         Dependencies _deps = createDependencies(parsed);
+         Message::Ptr message = detail::makeResolvableFromImpl(
+           parsed.name,
+           Edition( parsed.ver, parsed.rel ),
+           Arch( "noarch" ),
+           impl
+         );
+         message->setDeps(_deps);
+         return message;
+       }
+
+       Script::Ptr YUMSource::createScript(
+         const zypp::parser::yum::YUMPatchScript & parsed
+       )
+       {
+         shared_ptr<YUMScriptImpl> impl(new YUMScriptImpl(parsed));
+         Dependencies _deps = createDependencies(parsed);
+         Script::Ptr script = detail::makeResolvableFromImpl(
+           parsed.name,
+           Edition( parsed.ver, parsed.rel ),
+           Arch( "noarch" ),
+           impl
+         );
+         script->setDeps(_deps);
+         return script;
+       }
+
+       Patch::Ptr YUMSource::createPatch(
+         const zypp::parser::yum::YUMPatchData & parsed
+       )
+       {
+         shared_ptr<YUMPatchImpl> impl(new YUMPatchImpl(parsed, this));
+//       Dependencies _deps = createDependencies(parsed);
+         Patch::Ptr patch = detail::makeResolvableFromImpl(
+           parsed.name,
+           Edition( parsed.ver, parsed.rel ),
+           Arch( "noarch" ),
+           impl
+         );
+//       patch->setDeps(_deps);
+         return patch;
+       }
+
+       Dependencies YUMSource::createDependencies(
+         const zypp::parser::yum::YUMPatchAtom & parsed
+       )
+       {
+         CapFactory _f;
+         CapSet _provides;
+         CapSet _conflicts;
+         CapSet _obsoletes;
+         CapSet _freshens;
+         CapSet _requires;
+         CapSet _prerequires;
+         Dependencies _deps;
+         for (std::list<YUMDependency>::const_iterator it = parsed.provides.begin();
+              it != parsed.provides.end();
+              it++)
+         {
+           // FIXME do not create the string this way
+           // FIXME other types than only packages
+           // FIXME use also the flags
+           _provides.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+         }
+  
+         for (std::list<YUMDependency>::const_iterator it = parsed.conflicts.begin();
+              it != parsed.conflicts.end();
+              it++)
+         {
+           // FIXME do not create the string this way
+           // FIXME other types than only packages
+           // FIXME use also the flags
+           _conflicts.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+         }
+  
+         for (std::list<YUMDependency>::const_iterator it = parsed.obsoletes.begin();
+              it != parsed.obsoletes.end();
+              it++)
+         {
+           // FIXME do not create the string this way
+           // FIXME other types than only packages
+           // FIXME use also the flags
+           _obsoletes.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+         }
+  
+         for (std::list<YUMDependency>::const_iterator it = parsed.freshen.begin();
+              it != parsed.freshen.end();
+              it++)
+         {
+           // FIXME do not create the string this way
+           // FIXME other types than only packages
+           // FIXME use also the flags
+           _freshens.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+         }
+  
+         for (std::list<YUMDependency>::const_iterator it = parsed.requires.begin();
+              it != parsed.requires.end();
+              it++)
+         {
+           // FIXME do not create the string this way
+           // FIXME other types than only packages
+           // FIXME use also the flags
+           if (it->pre == "1")
+             _prerequires.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+           else
+             _requires.insert (_f.parse(it->name + " = " + it->ver + "-" + it->rel));
+         }
+  
+         _deps.setProvides(_provides);
+         _deps.setConflicts(_conflicts);
+         _deps.setObsoletes(_obsoletes);
+         _deps.setFreshens(_freshens);
+         _deps.setRequires(_requires);
+         _deps.setPrerequires(_prerequires);
+         return _deps;
+       }
+  
+
+
+
+    } // namespace yum
+    /////////////////////////////////////////////////////////////////
+  } // namespace source
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/source/yum/YUMSource.h b/zypp/source/yum/YUMSource.h
new file mode 100644 (file)
index 0000000..7ab5d6e
--- /dev/null
@@ -0,0 +1,72 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMSource.h
+ *
+*/
+#ifndef ZYPP_SOURCE_YUM_YUMSOURCE_H
+#define ZYPP_SOURCE_YUM_YUMSOURCE_H
+
+#include "zypp/source/Source.h"
+#include "zypp/parser/yum/YUMParserData.h"
+#include "zypp/Package.h"
+#include "zypp/Message.h"
+#include "zypp/Script.h"
+#include "zypp/Patch.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace source
+  { /////////////////////////////////////////////////////////////////
+    namespace yum
+    { //////////////////////////////////////////////////////////////
+
+      ///////////////////////////////////////////////////////////////////
+      //
+      //        CLASS NAME : YUMSource
+      //
+      /** Class representing a YUM installation source
+      */
+      class YUMSource : public source::Source
+      {
+      public:
+        /** Default ctor */
+        YUMSource();
+
+       Package::Ptr createPackage(
+         const zypp::parser::yum::YUMPatchPackage & parsed
+       );
+       Message::Ptr createMessage(
+         const zypp::parser::yum::YUMPatchMessage & parsed
+       );
+       Script::Ptr createScript(
+         const zypp::parser::yum::YUMPatchScript & parsed
+       );
+       Patch::Ptr createPatch(
+         const zypp::parser::yum::YUMPatchData & parsed
+       );
+
+
+       Dependencies createDependencies(
+         const zypp::parser::yum::YUMPatchAtom & parsed
+       );
+
+
+
+       };
+      ///////////////////////////////////////////////////////////////////
+    } // namespace yum
+    /////////////////////////////////////////////////////////////////
+  } // namespace source
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_YUM_YUMSOURCE_H