Resolver_Ptr ZYpp::resolver() const
{ return _pimpl->resolver(); }
-
+
KeyRing* ZYpp::keyRing() const
{ return _pimpl->keyRing(); }
- void ZYpp::reset()
- { _pimpl->reset(); }
-
///////////////////////////////////////////////////////////////////
//
// Forward to Impl:
class ResStore;
class Locale;
class KeyRing;
-
+
///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ZYpp
void setPartitions(const DiskUsageCounter::MountPointSet &mp);
- public:
- /**
- * Tries to reset the ZYpp instance. It discards the current
- * status without too much house keeping. Might be dangerous to use.
- *
- * \throws Exception
- */
- void reset();
-
+ /** NOOP */
+ ZYPP_DEPRECATED void reset() {}
public:
/**
* \throws Exception
#include "zypp/ZYppFactory.h"
#include "zypp/zypp_detail/ZYppImpl.h"
+#include "zypp/zypp_detail/ZYppReadOnlyHack.h"
#define ZYPP_LOCK_FILE "/var/run/zypp.pid"
{ /////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
+ namespace zypp_readonly_hack
+ { /////////////////////////////////////////////////////////////////
+
+ static bool active = false;
+
+ void IWantIt()
+ {
+ active = true;
+ MIL << "ZYPP_READONLY promised." << endl;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace zypp_readonly_hack
+ ///////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
//
// CLASS NAME : ZYppGlobalLock
//
{
public:
- ZYppGlobalLock() : _zypp_lockfile(0), _clean_lock(false)
- {
-
- }
+ ZYppGlobalLock()
+ : _clean_lock(false)
+ , _zypp_lockfile(0)
+ {}
~ZYppGlobalLock()
{
}
bool _clean_lock;
-
+
private:
FILE *_zypp_lockfile;
if ( ! _instance )
{
+ /*--------------------------------------------------*/
+ if ( zypp_readonly_hack::active )
+ {
+ _instance = new ZYpp( ZYpp::Impl_Ptr(new ZYpp::Impl) );
+ MIL << "ZYPP_READONLY active." << endl;
+ return _instance;
+ }
+ /*--------------------------------------------------*/
if ( globalLock.zyppLocked() )
{
ZYPP_THROW( ZYppFactoryException(N_("Cannot aquire zypp lock.")) );
baseincludedir = $(pkgincludedir)/zypp_detail
baseinclude_HEADERS = \
- ZYppImpl.h
+ ZYppImpl.h \
+ ZYppReadOnlyHack.h
noinst_LTLIBRARIES = lib@PACKAGE@_zypp_detail.la
, _disk_usage()
{
MIL << "defaultTextLocale: '" << _textLocale << "'" << endl;
-
+
MIL << "initializing keyring..." << std::endl;
_keyring = new KeyRing(homePath() + Pathname("/keyring/all"), homePath() + Pathname("/keyring/trusted"));
-
+
struct utsname buf;
if (uname (&buf) < 0) {
ERR << "Can't determine system architecture" << endl;
delete _keyring;
}
- void ZYppImpl::reset()
- {
- MIL << "Resetting ZYpp instance" << endl;
- // TODO: check the memory is released
- _textLocale = defaultTextLocale();
- _pool = ResPoolManager();
- _sourceFeed = SourceFeed_Ref(_pool);
- _resolver = new Resolver(_pool.accessor());
- _disk_usage = DiskUsageCounter();
- _target = 0;
- }
-
//------------------------------------------------------------------------
// add/remove resolvables
KeyRing* keyRing() const
{ return _keyring; }
-
+
Resolver_Ptr resolver() const
{ return _resolver; }
/** Commit changes and transactions. */
ZYpp::CommitResult commit( int medianr_r, bool dry_run = false );
- /** Reset the instance, discard changes
- * \throws Exception
- */
- void reset();
-
public:
/** \todo Signal locale change. */
void setTextLocale( const Locale & textLocale_r )
Target_Ptr _target;
/** */
Resolver_Ptr _resolver;
-
+
KeyRing *_keyring;
/** */
Arch _architecture;
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/zypp_detail/ZYppReadOnlyHack.h
+ *
+*/
+
+#ifndef ZYPP_ZYPP_DETAIL_ZYPPREADONLYHACK_H
+#define ZYPP_ZYPP_DETAIL_ZYPPREADONLYHACK_H
+#warning ZYPP_ZYPP_DETAIL_ZYPPREADONLYHACK_H
+
+#include "zypp/base/Deprecated.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace zypp_readonly_hack
+ { /////////////////////////////////////////////////////////////////
+
+ void IWantIt() ZYPP_DEPRECATED;
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace zypp_readonly_hack
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
+#endif // ZYPP_ZYPP_DETAIL_ZYPPREADONLYHACK_H