From 9122b02e396557ae0a8acc305d45bb9f510571c0 Mon Sep 17 00:00:00 2001 From: Duncan Mac-Vicar P Date: Tue, 22 Apr 2008 15:44:45 +0000 Subject: [PATCH] patch attributes --- VERSION.cmake | 1 - zypp/Patch.cc | 10 +++++----- zypp/Patch.h | 22 ++++++++++++++++++---- zypp/sat/SolvAttr.cc | 6 +++--- zypp/sat/SolvAttr.h | 4 ++-- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 9bff196..4b05e12 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -46,5 +46,4 @@ SET(LIBZYPP_MAJOR "4") SET(LIBZYPP_MINOR "14") -SET(LIBZYPP_COMPATMINOR "14") SET(LIBZYPP_PATCH "0") diff --git a/zypp/Patch.cc b/zypp/Patch.cc index b83be20..d1b83ef 100644 --- a/zypp/Patch.cc +++ b/zypp/Patch.cc @@ -48,15 +48,15 @@ namespace zypp std::string Patch::category() const { return lookupStrAttribute( sat::SolvAttr::patchcategory ); } - bool Patch::reboot_needed() const - { return lookupBoolAttribute( sat::SolvAttr::needReboot ); } + bool Patch::rebootSuggested() const + { return lookupBoolAttribute( sat::SolvAttr::rebootSuggested ); } - bool Patch::affects_pkg_manager() const - { return lookupBoolAttribute( sat::SolvAttr::needRestart ); } + bool Patch::restartSuggested() const + { return lookupBoolAttribute( sat::SolvAttr::restartSuggested ); } bool Patch::interactive() const { - if ( reboot_needed() + if ( rebootSuggested() || ! licenseToConfirm().empty() ) { return true; diff --git a/zypp/Patch.h b/zypp/Patch.h index 3b2d91e..cf5411c 100644 --- a/zypp/Patch.h +++ b/zypp/Patch.h @@ -45,7 +45,8 @@ namespace zypp public: /** - * issue date time + * Issue date time. For now it is the same as + * \ref buildtime(). */ Date timestamp() const { return buildtime(); } @@ -58,12 +59,25 @@ namespace zypp /** * Does the system need to reboot to finish the update process? */ - bool reboot_needed() const; - + bool rebootSuggested() const; + /** * Does the patch affect the package manager itself? + * restart is suggested then + */ + bool restartSuggested() const; + + /** + * Use \ref rebootSuggested() + */ + ZYPP_DEPRECATED bool reboot_needed() const + { return rebootSuggested(); } + + /** + * Use \ref restartSuggested() */ - bool affects_pkg_manager() const; + ZYPP_DEPRECATED bool affects_pkg_manager() const + { return restartSuggested(); } /** * Is the patch installation interactive? (does it need user input?) diff --git a/zypp/sat/SolvAttr.cc b/zypp/sat/SolvAttr.cc index 089ef32..f9d212d 100644 --- a/zypp/sat/SolvAttr.cc +++ b/zypp/sat/SolvAttr.cc @@ -67,9 +67,9 @@ namespace sat const SolvAttr SolvAttr::headerend ( SOLVABLE_HEADEREND ); // patch - const SolvAttr SolvAttr::patchcategory( SOLVABLE_PATCHCATEGORY ); - const SolvAttr SolvAttr::needReboot ( UPDATE_REBOOT ); - const SolvAttr SolvAttr::needRestart ( UPDATE_RESTART ); + const SolvAttr SolvAttr::patchcategory ( SOLVABLE_PATCHCATEGORY ); + const SolvAttr SolvAttr::rebootSuggested ( UPDATE_REBOOT ); + const SolvAttr SolvAttr::restartSuggested ( UPDATE_RESTART ); const SolvAttr SolvAttr::updateCollectionName ( UPDATE_COLLECTION_NAME ); const SolvAttr SolvAttr::updateCollectionEvr ( UPDATE_COLLECTION_EVR ); const SolvAttr SolvAttr::updateCollectionArch ( UPDATE_COLLECTION_ARCH ); diff --git a/zypp/sat/SolvAttr.h b/zypp/sat/SolvAttr.h index cdd8261..eac8655 100644 --- a/zypp/sat/SolvAttr.h +++ b/zypp/sat/SolvAttr.h @@ -76,8 +76,8 @@ namespace sat // patch static const SolvAttr patchcategory; - static const SolvAttr needReboot; - static const SolvAttr needRestart; + static const SolvAttr rebootSuggested; + static const SolvAttr restartSuggested; static const SolvAttr updateCollectionName; static const SolvAttr updateCollectionEvr; static const SolvAttr updateCollectionArch; -- 2.7.4