Added preliminary Patch, Message and Script implementations
authorJiri Srain <jsrain@suse.cz>
Mon, 17 Oct 2005 11:57:07 +0000 (11:57 +0000)
committerJiri Srain <jsrain@suse.cz>
Mon, 17 Oct 2005 11:57:07 +0000 (11:57 +0000)
14 files changed:
zypp/Makefile.am
zypp/Message.cc [new file with mode: 0644]
zypp/Message.h [new file with mode: 0644]
zypp/Patch.cc [new file with mode: 0644]
zypp/Patch.h [new file with mode: 0644]
zypp/Script.cc [new file with mode: 0644]
zypp/Script.h [new file with mode: 0644]
zypp/detail/Makefile.am
zypp/detail/MessageImpl.cc [new file with mode: 0644]
zypp/detail/MessageImpl.h [new file with mode: 0644]
zypp/detail/PatchImpl.cc [new file with mode: 0644]
zypp/detail/PatchImpl.h [new file with mode: 0644]
zypp/detail/ScriptImpl.cc [new file with mode: 0644]
zypp/detail/ScriptImpl.h [new file with mode: 0644]

index a1c666a..2036d7c 100644 (file)
@@ -12,7 +12,10 @@ include_HEADERS = \
        ResName.h       \
        Resolvable.h    \
        Package.h       \
-       Selection.h
+       Selection.h     \
+       Message.h       \
+       Script.h        \
+       Patch.h
 
 ## ##################################################
 
@@ -27,7 +30,10 @@ lib@PACKAGE@_la_SOURCES = \
        ResName.cc      \
        Resolvable.cc   \
        Package.cc      \
-       Selection.cc
+       Selection.cc    \
+       Message.cc      \
+       Script.cc       \
+       Patch.cc
 
 lib@PACKAGE@_la_LDFLAGS =      @LIB_VERSION_INFO@
 
