{ return _size_installed; }
/** Patch ID */
-std::string HelixPatchImpl::id() const
+std::string HelixPatchImpl::id() const
{ return ""; }
/** Patch time stamp */
-Date HelixPatchImpl::timestamp() const
+Date HelixPatchImpl::timestamp() const
{ return 0; }
/** Patch category (recommended, security,...) */
-std::string HelixPatchImpl::category() const
+std::string HelixPatchImpl::category() const
{ return ""; }
/** Does the system need to reboot to finish the update process? */
-bool HelixPatchImpl::reboot_needed() const
+bool HelixPatchImpl::reboot_needed() const
{ return false; }
/** Does the patch affect the package manager itself? */
-bool HelixPatchImpl::affects_pkg_manager() const
-{ return false; }
-
- /** Is the patch installation interactive? (does it need user input?) */
-bool HelixPatchImpl::interactive() const
+bool HelixPatchImpl::affects_pkg_manager() const
{ return false; }
/** The list of all atoms building the patch */
PatchImplIf::AtomList HelixPatchImpl::all_atoms() const
{ return AtomList(); }
- /** The list of those atoms which have not been installed */
-PatchImplIf::AtomList HelixPatchImpl::not_installed_atoms() const
-{ return AtomList(); }
-
-
-// TODO check necessarity of functions below
-void HelixPatchImpl::mark_atoms_to_freshen(bool freshen)
-{ return; }
-
-bool HelixPatchImpl::any_atom_selected() const
-{ return false; }
-
/////////////////////////////////////////////////////////////////
} // namespace zypp
virtual bool affects_pkg_manager() const ;
/** */
virtual ByteCount size() const;
-
- /** Is the patch installation interactive? (does it need user input?) */
- virtual bool interactive() const;
/** The list of all atoms building the patch */
virtual AtomList all_atoms() const;
- /** The list of those atoms which have not been installed */
- virtual AtomList not_installed_atoms() const;
-
-// TODO check necessarity of functions below
- virtual void mark_atoms_to_freshen(bool freshen) ;
- virtual bool any_atom_selected() const;
-
- /** */
- virtual Source_Ref source() const;
+ /** */
+ virtual Source_Ref source() const;
protected:
Source_Ref _source;
{ /////////////////////////////////////////////////////////////////
IMPL_PTR_TYPE( Patch );
-
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : Patch::Patch
bool Patch::interactive() const
{ return pimpl().interactive(); }
- void Patch::mark_atoms_to_freshen(bool freshen)
- { pimpl().mark_atoms_to_freshen(freshen); }
+ // DEPRECATED:
+ void Patch::mark_atoms_to_freshen(bool freshen)
+ { ; }
bool Patch::any_atom_selected()
- { return pimpl().any_atom_selected(); }
-
+ { return false; }
void Patch::select()
- { pimpl().mark_atoms_to_freshen(true); }
+ { ; }
/////////////////////////////////////////////////////////////////
} // namespace zypp
{ /////////////////////////////////////////////////////////////////
DEFINE_PTR_TYPE(Patch);
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : Patch
AtomList atoms() const;
/** Is the patch installation interactive? (does it need user input?) */
bool interactive() const;
- // 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) ZYPP_DEPRECATED;
+ bool any_atom_selected() ZYPP_DEPRECATED;
+ void select() ZYPP_DEPRECATED;
protected:
/** Ctor */
return _affects_pkg_manager;
}
- bool PatchImpl::interactive() const {
- if (_reboot_needed)
- {
- DBG << "Patch needs reboot" << endl;
- return true;
- }
- AtomList not_installed = not_installed_atoms();
- for (AtomList::const_iterator it = not_installed.begin();
- it != not_installed.end();
- it++)
- {
- if ((*it)->kind() == "Message")
- {
-// DBG << "Patch contains a message" << endl;
- return true;
- }
- if ((*it)->kind() == "Package")
- {
- // Resolvable*
- // Resolvable
- // ResolvablePtr
-
-
- // <ma> never do somthing like this!!!
-// Package* p = (Package*)&**it;
- //
- // (*it) is a ResolvablePtr
-
-
-
-
- // FIXME use the condition
-// if (p->licenseToConfirm() != "")
- if (false)
- {
-// DBG << "Package has a license to be shown to user" << endl;
- return true;
- }
- }
- }
- return false;
- }
-
PatchImpl::AtomList PatchImpl::all_atoms() const {
return _atoms;
}
- PatchImpl::AtomList PatchImpl::not_installed_atoms() const {
- AtomList ret;
- for (AtomList::const_iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- if (true) // FIXME check if atom/resolvable is not installed
- {
- ret.push_back(*it);
- }
- }
- return ret;
- }
-
-// TODO check necessarity of functions below
-
- bool PatchImpl::any_atom_selected() const {
- for (AtomList::const_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 (AtomList::iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- // TODO mark the resolvable to be or not to be freshed
- }
- }
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
public:
/** Patch ID */
- std::string id() const;
+ virtual std::string id() const;
/** Patch time stamp */
- Date timestamp() const;
+ virtual Date timestamp() const;
/** Patch summary */
- TranslatedText summary() const;
+ virtual TranslatedText summary() const;
/** Patch description */
- TranslatedText description() const;
+ virtual TranslatedText description() const;
/** Patch category (recommended, security,...) */
- std::string category() const;
+ virtual std::string category() const;
/** Does the system need to reboot to finish the update process? */
- bool reboot_needed() const;
+ virtual bool reboot_needed() const;
/** Does the patch affect the package manager itself? */
- bool affects_pkg_manager() const;
-
- /** Is the patch installation interactive? (does it need user input?) */
- bool interactive() const;
+ virtual bool affects_pkg_manager() const;
/** The list of all atoms building the patch */
- AtomList all_atoms() const;
- /** The list of those atoms which have not been installed */
- AtomList not_installed_atoms() const;
+ virtual AtomList all_atoms() const;
-// TODO check necessarity of functions below
- bool any_atom_selected() const;
- void mark_atoms_to_freshen(bool freshen);
protected:
/** Patch ID */
std::string _patch_id;
{ return ByteCount(); }
bool PatchImplIf::interactive() const
- { return false; }
-
- PatchImplIf::AtomList PatchImplIf::all_atoms() const
- { return AtomList(); }
+ {
+ if ( reboot_needed() )
+ {
+ return true;
+ }
- PatchImplIf::AtomList PatchImplIf::not_installed_atoms() const
- { return AtomList(); }
+ AtomList atoms = all_atoms();
+ for ( AtomList::const_iterator it = atoms.begin(); it != atoms.end(); it++)
+ {
+ if ( isKind<Message>( *it )
+ || ! licenseToConfirm().empty() )
+ {
+ return true;
+ }
+ }
- void PatchImplIf::mark_atoms_to_freshen(bool)
- { return; }
+ return false;
+ }
- bool PatchImplIf::any_atom_selected() const
- { return false; }
+ PatchImplIf::AtomList PatchImplIf::all_atoms() const
+ { return AtomList(); }
/////////////////////////////////////////////////////////////////
} // namespace detail
virtual bool affects_pkg_manager() const PURE_VIRTUAL;
/** */
virtual ByteCount size() const;
-
/** Is the patch installation interactive? (does it need user input?) */
virtual bool interactive() const PURE_VIRTUAL;
/** The list of all atoms building the patch */
virtual AtomList all_atoms() const PURE_VIRTUAL;
- /** The list of those atoms which have not been installed */
- virtual AtomList not_installed_atoms() const PURE_VIRTUAL;
-
-// TODO check necessarity of functions below
- virtual void mark_atoms_to_freshen(bool freshen) PURE_VIRTUAL;
- virtual bool any_atom_selected() const PURE_VIRTUAL;
};
///////////////////////////////////////////////////////////////////
return _affects_pkg_manager;
}
-bool YUMPatchImpl::interactive() const
-{
- if (_reboot_needed)
- {
- DBG << "Patch needs reboot" << endl;
- return true;
- }
- AtomList not_installed = not_installed_atoms();
- for (AtomList::iterator it = not_installed.begin();
- it != not_installed.end();
- it++)
- {
- if ((*it)->kind() == "Message")
- {
- // DBG << "Patch contains a message" << endl;
- return true;
- }
- if ((*it)->kind() == "Package")
- {
- // Resolvable*
- // Resolvable
- // ResolvablePtr
-
-
- // <ma> never do somthing like this!!!
- // Package* p = (Package*)&**it;
- //
- // (*it) is a ResolvablePtr
-
-
-
-
- // FIXME use the condition
- // if (p->licenseToConfirm() != "")
- if (false)
- {
- // DBG << "Package has a license to be shown to user" << endl;
- return true;
- }
- }
- }
- return false;
-}
-
YUMPatchImpl::AtomList YUMPatchImpl::all_atoms() const
{
return _atoms;
}
-YUMPatchImpl::AtomList YUMPatchImpl::not_installed_atoms() const
-{
- AtomList ret;
- for (AtomList::const_iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- if (true) // FIXME check if atom/resolvable is not installed
- {
- ret.push_back(*it);
- }
- }
- return ret;
-}
-
-// TODO check necessarity of functions below
-
-bool YUMPatchImpl::any_atom_selected() const
-{
- for (AtomList::const_iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- if (false) // FIXME check if atom/resolvable is selected
- {
- return true;
- }
- }
- return false;
-}
-
-void YUMPatchImpl::mark_atoms_to_freshen( bool freshen )
-{
- for (AtomList::iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- // TODO mark the resolvable to be or not to be freshed
- }
-}
-
Source_Ref YUMPatchImpl::source() const
{
return _source;
YUMSourceImpl & srcimpl_r
);
/** Patch ID */
- std::string id() const;
+ virtual std::string id() const;
/** Patch time stamp */
- Date timestamp() const;
+ virtual Date timestamp() const;
/** Patch category (recommended, security,...) */
- std::string category() const;
+ virtual std::string category() const;
/** Does the system need to reboot to finish the update process? */
- bool reboot_needed() const;
+ virtual bool reboot_needed() const;
/** Does the patch affect the package manager itself? */
- bool affects_pkg_manager() const;
- /** Is the patch installation interactive? (does it need user input?) */
- bool interactive() const;
+ virtual bool affects_pkg_manager() const;
/** The list of all atoms building the patch */
- AtomList all_atoms() const;
- /** The list of those atoms which have not been installed */
- AtomList not_installed_atoms() const;
+ virtual AtomList all_atoms() const;
/** Patch summary */
virtual TranslatedText summary() const;
virtual TranslatedText licenseToConfirm() const;
-// TODO check necessarity of functions below
- bool any_atom_selected() const;
- void mark_atoms_to_freshen(bool freshen);
protected:
std::string _patch_id;
Date _timestamp;
return _affects_pkg_manager;
}
- bool XMLPatchImpl::interactive() const {
- if (_reboot_needed)
- {
- DBG << "Patch needs reboot" << endl;
- return true;
- }
- AtomList not_installed = not_installed_atoms();
- for (AtomList::const_iterator it = not_installed.begin();
- it != not_installed.end();
- it++)
- {
- if ((*it)->kind() == "Message")
- {
-// DBG << "Patch contains a message" << endl;
- return true;
- }
- if ((*it)->kind() == "Package")
- {
- // Resolvable*
- // Resolvable
- // ResolvablePtr
-
-
- // <ma> never do somthing like this!!!
-// Package* p = (Package*)&**it;
- //
- // (*it) is a ResolvablePtr
-
-
-
-
- // FIXME use the condition
-// if (p->licenseToConfirm() != "")
- if (false)
- {
-// DBG << "Package has a license to be shown to user" << endl;
- return true;
- }
- }
- }
- return false;
- }
-
XMLPatchImpl::AtomList XMLPatchImpl::all_atoms() const {
return _atoms;
}
- XMLPatchImpl::AtomList XMLPatchImpl::not_installed_atoms() const {
- AtomList ret;
- for (AtomList::const_iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- if (true) // FIXME check if atom/resolvable is not installed
- {
- ret.push_back(*it);
- }
- }
- return ret;
- }
-
-// TODO check necessarity of functions below
-
- bool XMLPatchImpl::any_atom_selected() const {
- for (AtomList::const_iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- if (false) // FIXME check if atom/resolvable is selected
- {
- return true;
- }
- }
- return false;
- }
-
- void XMLPatchImpl::mark_atoms_to_freshen( bool freshen ) {
- for (AtomList::iterator it = _atoms.begin();
- it != _atoms.end();
- it++)
- {
- // TODO mark the resolvable to be or not to be freshed
- }
- }
/////////////////////////////////////////////////////////////////
} // namespace detail
///////////////////////////////////////////////////////////////////
virtual TranslatedText description() const
{ return _description; }
virtual TranslatedText insnotify() const
- { return _install_notify; }
+ { return _install_notify; }
virtual TranslatedText delnotify() const
- { return _delete_notify; }
+ { return _delete_notify; }
virtual TranslatedText licenseToConfirm() const
- { return _license_to_confirm; }
+ { return _license_to_confirm; }
virtual Vendor vendor() const
- { return _vendor; }
+ { return _vendor; }
virtual ByteCount size() const
- { return _size; }
+ { return _size; }
virtual ByteCount archivesize() const
- { return _archive_size; }
+ { return _archive_size; }
virtual unsigned sourceMediaNr() const
- { return 0; }
+ { return 0; }
virtual bool installOnly() const
- { return _install_only; }
+ { return _install_only; }
virtual Date buildtime() const
- { return _build_time; }
+ { return _build_time; }
virtual Date installtime() const
- { return _install_time; }
-
+ { return _install_time; }
+
/** Patch ID */
- std::string id() const;
+ virtual std::string id() const;
/** Patch time stamp */
- Date timestamp() const;
+ virtual Date timestamp() const;
/** Patch category (recommended, security,...) */
- std::string category() const;
+ virtual std::string category() const;
/** Does the system need to reboot to finish the update process? */
- bool reboot_needed() const;
+ virtual bool reboot_needed() const;
/** Does the patch affect the package manager itself? */
- bool affects_pkg_manager() const;
+ virtual bool affects_pkg_manager() const;
- /** Is the patch installation interactive? (does it need user input?) */
- bool interactive() const;
/** The list of all atoms building the patch */
- AtomList all_atoms() const;
- /** The list of those atoms which have not been installed */
- AtomList not_installed_atoms() const;
+ virtual AtomList all_atoms() const;
-// TODO check necessarity of functions below
- bool any_atom_selected() const;
- void mark_atoms_to_freshen(bool freshen);
-
/** Patch ID */
std::string _patch_id;
/** Patch time stamp */
Date _timestamp;
-
+
TranslatedText _summary;
TranslatedText _description;
-
+
TranslatedText _install_notify;
TranslatedText _delete_notify;
TranslatedText _license_to_confirm;
bool _install_only;
Date _build_time;
Date _install_time;
-
-
+
+
/** Patch category (recommended, security,...) */
std::string _category;
/** Does the system need to reboot to finish the update process? */
SqlitePatchImpl::readHandle( sqlite_int64 id, sqlite3_stmt *handle )
{
_zmdid = id;
-
+
// 1-5: nvra, see SqliteSourceImpl
_size_installed = sqlite3_column_int( handle, PATCHES_TABLE_COLUMN_SIZE_INSTALLED );
// 7: catalog
/** Does the patch affect the package manager itself? */
bool SqlitePatchImpl::affects_pkg_manager() const
{ return _affects_pkg_manager; }
-/** Is the patch installation interactive? (does it need user input?) */
-bool SqlitePatchImpl::interactive() const
-{ return _interactive; }
/////////////////////////////////////////////////////////////////
} // namespace zypp
virtual bool affects_pkg_manager() const;
/** */
virtual ByteCount size() const;
-
- /** Is the patch installation interactive? (does it need user input?) */
- virtual bool interactive() const;
-
/** The list of all atoms building the patch */
virtual AtomList all_atoms() const
{ return AtomList(); }
- /** The list of those atoms which have not been installed */
- virtual AtomList not_installed_atoms() const
- { return AtomList(); }
-
-// TODO check necessarity of functions below
- virtual void mark_atoms_to_freshen(bool freshen)
- { return; }
- virtual bool any_atom_selected() const
- { return false; }
protected:
Source_Ref _source;
std::string _category;
bool _reboot_needed;
bool _affects_pkg_manager;
+ /** \todo remove it as it is not needed, PatchImplIf::interactive()
+ * should be sufficient, usg. no need to overload it. */
bool _interactive;
ByteCount _size_installed;
ByteCount _size_archive;