## Process this file with automake to produce Makefile.in
## ##################################################
-noinst_PROGRAMS = Main Main.debug Msg Msg.debug Patch Patch.debug Script Script.debug
+noinst_PROGRAMS = Main Main.debug Msg Msg.debug Patch Patch.debug Script Script.debug PatchSelect PatchSelect.debug
## ##################################################
Script_debug_SOURCES = $(Script_SOURCES)
Script_debug_LDFLAGS = -static
+PatchSelect_SOURCES = PatchSelect.cc
+
+PatchSelect_debug_SOURCES = $(PatchSelect_SOURCES)
+PatchSelect_debug_LDFLAGS = -static
+
## ##################################################
.PHONY: always
#include <iostream>
-#include <fstream>
-#include <iterator>
-#include <algorithm>
-#include <set>
-#include <map>
-#include <list>
-#include <vector>
-#include <ext/hash_set>
-#include <ext/hash_map>
-#include <ext/rope>
-
#include <zypp/base/Logger.h>
-#include <zypp/base/String.h>
-
-///////////////////////////////////////////////////////////////////
-
-#include <zypp/Message.h>
#include <zypp/detail/MessageImpl.h>
#include <iostream>
-#include <fstream>
-#include <iterator>
-#include <algorithm>
-#include <set>
-#include <map>
-#include <list>
-#include <vector>
-#include <ext/hash_set>
-#include <ext/hash_map>
-#include <ext/rope>
-
#include <zypp/base/Logger.h>
-#include <zypp/base/String.h>
///////////////////////////////////////////////////////////////////
#include <zypp/Message.h>
#include <zypp/detail/MessageImpl.h>
-#include <zypp/Patch.h>
#include <zypp/detail/PatchImpl.h>
#include <zypp/Package.h>
#include <zypp/detail/PackageImpl.h>
--- /dev/null
+#include <iostream>
+#include <zypp/base/Logger.h>
+
+///////////////////////////////////////////////////////////////////
+
+#include <zypp/Message.h>
+#include <zypp/detail/MessageImpl.h>
+#include <zypp/detail/PatchImpl.h>
+#include <zypp/Package.h>
+#include <zypp/detail/PackageImpl.h>
+
+#include <map>
+#include <set>
+
+
+using namespace std;
+using namespace zypp;
+
+DEFINE_PTR_TYPE(MyPatchImpl)
+
+class MyPatchImpl : public detail::PatchImpl
+{
+ public:
+ MyPatchImpl( std::string name,
+ std::list<ResolvablePtr> atoms,
+ std::string category)
+ : PatchImpl (name,
+ Edition (),
+ Arch ("noarch"))
+ {
+ _reboot_needed = false;
+ _atoms = atoms;
+ _category = category;
+ }
+};
+
+/******************************************************************
+**
+**
+** FUNCTION NAME : main
+** FUNCTION TYPE : int
+**
+** DESCRIPTION :
+*/
+int main( int argc, char * argv[] )
+{
+ INT << "===[START]==========================================" << endl;
+
+ atom_list atoms;
+
+ std::string _name( "foo" );
+ Edition _edition( "1.0", "42" );
+ Arch _arch( "i386" );
+ detail::PackageImplPtr pi( new detail::PackageImpl(_name,_edition,_arch) );
+ PackagePtr p (new Package (pi));
+ atoms.push_back (p);
+
+ std::string _name2( "bar" );
+ Edition _edition2( "1.0", "43" );
+ Arch _arch2( "noarch" );
+ detail::PackageImplPtr pi2(new detail::PackageImpl(_name2,_edition2,_arch2));
+ PackagePtr p2 (new Package (pi2));
+ atoms.push_back (p2);
+
+ MyPatchImplPtr q (new MyPatchImpl ("patch1", atoms, "recommended"));
+ PatchPtr patch1 (new Patch (q));
+
+ atom_list atoms2;
+ std::string _name3( "msg" );
+ Arch _arch3( "noarch" );
+ detail::MessageImplPtr mi(new detail::MessageImpl(_name3,Edition (),_arch3));
+ MessagePtr m (new Message (mi));
+ atoms2.push_back (m);
+
+ MyPatchImplPtr q2 (new MyPatchImpl ("patch2", atoms2, "recommended"));
+ PatchPtr patch2 (new Patch (q2));
+
+ list<PatchPtr> patches;
+ patches.push_back (patch1);
+ patches.push_back (patch2);
+
+ // input values
+ bool interactive_run = true;
+ set<string> levels_to_preselect;
+ levels_to_preselect.insert ("security");
+ levels_to_preselect.insert ("recommended");
+
+ // output values
+ list<PatchPtr> patches_to_display;
+ list<PatchPtr> patches_for_manual;
+
+// really start here
+
+ // count patches to offer
+ if (interactive_run)
+ {
+ for (list<PatchPtr>::iterator it = patches.begin();
+ it != patches.end();
+ it++)
+ {
+ (*it)->select ();
+ }
+ DBG << "Running solver here..." << endl; // TODO
+ for (list<PatchPtr>::iterator it = patches.begin();
+ it != patches.end();
+ it++)
+ {
+ if ((*it)->any_atom_selected())
+ {
+ patches_to_display.push_back( *it );
+ }
+ (*it)->select();
+ }
+ }
+
+ // count patches to preselect
+ for (list<PatchPtr>::iterator it = patches.begin();
+ it != patches.end();
+ it++)
+ {
+ PatchPtr ptr = *it;
+ string category = ptr->category ();
+ // interactive patches can be applied only in interactive mode
+ if (interactive_run
+ || (! (ptr->reboot_needed() || ptr->interactive())))
+ {
+ if (levels_to_preselect.count( category ) > 0)
+ {
+ // select only packages severe enough
+ DBG << "Selecting patch: " << *ptr << endl;
+ ptr->select();
+ }
+ else
+ {
+ // and the rest keep neutral (they can be selected by dependencies)
+ DBG << "Category unsufficient: " << *ptr << endl;
+ ptr->select(); // FIXME unselect, but not taboo
+ }
+ }
+ else
+ {
+ // in non-interactive mode, they mustn't be applied in any case
+ DBG << "Patch interactive: " << *ptr << endl;
+ ptr->select(); // FIXME taboo - mustn't be selected by resolver
+ // instead, admin should be notified
+ patches_for_manual.push_back( ptr );
+
+ }
+ }
+ DBG << "Running solver here..." << endl; // TODO
+ // hoping resolver solves obsoletes as well
+
+ for (list<PatchPtr>::iterator it = patches.begin();
+ it != patches.end();
+ it++)
+ {
+ PatchPtr ptr = *it;
+ if (! ptr->any_atom_selected())
+ {
+ ptr->select(); // TODO use deselected here instead
+ }
+ }
+
+ INT << "===[END]============================================" << endl;
+ return 0;
+}
#include <iostream>
-#include <fstream>
-#include <iterator>
-#include <algorithm>
-#include <set>
-#include <map>
-#include <list>
-#include <vector>
-#include <ext/hash_set>
-#include <ext/hash_map>
-#include <ext/rope>
-
#include <zypp/base/Logger.h>
-#include <zypp/base/String.h>
-
-///////////////////////////////////////////////////////////////////
-
-#include <zypp/Script.h>
#include <zypp/detail/ScriptImpl.h>
Message.h \
Script.h \
SolverContext.h \
- Patch.h
+ Patch.h \
+ Product.h
## ##################################################
Message.cc \
Script.cc \
SolverContext.cc\
- Patch.cc
+ Patch.cc \
+ Product.cc
lib@PACKAGE@_la_LDFLAGS = @LIB_VERSION_INFO@
*/
#include <iostream>
-#include "zypp/base/Logger.h"
#include "zypp/Message.h"
#include "zypp/detail/MessageImpl.h"
// METHOD TYPE : Ctor
//
Message::Message( detail::MessageImplPtr impl_r )
- : Resolvable ( impl_r )
+ : Resolvable( impl_r )
, _pimpl( impl_r )
{}
// METHOD NAME : Message::text
// Get the text of the message
//
- std::string Message::text ()
+ std::string Message::text()
{
- return _pimpl->text ();
+ return _pimpl->text();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Message::text
// Get the type of the message ("OK", "YesNo")
//
- std::string Message::type ()
+ std::string Message::type()
{
- return _pimpl->type ();
+ return _pimpl->type();
}
/////////////////////////////////////////////////////////////////
#ifndef ZYPP_MESSAGE_H
#define ZYPP_MESSAGE_H
-#include <iosfwd>
-
#include "zypp/Resolvable.h"
///////////////////////////////////////////////////////////////////
~Message();
public:
/** Get the text of the message */
- std::string text ();
+ std::string text();
/** Get the type of the message (YesNo / OK) */
- std::string type ();
+ std::string type();
private:
/** Pointer to implementation */
detail::MessageImplPtr _pimpl;
*/
#include <iostream>
-#include "zypp/base/Logger.h"
#include "zypp/Patch.h"
#include "zypp/detail/PatchImpl.h"
// METHOD TYPE : Ctor
//
Patch::Patch( detail::PatchImplPtr impl_r )
- : Resolvable (impl_r)
+ : Resolvable( impl_r )
, _pimpl( impl_r )
{
}
// METHOD NAME : Patch::id
// Get the patch id
//
- std::string Patch::id () const
+ std::string Patch::id() const
{
- return _pimpl->id ();
+ return _pimpl->id();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::id
// Get the patch id
//
- unsigned int Patch::timestamp () const
+ unsigned int Patch::timestamp() const
{
- return _pimpl->timestamp ();
+ return _pimpl->timestamp();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::summary
// Get the patch summary
//
- std::string Patch::summary () const
+ std::string Patch::summary() const
{
- return _pimpl->summary ();
+ return _pimpl->summary();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::description
// Get the patch description
//
- std::list<std::string> Patch::description () const
+ std::list<std::string> Patch::description() const
{
- return _pimpl->description ();
+ return _pimpl->description();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::category
// Get the category of the patch
//
- std::string Patch::category () const
+ std::string Patch::category() const
{
- return _pimpl->category ();
+ return _pimpl->category();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::reboot_needed
// Check whether reboot is needed to finish the patch installation
//
- bool Patch::reboot_needed () const {
- return _pimpl->reboot_needed ();
+ bool Patch::reboot_needed() const {
+ return _pimpl->reboot_needed();
}
///////////////////////////////////////////////////////////////////
// Check whether the patch installation affects package manager
// (and it should be restarted after patch installation)
//
- bool Patch::affects_pkg_manager () const {
- return _pimpl->affects_pkg_manager ();
+ bool Patch::affects_pkg_manager() const {
+ return _pimpl->affects_pkg_manager();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Patch::atoms
// Get the list of all atoms building the patch
//
- atom_list Patch::atoms () const {
- return _pimpl->all_atoms ();
+ atom_list Patch::atoms() const {
+ return _pimpl->all_atoms();
}
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : Patch::interactive
// Check whether patch can be applied only interactivly
//
- bool Patch::interactive ()
+ bool Patch::interactive()
{
- return _pimpl->interactive ();
+ return _pimpl->interactive();
}
- void Patch::mark_atoms_to_freshen (bool freshen)
+ void Patch::mark_atoms_to_freshen(bool freshen)
{
- _pimpl->mark_atoms_to_freshen (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 ()
+ bool Patch::any_atom_selected()
{
- return _pimpl->any_atom_selected ();
+ return _pimpl->any_atom_selected();
}
///////////////////////////////////////////////////////////////////
// the patch itself as selected for being installed/updated
//
// FIXME to be changed to inherit Resolvable's method
- void Patch::select ()
-// : Resolvable::select ()
+ void Patch::select()
+// : Resolvable::select()
{
- mark_atoms_to_freshen (true); // FIXME
+ mark_atoms_to_freshen(true); // FIXME
}
/////////////////////////////////////////////////////////////////
#ifndef ZYPP_PATCH_H
#define ZYPP_PATCH_H
-#include <iosfwd>
#include <list>
#include "zypp/Resolvable.h"
~Patch();
public:
/** Patch ID */
- std::string id () const;
+ std::string id() const;
/** Patch time stamp */
- unsigned int timestamp () const;
+ unsigned int timestamp() const;
/** Patch summary */
- std::string summary () const;
+ std::string summary() const;
/** Patch description */
std::list<std::string> description() const;
/** Patch category (recommended, security,...) */
- std::string category () const;
+ std::string category() const;
/** Does the system need to reboot to finish the update process? */
- bool reboot_needed () const;
+ bool reboot_needed() const;
/** Does the patch affect the package manager itself? */
- bool affects_pkg_manager () const;
+ bool affects_pkg_manager() const;
/** The list of all atoms building the patch */
- atom_list atoms () const;
+ atom_list atoms() const;
/** Is the patch installation interactive? (does it need user input?) */
- bool interactive ();
+ bool interactive();
// TODO add comments and reevaluate the need for functions below
- void mark_atoms_to_freshen (bool freshen);
- bool any_atom_selected ();
- void select (); // TODO parameter to specify select/unselect or another function
+ 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;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/Product.cc
+ *
+*/
+#include <iostream>
+
+#include "zypp/Product.h"
+#include "zypp/detail/ProductImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Product::Product
+ // METHOD TYPE : Ctor
+ //
+ Product::Product( detail::ProductImplPtr impl_r )
+ : Resolvable( impl_r )
+ , _pimpl( impl_r )
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Product::~Product
+ // METHOD TYPE : Dtor
+ //
+ Product::~Product()
+ {}
+
+ std::list<std::string> Product::description() const
+ {
+ return _pimpl->description();
+ }
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : Product::do_script
+ // Get the product category
+ //
+ std::string Product::category()
+ {
+ return _pimpl->category();
+ }
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/Product.h
+ *
+*/
+#ifndef ZYPP_PRODUCT_H
+#define ZYPP_PRODUCT_H
+
+#include "zypp/Resolvable.h"
+#include <list>
+#include <string>
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+ DEFINE_PTR_TYPE(ProductImpl)
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+ DEFINE_PTR_TYPE(Product)
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : Product
+ //
+ /** Class representing an update script */
+ class Product : public Resolvable
+ {
+ public:
+ /** Default ctor */
+ Product( detail::ProductImplPtr impl_r );
+ /** Dtor */
+ ~Product();
+ public:
+ /** Get the product description */
+ std::list<std::string> description() const;
+ /** Get the product categoty (base, add-on) */
+ std::string category();
+ private:
+ /** Pointer to implementation */
+ detail::ProductImplPtr _pimpl;
+ };
+
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_PRODUCT_H
*/
#include <iostream>
-#include "zypp/base/Logger.h"
#include "zypp/Script.h"
#include "zypp/detail/ScriptImpl.h"
// METHOD TYPE : Ctor
//
Script::Script( detail::ScriptImplPtr impl_r )
- : Resolvable (impl_r)
+ : Resolvable( impl_r )
, _pimpl( impl_r )
{}
// METHOD NAME : Script::do_script
// Get the script to perform the action
//
- std::string Script::do_script ()
+ std::string Script::do_script()
{
- return _pimpl->do_script ();
+ return _pimpl->do_script();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Script::undo_script
// Get the script to revert the action
//
- std::string Script::undo_script ()
+ std::string Script::undo_script()
{
- return _pimpl->undo_script ();
+ return _pimpl->undo_script();
}
///////////////////////////////////////////////////////////////////
// METHOD NAME : Script::undo_available
// Check whether the action can be reverted
//
- bool Script::undo_available ()
+ bool Script::undo_available()
{
- return _pimpl->undo_available ();
+ return _pimpl->undo_available();
}
/////////////////////////////////////////////////////////////////
#ifndef ZYPP_SCRIPT_H
#define ZYPP_SCRIPT_H
-#include <iosfwd>
-
#include "zypp/Resolvable.h"
///////////////////////////////////////////////////////////////////
~Script();
public:
/** Get the script to perform the change */
- std::string do_script ();
+ std::string do_script();
/** Get the script to undo the change */
- std::string undo_script ();
+ std::string undo_script();
/** Check whether script to undo the change is available */
- bool undo_available ();
+ bool undo_available();
private:
/** Pointer to implementation */
detail::ScriptImplPtr _pimpl;
SelectionImpl.h \
MessageImpl.h \
ScriptImpl.h \
- PatchImpl.h
+ PatchImpl.h \
+ ProductImpl.h
noinst_LTLIBRARIES = lib@PACKAGE@_detail.la
SelectionImpl.cc \
MessageImpl.cc \
ScriptImpl.cc \
- PatchImpl.cc
+ PatchImpl.cc \
+ ProductImpl.cc
## ##################################################
/** \file zypp/detail/MessageImpl.cc
*
*/
-#include <iostream>
-#include "zypp/base/Logger.h"
#include "zypp/detail/MessageImpl.h"
-//#include "zypp/Message.h"
using namespace std;
MessageImpl::MessageImpl( const std::string & name_r,
const Edition & edition_r,
const Arch & arch_r )
- : ResolvableImpl (ResKind ("message"),
+ : ResolvableImpl( ResKind( "message" ),
name_r,
edition_r,
- arch_r)
+ arch_r )
{
}
/** Dtor */
{
}
- std::string MessageImpl::type () const {
+ std::string MessageImpl::type() const {
return _type;
}
- std::string MessageImpl::text () const {
+ std::string MessageImpl::text() const {
return _text;
}
#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
public:
/** Get the text of the message */
- virtual std::string text () const;
+ virtual std::string text() const;
/** Get the type of the message (YesNo / OK) */
- virtual std::string type () const;
+ virtual std::string type() const;
protected:
/** The text of the message */
std::string _text;
#include "zypp/base/Logger.h"
#include "zypp/detail/PatchImpl.h"
-#include "zypp/Patch.h"
#include "zypp/Package.h"
using namespace std;
PatchImpl::PatchImpl( const std::string & name_r,
const Edition & edition_r,
const Arch & arch_r )
- : ResolvableImpl (ResKind ("patch"),
+ : ResolvableImpl( ResKind( "patch" ),
name_r,
- Edition (edition_r),
- Arch (arch_r))
+ edition_r,
+ arch_r )
{
}
{
}
- std::string PatchImpl::id () const
+ std::string PatchImpl::id() const
{
return _patch_id;
}
- unsigned int PatchImpl::timestamp () const
+ unsigned int PatchImpl::timestamp() const
{
return _timestamp;
}
- std::string PatchImpl::summary () const
+ std::string PatchImpl::summary() const
{
return _summary;
}
- std::list<std::string> PatchImpl::description () const
+ std::list<std::string> PatchImpl::description() const
{
return _description;
}
- std::string PatchImpl::category () const
+ std::string PatchImpl::category() const
{
return _category;
}
- bool PatchImpl::reboot_needed () const
+ bool PatchImpl::reboot_needed() const
{
return _reboot_needed;
}
- bool PatchImpl::affects_pkg_manager () const
+ bool PatchImpl::affects_pkg_manager() const
{
return _affects_pkg_manager;
}
- bool PatchImpl::interactive () {
+ bool PatchImpl::interactive() {
if (_reboot_needed)
{
DBG << "Patch needs reboot" << endl;
return true;
}
- atom_list not_installed = not_installed_atoms ();
- for (atom_list::iterator it = not_installed.begin ();
- it != not_installed.end ();
+ 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")
+ if ((std::string)((*it)->kind()) == "message")
{
// DBG << "Patch contains a message" << endl;
return true;
}
- if ((std::string)((*it)->kind ()) == "package")
+ if ((std::string)((*it)->kind()) == "package")
{
// Resolvable*
// Resolvable
return false;
}
- atom_list PatchImpl::all_atoms () {
+ atom_list PatchImpl::all_atoms() {
return _atoms;
}
- atom_list PatchImpl::not_installed_atoms () {
+ atom_list PatchImpl::not_installed_atoms() {
atom_list ret;
- for (atom_list::iterator it = _atoms.begin ();
- it != _atoms.end ();
+ for (atom_list::iterator it = _atoms.begin();
+ it != _atoms.end();
it++)
{
if (true) // FIXME check if atom/resolvable is not installed
{
- ret.push_back (*it);
+ ret.push_back(*it);
}
}
return ret;
// TODO check necessarity of functions below
- bool PatchImpl::any_atom_selected () {
- for (atom_list::iterator it = _atoms.begin ();
- it != _atoms.end ();
+ 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 false;
}
- void PatchImpl::mark_atoms_to_freshen (bool freshen) {
- for (atom_list::iterator it = _atoms.begin ();
- it != _atoms.end ();
+ 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
#include "zypp/detail/ResolvableImpl.h"
#include "zypp/Resolvable.h"
-#include "zypp/Patch.h"
+#include "zypp/Patch.h" // contains atom_list macro
///////////////////////////////////////////////////////////////////
namespace zypp
public:
/** Patch ID */
- std::string id () const;
+ std::string id() const;
/** Patch time stamp */
- unsigned int timestamp () const;
+ unsigned int timestamp() const;
/** Patch summary */
- std::string summary () const;
+ std::string summary() const;
/** Patch description */
- std::list<std::string> description () const;
+ std::list<std::string> description() const;
/** Patch category (recommended, security,...) */
- std::string category () const;
+ std::string category() const;
/** Does the system need to reboot to finish the update process? */
- bool reboot_needed () const;
+ bool reboot_needed() const;
/** Does the patch affect the package manager itself? */
- bool affects_pkg_manager () const;
+ bool affects_pkg_manager() const;
/** Is the patch installation interactive? (does it need user input?) */
- bool interactive ();
+ bool interactive();
/** The list of all atoms building the patch */
- atom_list all_atoms ();
+ atom_list all_atoms();
/** The list of those atoms which have not been installed */
- atom_list not_installed_atoms ();
+ atom_list not_installed_atoms();
// TODO check necessarity of functions below
- bool any_atom_selected ();
- void mark_atoms_to_freshen (bool freshen);
+ bool any_atom_selected();
+ void mark_atoms_to_freshen(bool freshen);
protected:
/** Patch ID */
std::string _patch_id;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/ProductImpl.cc
+ *
+*/
+
+#include "zypp/detail/ProductImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+ IMPL_PTR_TYPE(ProductImpl)
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ProductImpl
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ /** Default ctor */
+ ProductImpl::ProductImpl( const std::string & name_r,
+ const Edition & edition_r,
+ const Arch & arch_r )
+ : ResolvableImpl( ResKind( "script"),
+ name_r,
+ edition_r,
+ arch_r )
+ {
+ }
+ /** Dtor */
+ ProductImpl::~ProductImpl()
+ {
+ }
+
+ std::list<std::string> ProductImpl::description() const
+ {
+ return _description;
+ }
+
+ std::string ProductImpl::category() const {
+ return _category;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/detail/ProductImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_PRODUCTIMPL_H
+#define ZYPP_DETAIL_PRODUCTIMPL_H
+
+#include <list>
+#include <string>
+
+#include "zypp/detail/ResolvableImpl.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace detail
+ { /////////////////////////////////////////////////////////////////
+ DEFINE_PTR_TYPE(ProductImpl)
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ProductImpl
+ //
+ /** Class representing an update script */
+ class ProductImpl : public ResolvableImpl
+ {
+ public:
+ /** Default ctor */
+ ProductImpl( const std::string & name_r,
+ const Edition & edition_r,
+ const Arch & arch_r );
+ /** Dtor */
+ ~ProductImpl();
+
+ public:
+ /** Get the product description */
+ std::list<std::string> description() const;
+ /** Get the category of the product */
+ std::string category() const;
+ protected:
+ /** Product description */
+ std::list<std::string> _description;
+ /** The category of the product */
+ std::string _category;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace detail
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_PRODUCTIMPL_H
/** \file zypp/detail/ScriptImpl.cc
*
*/
-#include <iostream>
-#include "zypp/base/Logger.h"
#include "zypp/detail/ScriptImpl.h"
-#include "zypp/Script.h"
using namespace std;
ScriptImpl::ScriptImpl( const std::string & name_r,
const Edition & edition_r,
const Arch & arch_r )
- : ResolvableImpl (ResKind ("script"),
+ : ResolvableImpl( ResKind( "script"),
name_r,
- Edition (edition_r),
- Arch (arch_r))
+ edition_r,
+ arch_r )
{
}
/** Dtor */
{
}
- std::string ScriptImpl::do_script () const {
+ std::string ScriptImpl::do_script() const {
return _do_script;
}
- std::string ScriptImpl::undo_script () const {
+ std::string ScriptImpl::undo_script() const {
return _undo_script;
}
- bool ScriptImpl::undo_available () const {
+ bool ScriptImpl::undo_available() const {
return _undo_script != "";
}
#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
public:
/** Get the script to perform the change */
- std::string do_script () const;
+ std::string do_script() const;
/** Get the script to undo the change */
- std::string undo_script () const;
+ std::string undo_script() const;
/** Check whether script to undo the change is available */
- virtual bool undo_available () const;
+ virtual bool undo_available() const;
protected:
/** The script to perform the change */
std::string _do_script;