Author: mlandres
Date: Mon Feb 4 15:01:23 2008
New Revision: 8456
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8456&view=rev
Log:
Move system arch and text locale handling to Zconfig (avoiding ZYpp lock).
Modified:
branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.cc
branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.h
branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.cc
branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.h
branches/tmp/ma/jump_sat/libzypp/zypp/base/IOStream.h
branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.cc
branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.h
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.cc?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.cc Mon Feb 4 15:01:23 2008
@@ -9,8 +9,15 @@
/** \file zypp/ZConfig.cc
*
*/
+extern "C"
+{
+#include
+#include
+}
#include <iostream>
+#include <fstream>
#include "zypp/base/Logger.h"
+#include "zypp/base/IOStream.h"
#include "zypp/base/InputStream.h"
#include "zypp/base/String.h"
@@ -28,6 +35,101 @@
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
+ namespace
+ { /////////////////////////////////////////////////////////////////
+
+ /** Determine system architecture evaluating \c uname and \c /proc/cpuinfo.
+ */
+ Arch _autodetectSystemArchitecture()
+ {
+ struct ::utsname buf;
+ if ( ::uname( &buf ) < 0 )
+ {
+ ERR << "Can't determine system architecture" << endl;
+ return Arch_noarch;
+ }
+
+ Arch architecture( buf.machine );
+ MIL << "Uname architecture is '" << buf.machine << "'" << endl;
+
+ // some CPUs report i686 but dont implement cx8 and cmov
+ // check for both flags in /proc/cpuinfo and downgrade
+ // to i586 if either is missing (cf bug #18885)
+ if ( architecture == Arch_i686 )
+ {
+ std::ifstream cpuinfo( "/proc/cpuinfo" );
+ if ( cpuinfo )
+ {
+ for( iostr::EachLine in( cpuinfo ); in; in.next() )
+ {
+ if ( str::hasPrefix( *in, "flags" ) )
+ {
+ if ( in->find( "cx8" ) == std::string::npos
+ || in->find( "cmov" ) == std::string::npos )
+ {
+ architecture = Arch_i586;
+ WAR << "CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture << "'" << endl;
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ ERR << "Cant open " << PathInfo("/proc/cpuinfo") << endl;
+ }
+ }
+ return architecture;
+ }
+
+ /** The locale to be used for texts and messages.
+ *
+ * For the encoding to be used the preference is
+ *
+ * LC_ALL, LC_CTYPE, LANG
+ *
+ * For the language of the messages to be used, the preference is
+ *
+ * LANGUAGE, LC_ALL, LC_MESSAGES, LANG
+ *
+ * Note that LANGUAGE can contain more than one locale name, it can be
+ * a list of locale names like for example
+ *
+ * LANGUAGE=ja_JP.UTF-8:de_DE.UTF-8:fr_FR.UTF-8
+
+ * \todo Support dynamic fallbacklists defined by LANGUAGE
+ */
+ Locale _autodetectTextLocale()
+ {
+ Locale ret( "en" );
+ const char * envlist[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
+ for ( const char ** envvar = envlist; *envvar; ++envvar )
+ {
+ const char * envlang = getenv( *envvar );
+ if ( envlang )
+ {
+ std::string envstr( envlang );
+ if ( envstr != "POSIX" && envstr != "C" )
+ {
+ Locale lang( envstr );
+ if ( ! lang.code().empty() )
+ {
+ MIL << "Found " << *envvar << "=" << envstr << endl;
+ ret = lang;
+ break;
+ }
+ }
+ }
+ }
+ MIL << "Default text locale is '" << ret << "'" << endl;
+ return ret;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace zypp
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ZConfig::Impl
//
@@ -40,98 +142,116 @@
{
public:
Impl()
- : repo_add_probe ( false )
+ : cfg_arch ( defaultSystemArchitecture() )
+ , cfg_textLocale ( defaultTextLocale() )
+ , repo_add_probe ( false )
, repo_refresh_delay ( 10 )
, download_use_patchrpm ( true )
, download_use_deltarpm ( true )
{
- MIL << "ZConfig singleton created." << endl;
+ MIL << "libzypp: " << VERSION << " built " << __DATE__ << " " << __TIME__ << endl;
// ZYPP_CONF might override /etc/zypp/zypp.conf
-
const char *env_confpath = getenv( "ZYPP_CONF" );
-
Pathname confpath( env_confpath ? env_confpath : "/etc/zypp/zypp.conf" );
- if ( PathInfo(confpath).isExist())
+ if ( PathInfo(confpath).isExist() )
{
- InputStream is(confpath);
- dict.read(is);
+ parser::IniDict dict( confpath );
+ //InputStream is(confpath);
+
+ for ( IniDict::section_const_iterator sit = dict.sectionsBegin();
+ sit != dict.sectionsEnd();
+ ++sit )
+ {
+ string section(*sit);
+ //MIL << section << endl;
+ for ( IniDict::entry_const_iterator it = dict.entriesBegin(*sit);
+ it != dict.entriesEnd(*sit);
+ ++it )
+ {
+ string entry(it->first);
+ string value(it->second);
+ //DBG << (*it).first << "=" << (*it).second << endl;
+ if ( section == "main" )
+ {
+ if ( entry == "arch" )
+ {
+ Arch carch( value );
+ if ( carch != cfg_arch )
+ {
+ WAR << "Overriding system architecture (" << cfg_arch << "): " << carch << endl;
+ cfg_arch = carch;
+ }
+ }
+ else if ( entry == "metadatadir" )
+ {
+ cfg_metadata_path = Pathname(value);
+ }
+ else if ( entry == "reposdir" )
+ {
+ cfg_known_repos_path = Pathname(value);
+ }
+ else if ( entry == "cachedir" )
+ {
+ cfg_cache_path = Pathname(value);
+ }
+ else if ( entry == "repo.add.probe" )
+ {
+ repo_add_probe = str::strToBool( value, repo_add_probe );
+ }
+ else if ( entry == "repo.refresh.delay" )
+ {
+ str::strtonum(value, repo_refresh_delay);
+ }
+ else if ( entry == "download.use_patchrpm" )
+ {
+ download_use_patchrpm = str::strToBool( value, download_use_patchrpm );
+ }
+ else if ( entry == "download.use_deltarpm" )
+ {
+ download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
+ }
+ else if ( entry == "vendordir" )
+ {
+ cfg_vendor_path = Pathname(value);
+ }
+ }
+ }
+ }
}
else
{
MIL << confpath << " not found, using defaults instead." << endl;
- return;
}
- for ( IniDict::section_const_iterator sit = dict.sectionsBegin();
- sit != dict.sectionsEnd();
- ++sit )
- {
- string section(*sit);
- //MIL << section << endl;
- for ( IniDict::entry_const_iterator it = dict.entriesBegin(*sit);
- it != dict.entriesEnd(*sit);
- ++it )
+ // legacy:
+ if ( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) )
+ {
+ Arch carch( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) );
+ if ( carch != cfg_arch )
{
- string entry(it->first);
- string value(it->second);
- //DBG << (*it).first << "=" << (*it).second << endl;
- if ( section == "main" )
- {
- if ( entry == "arch" )
- {
- cfg_arch = Arch(value);
- }
- else if ( entry == "metadatadir" )
- {
- cfg_metadata_path = Pathname(value);
- }
- else if ( entry == "reposdir" )
- {
- cfg_known_repos_path = Pathname(value);
- }
- else if ( entry == "cachedir" )
- {
- cfg_cache_path = Pathname(value);
- }
- else if ( entry == "repo.add.probe" )
- {
- repo_add_probe = str::strToBool( value, repo_add_probe );
- }
- else if ( entry == "repo.refresh.delay" )
- {
- str::strtonum(value, repo_refresh_delay);
- }
- else if ( entry == "download.use_patchrpm" )
- {
- download_use_patchrpm = str::strToBool( value, download_use_patchrpm );
- }
- else if ( entry == "download.use_deltarpm" )
- {
- download_use_deltarpm = str::strToBool( value, download_use_deltarpm );
- }
- else if ( entry == "vendordir" )
- {
- cfg_vendor_path = Pathname(value);
- }
- }
+ WAR << "ZYPP_TESTSUITE_FAKE_ARCH: Overriding system architecture (" << cfg_arch << "): " << carch << endl;
+ cfg_arch = carch;
}
}
+
+ MIL << "ZConfig singleton created." << endl;
+ MIL << "defaultTextLocale: '" << cfg_textLocale << "'" << endl;
+ MIL << "System architecture is '" << cfg_arch << "'" << endl;
}
~Impl()
{}
public:
- parser::IniDict dict;
-
- Arch cfg_arch;
+ Arch cfg_arch;
+ Locale cfg_textLocale;
Pathname cfg_metadata_path;
Pathname cfg_cache_path;
Pathname cfg_known_repos_path;
- Pathname cfg_vendor_path;
+ Pathname cfg_vendor_path;
bool repo_add_probe;
unsigned repo_refresh_delay;
@@ -161,9 +281,7 @@
//
ZConfig::ZConfig()
: _pimpl( new Impl )
- {
-
- }
+ {}
///////////////////////////////////////////////////////////////////
//
@@ -174,43 +292,55 @@
{}
///////////////////////////////////////////////////////////////////
-#warning change methods to use the singleton
-
- ///////////////////////////////////////////////////////////////////
//
- // METHOD NAME : ZConfig::systemArchitecture
- // METHOD TYPE : Arch
+ // system architecture
//
+ ///////////////////////////////////////////////////////////////////
+
+ Arch ZConfig::defaultSystemArchitecture()
+ {
+ static Arch _val( _autodetectSystemArchitecture() );
+ return _val;
+ }
+
Arch ZConfig::systemArchitecture() const
+ { return _pimpl->cfg_arch; }
+
+ void ZConfig::setSystemArchitecture( const Arch & arch_r )
{
- // get architecture from ZYpp() if not overriden,
- // ZYpp() knows how to retrieve the client arch and check cpu flags
- return ( (_pimpl->cfg_arch == Arch()) ?
- getZYpp()->architecture() : _pimpl->cfg_arch );
+ if ( arch_r != _pimpl->cfg_arch )
+ {
+ WAR << "Overriding system architecture (" << _pimpl->cfg_arch << "): " << arch_r << endl;
+ _pimpl->cfg_arch = arch_r;
+ }
}
///////////////////////////////////////////////////////////////////
//
- // METHOD NAME : ZConfig::overrideSystemArchitecture
- // METHOD TYPE : void
+ // text locale
//
- void ZConfig::overrideSystemArchitecture(const Arch & arch)
+ ///////////////////////////////////////////////////////////////////
+
+ Locale ZConfig::defaultTextLocale()
{
- WAR << "Overriding system architecture with " << arch << endl;
- _pimpl->cfg_arch = arch;
- getZYpp()->setArchitecture( arch );
+ static Locale _val( _autodetectTextLocale() );
+ return _val;
}
- ///////////////////////////////////////////////////////////////////
- //
- // METHOD NAME : ZConfig::defaultTextLocale
- // METHOD TYPE : Locale
- //
Locale ZConfig::textLocale() const
+ { return _pimpl->cfg_textLocale; }
+
+ void ZConfig::setTextLocale( const Locale & locale_r )
{
- return getZYpp()->getTextLocale();
+ if ( locale_r != _pimpl->cfg_textLocale )
+ {
+ WAR << "Overriding text locale (" << _pimpl->cfg_textLocale << "): " << locale_r << endl;
+ _pimpl->cfg_textLocale = locale_r;
+ }
}
+ ///////////////////////////////////////////////////////////////////
+
Pathname ZConfig::repoMetadataPath() const
{
return ( _pimpl->cfg_metadata_path.empty()
@@ -254,7 +384,7 @@
Pathname ZConfig::vendorPath() const
{
return ( _pimpl->cfg_vendor_path.empty()
- ? Pathname("/etc/zypp/vendors.d") : _pimpl->cfg_vendor_path );
+ ? Pathname("/etc/zypp/vendors.d") : _pimpl->cfg_vendor_path );
}
/////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.h?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ZConfig.h Mon Feb 4 15:01:23 2008
@@ -14,6 +14,8 @@
#include <iosfwd>
+#include "zypp/base/Deprecated.h"
+
#include "zypp/base/NonCopyable.h"
#include "zypp/base/PtrTypes.h"
@@ -45,21 +47,47 @@
static ZConfig & instance();
public:
- /** The zypp system architecture. */
+
+ /** The autodetected system architecture. */
+ static Arch defaultSystemArchitecture();
+
+ /** The system architecture zypp uses. */
Arch systemArchitecture() const;
- /** Override the zypp system architecture, useful for test scenarious.
- This should be used for testing/debugging only since the Target backend
- won't be able to install incompatible packages !!
- DONT use for normal application unless you know what you're doing. */
- void overrideSystemArchitecture( const Arch & );
+ /** Override the zypp system architecture.
+ * This is useful for test scenarious. <b>But be warned</b>, zypp does
+ * not expect the system architecture to change at runtime. So
+ * set it at the verry beginning before you acess any other
+ * zypp component.
+ */
+ void setSystemArchitecture( const Arch & arch_r );
+
+ /** Reset the zypp system architecture to the default. */
+ void resetSystemArchitecture()
+ { setSystemArchitecture( defaultSystemArchitecture() ); }
+
+ /** use setSystemArchitecture */
+ ZYPP_DEPRECATED void overrideSystemArchitecture( const Arch & arch_r )
+ { setSystemArchitecture( arch_r ); }
+
+ public:
+ /** The autodetected prefered locale for translated texts.
+ */
+ static Locale defaultTextLocale();
- /** The prefered locale for translated labels, descriptions,
- * descriptions, etc. passed to the UI.
+ /** The locale for translated texts zypp uses.
*/
Locale textLocale() const;
- /**
+ /** Set the prefered locale for translated texts. */
+ void setTextLocale( const Locale & locale_r );
+
+ /** Reset the locale for translated texts to the default. */
+ void resetTextLocale()
+ { setTextLocale( defaultTextLocale() ); }
+
+ public:
+ /**
* Path where the repo metadata is downloaded and kept.
*/
Pathname repoMetadataPath() const;
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.cc?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.cc Mon Feb 4 15:01:23 2008
@@ -98,12 +98,6 @@
///////////////////////////////////////////////////////////////////
- void ZYpp::setTextLocale( const Locale & textLocale_r )
- { _pimpl->setTextLocale( textLocale_r ); }
-
- Locale ZYpp::getTextLocale() const
- { return _pimpl->getTextLocale(); }
-
void ZYpp::setRequestedLocales( const LocaleSet & locales_r )
{ _pimpl->setRequestedLocales( locales_r ); }
@@ -116,12 +110,6 @@
void ZYpp::availableLocale( const Locale & locale_r )
{ _pimpl->availableLocale( locale_r ); }
- Arch ZYpp::architecture() const
- { return _pimpl->architecture(); }
-
- void ZYpp::setArchitecture( const Arch & arch )
- { _pimpl->setArchitecture( arch ); }
-
Pathname ZYpp::homePath() const
{ return _pimpl->homePath(); }
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.h?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/ZYpp.h Mon Feb 4 15:01:23 2008
@@ -17,8 +17,10 @@
#include "zypp/base/ReferenceCounted.h"
#include "zypp/base/NonCopyable.h"
#include "zypp/base/PtrTypes.h"
-
#include "zypp/base/Deprecated.h"
+
+#include "zypp/ZConfig.h"
+
#include "zypp/ZYppCommit.h"
#include "zypp/ResTraits.h"
@@ -118,12 +120,18 @@
public:
/** Set the preferred locale for translated labels, descriptions,
* etc. passed to the UI.
+ * \deprecated Use ZConfig diretcly.
*/
- void setTextLocale( const Locale & textLocale_r );
- /** */
- Locale getTextLocale() const;
+ ZYPP_DEPRECATED void setTextLocale( const Locale & textLocale_r )
+ { ZConfig::instance().setTextLocale( textLocale_r ); }
+ /** \deprecated Use ZConfig diretcly. */
+ ZYPP_DEPRECATED Locale getTextLocale() const
+ { return ZConfig::instance().textLocale(); }
public:
+ /** \name move to pool
+ */
+ //@{
typedef std::set<Locale> LocaleSet;
/** Set the requested locales.
* Languages to be supported by the system, e.g. language specific
@@ -146,6 +154,7 @@
* internal use only
**/
void availableLocale( const Locale & locale_r );
+ //@}
public:
/** Get the path where zypp related plugins store persistent data and caches */
@@ -157,12 +166,18 @@
/** set the home, if you need to change it */
void setHomePath( const Pathname & path );
- /** Get the system architecture. */
- Arch architecture() const;
+ /** Get the system architecture.
+ * \deprecated Use ZConfig diretcly.
+ */
+ ZYPP_DEPRECATED Arch architecture() const
+ { return ZConfig::instance().systemArchitecture(); }
/** Set the system architecture.
- This should be used for testing/debugging only since the Target backend
- won't be able to install incompatible packages ;-) */
- void setArchitecture( const Arch & arch );
+ * This should be used for testing/debugging only since the Target backend
+ * won't be able to install incompatible packages ;-)
+ * \deprecated Use ZConfig diretcly.
+ */
+ ZYPP_DEPRECATED void setArchitecture( const Arch & arch )
+ { ZConfig::instance().setSystemArchitecture( arch ); }
public:
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/base/IOStream.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/base/IOStream.h?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/base/IOStream.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/base/IOStream.h Mon Feb 4 15:01:23 2008
@@ -87,6 +87,10 @@
const std::string & operator*() const
{ return _line; }
+ /** Access the current line. */
+ const std::string * operator->() const
+ { return &_line; }
+
/** Advance to next line. */
bool next();
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.cc?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.cc Mon Feb 4 15:01:23 2008
@@ -10,10 +10,7 @@
*
*/
-#include
-#include
#include <iostream>
-#include <fstream>
#include "zypp/TmpPath.h"
#include "zypp/base/Logger.h"
#include "zypp/base/String.h"
@@ -37,123 +34,16 @@
namespace zypp_detail
{ /////////////////////////////////////////////////////////////////
- /** The locale to be used for texts and messages.
- *
- * For the encoding to be used the preference is
- *
- * LC_ALL, LC_CTYPE, LANG
- *
- * For the language of the messages to be used, the preference is
- *
- * LANGUAGE, LC_ALL, LC_MESSAGES, LANG
- *
- * Note that LANGUAGE can contain more than one locale name, it can be
- * a list of locale names like for example
- *
- * LANGUAGE=ja_JP.UTF-8:de_DE.UTF-8:fr_FR.UTF-8
-
- * \todo Support dynamic fallbacklists defined by LANGUAGE
- */
- inline Locale defaultTextLocale()
- {
- Locale ret( "en" );
- const char * envlist[] = { "LC_ALL", "LC_MESSAGES", "LANG", NULL };
- for ( const char ** envvar = envlist; *envvar; ++envvar )
- {
- const char * envlang = getenv( *envvar );
- if ( envlang )
- {
- std::string envstr( envlang );
- if ( envstr != "POSIX" && envstr != "C" )
- {
- Locale lang( envlang );
- if ( ! lang.code().empty() )
- {
- ret = lang;
- break;
- }
- }
- }
- }
- return ret;
- }
-
- Arch defaultArchitecture()
- {
- Arch architecture;
-
- // detect the true architecture
- struct utsname buf;
- if ( uname( &buf ) < 0 )
- {
- ERR << "Can't determine system architecture" << endl;
- }
- else
- {
- architecture = Arch( buf.machine );
- DBG << "uname architecture is '" << buf.machine << "'" << endl;
-
- // some CPUs report i686 but dont implement cx8 and cmov
- // check for both flags in /proc/cpuinfo and downgrade
- // to i586 if either is missing (cf bug #18885)
-
- if ( architecture == Arch_i686 )
- {
- std::ifstream cpuinfo( "/proc/cpuinfo" );
- if ( !cpuinfo )
- {
- ERR << "Cant open /proc/cpuinfo" << endl;
- }
- else
- {
- char infoline[1024];
- while ( cpuinfo.good() )
- {
- if ( !cpuinfo.getline( infoline, 1024, '\n' ) )
- {
- if ( cpuinfo.eof() )
- break;
- }
- if ( strncmp( infoline, "flags", 5 ) == 0 )
- {
- std::string flagsline( infoline );
- if ( flagsline.find( "cx8" ) == std::string::npos
- || flagsline.find( "cmov" ) == std::string::npos )
- {
- architecture = Arch_i586;
- DBG << "CPU lacks 'cx8' or 'cmov': architecture downgraded to '" << architecture << "'" << endl;
- }
- break;
- } // flags found
- } // read proc/cpuinfo
- } // proc/cpuinfo opened
- } // i686 extra flags check
- }
-
- if ( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) )
- {
- architecture = Arch( getenv( "ZYPP_TESTSUITE_FAKE_ARCH" ) );
- WAR << "ZYPP_TESTSUITE_FAKE_ARCH: Setting fake system architecture for test purpuses to: '" << architecture << "'" << endl;
- }
-
- return architecture;
- }
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : ZYppImpl::ZYppImpl
// METHOD TYPE : Constructor
//
ZYppImpl::ZYppImpl()
- : _textLocale( defaultTextLocale() )
- , _target(0)
+ : _target(0)
, _resolver( new Resolver( ResPool::instance()) )
- , _architecture( defaultArchitecture() )
{
- MIL << "libzypp: " << VERSION << " built " << __DATE__ << " " << __TIME__ << endl;
- MIL << "defaultTextLocale: '" << _textLocale << "'" << endl;
- MIL << "System architecture is '" << _architecture << "'" << endl;
-
- MIL << "initializing keyring..." << std::endl;
+ MIL << "Initializing keyring..." << std::endl;
//_keyring = new KeyRing(homePath() + Pathname("/keyring/all"), homePath() + Pathname("/keyring/trusted"));
_keyring = new KeyRing(tmpPath());
}
@@ -382,14 +272,6 @@
}
//------------------------------------------------------------------------
- // architecture
-
- void ZYppImpl::setArchitecture( const Arch & arch )
- {
- _architecture = arch;
- }
-
- //------------------------------------------------------------------------
// target store path
Pathname ZYppImpl::homePath() const
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.h?rev=8456&r1=8455&r2=8456&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/zypp_detail/ZYppImpl.h Mon Feb 4 15:01:23 2008
@@ -88,16 +88,6 @@
void installSrcPackage( const SrcPackage_constPtr & srcPackage_r );
public:
- /** \todo Signal locale change. */
- void setTextLocale( const Locale & textLocale_r )
- { _textLocale = textLocale_r; }
- /** */
- Locale getTextLocale() const
- { return _textLocale; }
- private:
- Locale _textLocale;
-
- public:
typedef std::set<Locale> LocaleSet;
/** */
void setRequestedLocales( const LocaleSet & locales_r );
@@ -110,14 +100,6 @@
void availableLocale( const Locale & locale_r );
public:
- /** Get the system architecture. */
- Arch architecture() const
- { return _architecture; }
- /** Set the system architecture.
- This should be used for testing/debugging only since the Target backend
- won't be able to install incompatible packages ;-) */
- void setArchitecture( const Arch & arch );
-
/** Get the path where zypp related plugins store persistent data and caches */
Pathname homePath() const;
@@ -144,8 +126,6 @@
KeyRing_Ptr _keyring;
/** */
- Arch _architecture;
- /** */
Pathname _home_path;
/** defined mount points, used for disk usage counting */
shared_ptr<DiskUsageCounter> _disk_usage;
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org