diff --git a/zypp/Message.cc b/zypp/Message.cc
new file mode 100644 (file)
index 0000000..4c8323c
--- /dev/null
@@ -0,0 +1,65 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Message.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/Message.h"
+#include "zypp/detail/ResolvableImpl.h"
+#include "zypp//Resolvable.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Message::Message
+  //   METHOD TYPE : Ctor
+  //
+  Message::Message( detail::MessageImplPtr impl_r )
+  : Resolvable ( impl_r )
+  , _pimpl( impl_r )
+  {}
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Message::~Message
+  //   METHOD TYPE : Dtor
+  //
+  Message::~Message()
+  {}
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Message::text
+  //   Get the text of the message
+  //
+  std::string Message::text ()
+  {
+    return _pimpl->text ();
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Message::text
+  //   Get the type of the message ("OK", "YesNo")
+  //
+  std::string Message::type ()
+  {
+    return _pimpl->type ();
+  }
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/Message.h b/zypp/Message.h
new file mode 100644 (file)
index 0000000..b1aee67
--- /dev/null
@@ -0,0 +1,56 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Message.h
+ *
+*/
+#ifndef ZYPP_MESSAGE_H
+#define ZYPP_MESSAGE_H
+
+#include <iosfwd>
+
+#include "zypp/detail/MessageImpl.h"
+#include "zypp/Resolvable.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+    DEFINE_PTR_TYPE(MessageImpl)
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  DEFINE_PTR_TYPE(Message)
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   CLASS NAME : Message
+  //
+  /** */
+  class Message : public Resolvable
+  {
+  public:
+    /** Default ctor */
+    Message( detail::MessageImplPtr impl_r );
+    /** Dtor */
+    ~Message();
+  public:
+    std::string text ();
+    std::string type ();
+  private:
+    /** Pointer to implementation */
+    detail::MessageImplPtr _pimpl;
+  };
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_MESSAGE_H
diff --git a/zypp/Patch.cc b/zypp/Patch.cc
new file mode 100644 (file)
index 0000000..7f1c2e8
--- /dev/null
@@ -0,0 +1,114 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Patch.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/Patch.h"
+#include "zypp/detail/ResolvableImpl.h"
+#include "zypp//Resolvable.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::Patch
+  //   METHOD TYPE : Ctor
+  //
+  Patch::Patch( detail::PatchImplPtr impl_r )
+  : Resolvable (impl_r)
+  , _pimpl( impl_r )
+  {
+  }
+
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::~Patch
+  //   METHOD TYPE : Dtor
+  //
+  Patch::~Patch()
+  {}
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::interactive
+  //   Check whether patch can be applied only interactivly
+  //
+  bool Patch::interactive ()
+  {
+    return _pimpl->interactive ();
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::category
+  //   Get the category of the patch
+  //
+  std::string Patch::category ()
+  {
+    return _pimpl->_category;
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::summary
+  //   Get the patch summary
+  //
+  std::string Patch::summary ()
+  {
+    return _pimpl->_summary["en"];
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::description
+  //   Get the patch description
+  //
+  std::string Patch::description ()
+  {
+    return _pimpl->_description["en"];
+  }
+
+  void Patch::mark_atoms_to_freshen (bool freshen)
+  {
+    _pimpl->mark_atoms_to_freshen (freshen);
+  }
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::any_atom_selected
+  //   Check whether there is at least one atom of the solution selected
+  //
+  bool Patch::any_atom_selected ()
+  {
+    return _pimpl->any_atom_selected ();
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Patch::select
+  //   Mark all atoms to be updated (set them as freshen) and mark
+  //    the patch itself as selected for being installed/updated
+  //
+  // FIXME to be changed to inherit Resolvable's method
+  void Patch::select ()
+//  : Resolvable::select ()
+  {
+    mark_atoms_to_freshen (true); // FIXME
+  }
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/Patch.h b/zypp/Patch.h
new file mode 100644 (file)
index 0000000..29c7271
--- /dev/null
@@ -0,0 +1,64 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Patch.h
+ *
+*/
+#ifndef ZYPP_PATCH_H
+#define ZYPP_PATCH_H
+
+#include <iosfwd>
+
+#include "zypp/detail/PatchImpl.h"
+#include "zypp/Resolvable.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+    DEFINE_PTR_TYPE(PatchImpl)
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  DEFINE_PTR_TYPE(Patch)
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   CLASS NAME : Patch
+  //
+  /** */
+  class Patch : public Resolvable
+  {
+  public:
+    /** Default ctor */
+    Patch( detail::PatchImplPtr impl_r );
+    /** Dtor */
+    ~Patch();
+  public:
+    bool interactive ();
+    std::string do_script ();
+    std::string undo_script ();
+    bool undo_available ();
+    std::string category ();
+    std::string description ();
+    std::string summary ();
+    void mark_atoms_to_freshen (bool freshen);
+    bool any_atom_selected ();
+    void select (); // TODO parameter to specify select/unselect or another function
+  private:
+    /** Pointer to implementation */
+    detail::PatchImplPtr _pimpl;
+  };
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_PATCH_H
diff --git a/zypp/Script.cc b/zypp/Script.cc
new file mode 100644 (file)
index 0000000..16499ca
--- /dev/null
@@ -0,0 +1,75 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Script.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/Script.h"
+#include "zypp/detail/ResolvableImpl.h"
+#include "zypp//Resolvable.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Script::Script
+  //   METHOD TYPE : Ctor
+  //
+  Script::Script( detail::ScriptImplPtr impl_r )
+  : Resolvable (impl_r)
+  , _pimpl( impl_r )
+  {}
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Script::~Script
+  //   METHOD TYPE : Dtor
+  //
+  Script::~Script()
+  {}
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Script::do_script
+  //   Get the script to perform the action
+  //
+  std::string Script::do_script ()
+  {
+    return _pimpl->do_script ();
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Script::undo_script
+  //   Get the script to revert the action
+  //
+  std::string Script::undo_script ()
+  {
+    return _pimpl->undo_script ();
+  }
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   METHOD NAME : Script::undo_available
+  //   Check whether the action can be reverted
+  //
+  bool Script::undo_available ()
+  {
+    return _pimpl->undo_available ();
+  }
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/Script.h b/zypp/Script.h
new file mode 100644 (file)
index 0000000..3231f61
--- /dev/null
@@ -0,0 +1,57 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/Script.h
+ *
+*/
+#ifndef ZYPP_SCRIPT_H
+#define ZYPP_SCRIPT_H
+
+#include <iosfwd>
+
+#include "zypp/detail/ScriptImpl.h"
+#include "zypp/Resolvable.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+    DEFINE_PTR_TYPE(ScriptImpl)
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  DEFINE_PTR_TYPE(Script)
+
+  ///////////////////////////////////////////////////////////////////
+  //
+  //   CLASS NAME : Script
+  //
+  /** */
+  class Script : public Resolvable
+  {
+  public:
+    /** Default ctor */
+    Script( detail::ScriptImplPtr impl_r );
+    /** Dtor */
+    ~Script();
+  public:
+    std::string do_script ();
+    std::string undo_script ();
+    bool undo_available ();
+  private:
+    /** Pointer to implementation */
+    detail::ScriptImplPtr _pimpl;
+  };
+
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SCRIPT_H
index 085f424..c831963 100644 (file)
@@ -5,19 +5,25 @@ SUBDIRS =
 
 ## ##################################################
 
-include_HEADERS = \
+include_HEADERS =              \
        ResolvableImpl.h        \
        PackageImpl.h           \
-       SelectionImpl.h
+       SelectionImpl.h         \
+       MessageImpl.h           \
+       ScriptImpl.h            \
+       PatchImpl.h
 
 
 noinst_LTLIBRARIES =   lib@PACKAGE@_detail.la
 
 ## ##################################################
 
-lib@PACKAGE@_detail_la_SOURCES = \
-       ResolvableImpl.cc       \
-       PackageImpl.cc          \
-       SelectionImpl.cc
+lib@PACKAGE@_detail_la_SOURCES =       \
+       ResolvableImpl.cc               \
+       PackageImpl.cc                  \
+       SelectionImpl.cc                \
+       MessageImpl.cc                  \
+       ScriptImpl.cc                   \
+       PatchImpl.cc
 
 ## ##################################################
diff --git a/zypp/detail/MessageImpl.cc b/zypp/detail/MessageImpl.cc
new file mode 100644 (file)
index 0000000..617ecfd
--- /dev/null
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/MessageImpl.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/detail/MessageImpl.h"
+#include "zypp/Message.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : MessageImpl
+    //
+    ///////////////////////////////////////////////////////////////////
+
+    /** Default ctor */
+    MessageImpl::MessageImpl( const ResName & name_r,
+                             const Edition & edition_r,
+                             const Arch & arch_r )
+    : ResolvableImpl (ResKind ("message"),
+                     ResName (name_r),
+                     Edition (edition_r),
+                     Arch (arch_r))
+    {
+    }
+    /** Dtor */
+    MessageImpl::~MessageImpl()
+    {
+    }
+
+    std::string MessageImpl::type () const {
+      return _type;
+    }
+
+    std::string MessageImpl::text () const {
+      return _text;
+    }
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/detail/MessageImpl.h b/zypp/detail/MessageImpl.h
new file mode 100644 (file)
index 0000000..9f1e7e0
--- /dev/null
@@ -0,0 +1,59 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/MessageImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_MESSAGEIMPL_H
+#define ZYPP_DETAIL_MESSAGEIMPL_H
+
+#include <iosfwd>
+
+#include "zypp/detail/ResolvableImpl.h"
+//#include "zypp/Resolvable.h"
+//#include "zypp/Message.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : MessageImpl
+    //
+    /** */
+    class MessageImpl : public ResolvableImpl
+    {
+    public:
+      /** Default ctor */
+      MessageImpl( const ResName & name_r,
+                  const Edition & edition_r,
+                  const Arch & arch_r );
+      /** Dtor */
+      ~MessageImpl();
+
+    public:
+      virtual std::string text () const;
+      virtual std::string type () const;
+    protected:
+      std::string _text;
+      std::string _type;
+    };
+    ///////////////////////////////////////////////////////////////////
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_MESSAGEIMPL_H
diff --git a/zypp/detail/PatchImpl.cc b/zypp/detail/PatchImpl.cc
new file mode 100644 (file)
index 0000000..be16f38
--- /dev/null
@@ -0,0 +1,106 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/PatchImpl.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/detail/PatchImpl.h"
+#include "zypp/Patch.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : PatchImpl
+    //
+    ///////////////////////////////////////////////////////////////////
+
+    /** Default ctor */
+    PatchImpl::PatchImpl( const ResName & name_r,
+                         const Edition & edition_r,
+                         const Arch & arch_r )
+    : ResolvableImpl (ResKind ("patch"),
+                     ResName (name_r),
+                     Edition (edition_r),
+                     Arch (arch_r))
+    {
+    }
+
+    /** Dtor */
+    PatchImpl::~PatchImpl()
+    {
+    }
+
+    bool PatchImpl::interactive () {
+      if (_reboot_needed)
+       return true;
+      atom_list not_installed = not_installed_atoms ();
+      for (atom_list::iterator it = not_installed.begin ();
+       it != not_installed.end ();
+       it++)
+      {
+       if ((std::string)((*it)->kind ()) == "message")
+       // FIXME package with license
+       {
+         return true;
+       }
+      }
+      return false;
+    }
+
+    atom_list PatchImpl::not_installed_atoms () {
+      atom_list ret;
+      for (atom_list::iterator it = _atoms.begin ();
+       it != _atoms.end ();
+       it++)
+      {
+       if (false) // FIXME check if atom/resolvable is not installed
+       {
+         ret.push_back (*it);
+       }
+      }
+      return ret;
+    }
+
+    bool PatchImpl::any_atom_selected () {
+      for (atom_list::iterator it = _atoms.begin ();
+       it != _atoms.end ();
+       it++)
+      {
+       if (false) // FIXME check if atom/resolvable is selected
+       {
+         return true;
+       }
+      }
+      return false;
+    }
+
+    void PatchImpl::mark_atoms_to_freshen (bool freshen) {
+      for (atom_list::iterator it = _atoms.begin ();
+       it != _atoms.end ();
+       it++)
+      {
+       // TODO mark the resolvable to be or not to be freshed
+      }
+    }
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/detail/PatchImpl.h b/zypp/detail/PatchImpl.h
new file mode 100644 (file)
index 0000000..4bb6376
--- /dev/null
@@ -0,0 +1,72 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/PatchImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_PATCHIMPL_H
+#define ZYPP_DETAIL_PATCHIMPL_H
+
+#include <map>
+#include <list>
+#include <string>
+
+#include "zypp/detail/ResolvableImpl.h"
+#include "zypp/Resolvable.h"
+#include "zypp/Patch.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+//    typedef std::list<Resolvable> atom_list;
+    #define atom_list std::list<ResolvablePtr>
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : PatchImpl
+    //
+    /** */
+    class PatchImpl : public ResolvableImpl
+    {
+    public:
+      /** Default ctor */
+      PatchImpl( const ResName & name_r,
+                const Edition & edition_r,
+                const Arch & arch_r );
+      /** Dtor */
+      ~PatchImpl();
+
+    public:
+      std::string _category;
+      std::map<std::string,std::string> _summary;
+      std::map<std::string,std::string> _description;
+      int _timestamp;
+      std::string _patch_id;
+      bool _reboot_needed;
+      bool _package_manager;
+
+      bool interactive ();
+      bool any_atom_selected ();
+      void mark_atoms_to_freshen (bool freshen);
+    protected:
+      atom_list not_installed_atoms ();
+      atom_list _atoms;
+    };
+    ///////////////////////////////////////////////////////////////////
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_PATCHIMPL_H
diff --git a/zypp/detail/ScriptImpl.cc b/zypp/detail/ScriptImpl.cc
new file mode 100644 (file)
index 0000000..a3bd617
--- /dev/null
@@ -0,0 +1,65 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/ScriptImpl.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/base/Logger.h"
+#include "zypp/detail/ScriptImpl.h"
+#include "zypp/Script.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : ScriptImpl
+    //
+    ///////////////////////////////////////////////////////////////////
+
+    /** Default ctor */
+    ScriptImpl::ScriptImpl( const ResName & name_r,
+                           const Edition & edition_r,
+                           const Arch & arch_r )
+    : ResolvableImpl (ResKind ("script"),
+                     ResName (name_r),
+                     Edition (edition_r),
+                     Arch (arch_r))
+    {
+    }
+    /** Dtor */
+    ScriptImpl::~ScriptImpl()
+    {
+    }
+
+    std::string ScriptImpl::do_script () const {
+      return _do_script;
+    }
+
+    std::string ScriptImpl::undo_script () const {
+      return _undo_script;
+    }
+
+    bool ScriptImpl::undo_available () const {
+      return _undo_script != "";
+    }
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
diff --git a/zypp/detail/ScriptImpl.h b/zypp/detail/ScriptImpl.h
new file mode 100644 (file)
index 0000000..597b6e5
--- /dev/null
@@ -0,0 +1,60 @@
+/*---------------------------------------------------------------------\
+|                          ____ _   __ __ ___                          |
+|                         |__  / \ / / . \ . \                         |
+|                           / / \ V /|  _/  _/                         |
+|                          / /__ | | | | | |                           |
+|                         /_____||_| |_| |_|                           |
+|                                                                      |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/ScriptImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_SCRIPTIMPL_H
+#define ZYPP_DETAIL_SCRIPTIMPL_H
+
+#include <iosfwd>
+
+#include "zypp/detail/ResolvableImpl.h"
+#include "zypp/Resolvable.h"
+#include "zypp/Script.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+  ///////////////////////////////////////////////////////////////////
+  namespace detail
+  { /////////////////////////////////////////////////////////////////
+
+
+    ///////////////////////////////////////////////////////////////////
+    //
+    // CLASS NAME : ScriptImpl
+    //
+    /** */
+    class ScriptImpl : public ResolvableImpl
+    {
+    public:
+      /** Default ctor */
+      ScriptImpl( const ResName & name_r,
+                 const Edition & edition_r,
+                 const Arch & arch_r );
+      /** Dtor */
+      ~ScriptImpl();
+
+    public:
+      std::string do_script () const;
+      std::string undo_script () const;
+      bool undo_available () const;
+    protected:
+      std::string _do_script;
+      std::string _undo_script;
+    };
+    ///////////////////////////////////////////////////////////////////
+
+    /////////////////////////////////////////////////////////////////
+  } // namespace detail
+  ///////////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_SCRIPTIMPL_H