-------------------------------------------------------------------
+Mon Aug 27 17:08:41 CEST 2007 - kkaempf@suse.de
+
+- Add ZConfig::overrideSystemArchitecture() to override zypp arch
+ from external, e.g. for the testcases
+- Honor ZYPP_CONF environment variable to override the buit-in
+ /etc/zypp/zypp.conf
+- Part of Bug 301286
+- rev 6905
+
+-------------------------------------------------------------------
Mon Aug 27 15:53:52 CEST 2007 - schubi@suse.de
-The solver generate an establish call for all
* Changing of filesystem whithin a workflow, cause the solver results will
be reset if the filesystem dependencies have been changed
Bug 271912
-- r 6951
+- r 6901
-------------------------------------------------------------------
Sun Aug 26 15:49:27 CEST 2007 - kkaempf@suse.de
#include "zypp/base/Logger.h"
#include "zypp/Arch.h"
#include "zypp/TmpPath.h"
+#include "zypp/ZConfig.h"
#include "zypp/cache/CacheInitializer.h"
#include "zypp/cache/sqlite3x/sqlite3x.hpp"
test_suite*
init_unit_test_suite( int, char* [] )
{
+ ZConfig::instance().overrideSystemArchitecture( Arch( "i686" ) );
test_suite* test= BOOST_TEST_SUITE( "CacheInit" );
test->add( BOOST_TEST_CASE( &cacheinit_test ), 0 /* expected zero error */ );
return test;
#include "zypp/ZYpp.h"
#include "zypp/ZYppFactory.h"
#include "zypp/TmpPath.h"
+#include "zypp/ZConfig.h"
#include "zypp/cache/CacheStore.h"
#include "zypp/data/ResolvableData.h"
{
datadir = argv[1];
}
+
+ ZConfig::instance().overrideSystemArchitecture( Arch( "i686" ) );
test_suite* test= BOOST_TEST_SUITE("CacheStore");
#include "zypp/Pattern.h"
#include "zypp/Product.h"
#include "zypp/Patch.h"
-
-#include "zypp/ZYppFactory.h"
+#include "zypp/ZConfig.h"
#include "zypp/detail/ImplConnect.h"
datadir = argv[1];
}
+ ZConfig::instance().overrideSystemArchitecture( Arch( "i686" ) );
+
test_suite* test= BOOST_TEST_SUITE("CacheStore");
std::string const params[] = { datadir };
mounts.insert( DiskUsageCounter::MountPoint("/foo") );
mounts.insert( DiskUsageCounter::MountPoint("/bar") );
getZYpp()->setPartitions(mounts);
- getZYpp()->setArchitecture(Arch("i686"));
test->add(BOOST_PARAM_TEST_CASE(&cache_write_susetags_normal_test,
(std::string const*)params, params+1));
autolock_untrustedvendor(false)
{
MIL << "ZConfig singleton created." << endl;
- Pathname confpath("/etc/zypp/zypp.conf");
+
+ // 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())
{
InputStream is(confpath);
}
else
{
- MIL << "No /etc/zypp/zypp.conf" << endl;
+ MIL << confpath << " not found, using defaults instead." << endl;
}
for ( IniDict::section_const_iterator sit = dict.sectionsBegin();
//
Arch ZConfig::systemArchitecture() const
{
+ // 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 );
}
///////////////////////////////////////////////////////////////////
//
+ // METHOD NAME : ZConfig::overrideSystemArchitecture
+ // METHOD TYPE : void
+ //
+ void ZConfig::overrideSystemArchitecture(const Arch & arch)
+ {
+ WAR << "Overriding system architecture with " << arch << endl;
+ _pimpl->cfg_arch = arch;
+ getZYpp()->setArchitecture( arch );
+ }
+
+ ///////////////////////////////////////////////////////////////////
+ //
// METHOD NAME : ZConfig::defaultTextLocale
// METHOD TYPE : Locale
//
* Use it to avoid hardcoded values and calls to getZYpp() just
* to retrieve some value like architecture, languages or tmppath.
*
+ * It reads /etc/zypp/zypp.conf, the filename can be overridden by
+ * setting the ZYPP_CONF environment variable to a different file.
+ *
* \ingroup Singleton
*/
class ZConfig : private base::NonCopyable
static ZConfig & instance();
public:
- /** The system architecture. */
+ /** The zypp system architecture. */
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 & );
+
/** The prefered locale for translated labels, descriptions,
* descriptions, etc. passed to the UI.
*/