ref: refs/heads/master
commit de080c17ea3edb7cc336432bb8d20bd5ab1689b8
Author: Michael Calmer
Date: Thu Feb 5 18:08:35 2009 +0100
make zyppACInit() a private function
move zyppACInit() out of the private namespace and make it a normal
private function.
add sysRoot as member of ZyppAC and implement a get method to make
this Pathname available.
---
src/SUSE_zypp.cc | 32 +++++++++++++++++---------------
src/SUSE_zypp.h | 6 ++++++
2 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/src/SUSE_zypp.cc b/src/SUSE_zypp.cc
index bd8d12b..a3d71cc 100644
--- a/src/SUSE_zypp.cc
+++ b/src/SUSE_zypp.cc
@@ -23,14 +23,28 @@ namespace cmpizypp
int initonce = _initonce();
- const Pathname sysRoot( getenv("CMPIZYPP_ROOT") ? getenv("CMPIZYPP_ROOT") : "/" );
bool zyppACInitialized = false;
- void zyppACInit()
- {
+
+ } // namespace
+
+
+ ZyppAC::ZyppAC()
+ {
+ zyppACInit();
+ }
+
+ ZyppAC::~ZyppAC()
+ {
+ }
+
+ void ZyppAC::zyppACInit()
+ {
if ( zyppACInitialized )
return;
+ sysRoot = Pathname( getenv("CMPIZYPP_ROOT") ? getenv("CMPIZYPP_ROOT") : "/" );
+
KeyRing::setDefaultAccept( KeyRing::ACCEPT_UNKNOWNKEY|KeyRing::TRUST_KEY_TEMPORARILY );
// Load Target
@@ -89,18 +103,6 @@ namespace cmpizypp
USR << "pool: " << pool << endl;
zyppACInitialized = true;
- }
-
- } // namespace
-
-
- ZyppAC::ZyppAC()
- {
- zyppACInit();
- }
-
- ZyppAC::~ZyppAC()
- {
}
std::string ZyppAC::exceptionString( const Exception & err_r, const std::string & prefix_r )
diff --git a/src/SUSE_zypp.h b/src/SUSE_zypp.h
index 69812bc..2ccd7f5 100644
--- a/src/SUSE_zypp.h
+++ b/src/SUSE_zypp.h
@@ -17,10 +17,16 @@ namespace cmpizypp
/** Access to libzypp components. */
class ZyppAC
{
+ private:
+ zypp::Pathname sysRoot;
+
+ void zyppACInit();
+
public:
ZyppAC();
~ZyppAC();
+ zypp::Pathname getSysRoot() const { return sysRoot; }
zypp::Target & target() const { return *zypp::getZYpp()->getTarget(); }
zypp::ResPool pool() const { return zypp::ResPool::instance(); }
zypp::ResPoolProxy poolProxy() const { return pool().proxy(); }
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org