: _root(root_r)
{
_rpm.initDatabase(_root);
-#ifndef STORAGE_DISABLED
- _storage.init(root_r);
-#endif
MIL << "Initialized target on " << _root << endl;
}
MIL << "Targets closed" << endl;
}
+#ifndef STORAGE_DISABLED
+ bool TargetImpl::isStorageEnabled() const
+ {
+ return _storage.isInitialized();
+ }
+
+
+ void TargetImpl::enableStorage(const Pathname &root_r)
+ {
+
+ _storage.init(root_r);
+ }
+#endif
+
const ResStore & TargetImpl::resolvables()
{
_store.clear();
media > 0 means limit commits to this media */
void commit( ResPool pool_r, unsigned int medianr, PoolItemList & errors_r, PoolItemList & remaining_r, PoolItemList & srcremaining_r );
+#ifndef STORAGE_DISABLED
+ /** enables the storage target */
+ bool isStorageEnabled() const;
+ void enableStorage(const Pathname &root_r);
+#endif
+
/** Commit ordered changes
return uncommitted ones (due to error) */
PoolItemList commit( const PoolItemList & items_r );
d->backend = new XMLFilesBackend(root);
}
+bool PersistentStorage::isInitalized()
+{
+ return ! (d->backend == 0L);
+}
+
///////////////////////////////////////////////////////////////////
//
// METHOD NAME : PersistentStorage::~PersistentStorage
* root path. THIS MUST BE CALLED BEFORE DOING ANY OPERATION
*/
void init(const Pathname &root);
+
+ /**
+ * true is backend was already initialized
+ */
+ bool isInitalized();
+
/**
* Stores a Resolvable in the active backend.
*/
std::ostream & operator<<( std::ostream & str, const PersistentStorage & obj );
/////////////////////////////////////////////////////////////////
- } // namespace devel.dmacvicar
+ } // namespace storage
///////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
-} // namespace devel
+} // namespace zypp
///////////////////////////////////////////////////////////////////
-#endif // DEVEL_DEVEL_DMACVICAR_PERSISTENTSTORAGE_H
+#endif // ZYPP_TARGET_PERSISTENTSTORAGE_H