Author: dmacvicar
Date: Fri Jan 25 16:32:56 2008
New Revision: 8372
URL: http://svn.opensuse.org/viewcvs/zypp?rev=8372&view=rev
Log:
commit again
Added:
branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/SolvStore_tp.cc
Modified:
branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/CMakeLists.txt
branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc
branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.cc
branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.h
branches/tmp/ma/jump_sat/libzypp/zypp/data/ResolvableDataConsumer.h
branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.cc
branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.h
branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.cc
branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.h
branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.cc
branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.h
Modified: branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/CMakeLists.txt?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/CMakeLists.txt (original)
+++ branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/CMakeLists.txt Fri Jan 25 16:32:56 2008
@@ -9,8 +9,8 @@
#ADD_EXECUTABLE(susetags-downloader SUSETagsDownloader_tp.cc)
#TARGET_LINK_LIBRARIES(susetags-downloader zypp )
-ADD_EXECUTABLE(cachestore CacheStore_tp.cc)
-TARGET_LINK_LIBRARIES(cachestore zypp )
+ADD_EXECUTABLE(solvstore SolvStore_tp.cc)
+TARGET_LINK_LIBRARIES(solvstore zypp )
#ADD_EXECUTABLE(testbed testbed.cc)
#TARGET_LINK_LIBRARIES(testbed zypp )
Added: branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/SolvStore_tp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/SolvStore_tp.cc?rev=8372&view=auto
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/SolvStore_tp.cc (added)
+++ branches/tmp/ma/jump_sat/libzypp/devel/devel.dmacvicar/SolvStore_tp.cc Fri Jan 25 16:32:56 2008
@@ -0,0 +1,47 @@
+#include
+
+#include <iostream>
+#include <fstream>
+
+#include
+#include
+#include
+#include
+
+#include "zypp/Product.h"
+#include "zypp/Package.h"
+#include "zypp/TmpPath.h"
+//#include "zypp/cache/CacheInitializer.h"
+#include "zypp/cache/SolvStore.h"
+#include "zypp/data/ResolvableData.h"
+#include "zypp/data/RecordId.h"
+#include "zypp/base/Measure.h"
+#include "zypp/parser/yum/RepoParser.h"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::debug;
+
+
+int main(int argc, char **argv)
+{
+ try
+ {
+ ZYpp::Ptr z = getZYpp();
+ filesystem::TmpDir solvdir;
+ zypp::cache::SolvStore store(solvdir.path());
+
+ Measure cap_insert_timer("Insert Capabilities");
+ parser::yum::RepoParser parser("foo", store);
+ parser.parse("/mounts/dist/install/stable-x86/suse");
+ }
+ catch ( const Exception &e )
+ {
+ cout << e.msg() << endl;
+ }
+
+ return 0;
+}
+
+
+
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/RepoManager.cc Fri Jan 25 16:32:56 2008
@@ -127,11 +127,10 @@
return;
MIL << info.alias() << " cleaning cache..." << endl;
- data::RecordId id = store.lookupRepository(info.alias());
-
+
CombinedProgressData subprogrcv(progress);
- store.cleanRepository(id, subprogrcv);
+ store.cleanRepository(info.alias(), subprogrcv);
}
////////////////////////////////////////////////////////////////////////////
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.cc?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.cc Fri Jan 25 16:32:56 2008
@@ -12,7 +12,7 @@
#include "zypp/cache/CacheAttributes.h"
#include "satsolver/repo.h"
-#include "satsolver/solvable.h"
+#include "satsolver/attr_store.h"
using namespace std;
using namespace zypp;
@@ -21,6 +21,8 @@
using zypp::debug::Measure;
+
+
/** Append OnMediaLocation attributes to resolvable with ID.
* \code
* appendOnMediaLocation( pkgid, attrPackageLocation, package->repositoryLocation );
@@ -52,11 +54,30 @@
Impl( const Pathname &solvdir )
: name_cache_hits(0)
, dir_cache_hits(0)
- , _last_repoid(0)
, _cachedir(solvdir)
{
_pool = pool_create();
-
+ _attr = new_store(_pool);
+
+ _attr_package_authors = str2id(_pool, "package:authors", 1);
+ _attr_package_description = str2id(_pool, "package:description", 1);
+ _attr_package_diskusage = str2id(_pool, "package:diskusage", 1);
+ _attr_package_downloadsize = str2id(_pool, "package:downloadsize", 1);
+ _attr_package_eula = str2id(_pool, "package:eula", 1);
+ _attr_package_group = str2id(_pool, "package:group", 1);
+ _attr_package_installsize = str2id(_pool, "package:authors", 1);
+ _attr_package_keywords = str2id(_pool, "package:keywords", 1);
+ _attr_package_license = str2id(_pool, "package:license", 1);
+ _attr_package_messagedel = str2id(_pool, "package:messagedel", 1);
+ _attr_package_messageins = str2id(_pool, "package:messageins", 1);
+ _attr_package_mediadir = str2id(_pool, "package:mediadir", 1);
+ _attr_package_mediafile = str2id(_pool, "package:mediafile", 1);
+ _attr_package_medianr = str2id(_pool, "package:medianr", 1);
+ _attr_package_nosource = str2id(_pool, "package:nosource", 1);
+ _attr_package_source = str2id(_pool, "package:source", 1);
+ _attr_package_sourceid = str2id(_pool, "package:sourceid", 1);
+ _attr_package_summary = str2id(_pool, "package:summary", 1);
+ _attr_package_time = str2id(_pool, "package:time", 1);
}
Impl()
@@ -78,10 +99,30 @@
_Pool *_pool;
- map _id2repo;
- map _name2repoid;
- RecordId _last_repoid;
+ map _repoid2repo;
+
Pathname _cachedir;
+ Attrstore *_attr;
+
+ Id _attr_package_authors;
+ Id _attr_package_description;
+ Id _attr_package_diskusage;
+ Id _attr_package_downloadsize;
+ Id _attr_package_eula;
+ Id _attr_package_group;
+ Id _attr_package_installsize;
+ Id _attr_package_keywords;
+ Id _attr_package_license;
+ Id _attr_package_messagedel;
+ Id _attr_package_messageins;
+ Id _attr_package_mediadir;
+ Id _attr_package_mediafile;
+ Id _attr_package_medianr;
+ Id _attr_package_nosource;
+ Id _attr_package_source;
+ Id _attr_package_sourceid;
+ Id _attr_package_summary;
+ Id _attr_package_time;
};
@@ -110,203 +151,213 @@
void SolvStore::appendResObjectAttributes( const data::RecordId &rid,
const data::ResObject_Ptr & res )
{
- appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
- appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
- appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
- appendNumericAttribute( rid, attrResObjectBuildTime(), res->buildTime );
- appendBooleanAttribute( rid, attrResObjectInstallOnly(), res->installOnly );
- appendStringAttribute( rid, attrResObjectVendor(), res->vendor );
- appendTranslatedStringAttribute( rid, attrResObjectLicenseToConfirm(), res->licenseToConfirm );
- appendTranslatedStringAttribute( rid, attrResObjectInsnotify(), res->insnotify );
- appendTranslatedStringAttribute( rid, attrResObjectDelnotify(), res->delnotify );
+
+// appendTranslatedStringAttribute( rid, attrResObjectDescription(), res->description );
+// appendTranslatedStringAttribute( rid, attrResObjectSummary(), res->summary );
+// appendNumericAttribute( rid, attrResObjectInstalledSize(), res->installedSize );
+// appendNumericAttribute( rid, attrResObjectBuildTime(), res->buildTime );
+// appendBooleanAttribute( rid, attrResObjectInstallOnly(), res->installOnly );
+// appendStringAttribute( rid, attrResObjectVendor(), res->vendor );
+// appendTranslatedStringAttribute( rid, attrResObjectLicenseToConfirm(), res->licenseToConfirm );
+// appendTranslatedStringAttribute( rid, attrResObjectInsnotify(), res->insnotify );
+// appendTranslatedStringAttribute( rid, attrResObjectDelnotify(), res->delnotify );
}
void SolvStore::appendPackageBaseAttributes( const RecordId & pkgid,
const data::Packagebase_Ptr & package )
{
- appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
- appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution );
- appendStringAttribute( pkgid, attrPackageLicense(), package->license );
- appendStringAttribute( pkgid, attrPackageGroup(), package->group );
- appendStringAttribute( pkgid, attrPackagePackager(), package->packager );
- appendStringAttribute( pkgid, attrPackageUrl(), package->url );
- appendStringAttribute( pkgid, attrPackageOperatingSystem(), package->operatingSystem );
- appendStringAttribute( pkgid, attrPackagePrein(), package->prein );
- appendStringAttribute( pkgid, attrPackagePostin(), package->postin );
- appendStringAttribute( pkgid, attrPackagePreun(), package->preun );
- appendStringAttribute( pkgid, attrPackagePostun(), package->postun );
- appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() );
- appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() );
-
- appendOnMediaLocation( pkgid, attrPackageLocation, package->repositoryLocation );
+
+// appendStringAttribute( pkgid, attrPackageBuildhost(), package->buildhost );
+// appendStringAttribute( pkgid, attrPackageDistribution(), package->distribution );
+// appendStringAttribute( pkgid, attrPackageLicense(), package->license );
+// appendStringAttribute( pkgid, attrPackageGroup(), package->group );
+// appendStringAttribute( pkgid, attrPackagePackager(), package->packager );
+// appendStringAttribute( pkgid, attrPackageUrl(), package->url );
+// appendStringAttribute( pkgid, attrPackageOperatingSystem(), package->operatingSystem );
+// appendStringAttribute( pkgid, attrPackagePrein(), package->prein );
+// appendStringAttribute( pkgid, attrPackagePostin(), package->postin );
+// appendStringAttribute( pkgid, attrPackagePreun(), package->preun );
+// appendStringAttribute( pkgid, attrPackagePostun(), package->postun );
+// appendStringContainerAttribute( pkgid, attrPackageKeywords(), package->keywords.begin(), package->keywords.end() );
+// appendStringContainerAttribute( pkgid, attrPackageAuthors(), package->authors.begin(), package->authors.end() );
+//
+// appendOnMediaLocation( pkgid, attrPackageLocation, package->repositoryLocation );
}
-RecordId SolvStore::consumePackage( const RecordId & repository_id,
+RecordId SolvStore::consumePackage( const std::string & repository_id,
const data::Package_Ptr & package )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Package>::kind,
- NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
- appendResObjectAttributes( id, package );
- appendPackageBaseAttributes( id, package );
+// RecordId id = appendResolvable( repository_id, ResTraits<Package>::kind,
+// NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
+// appendResObjectAttributes( id, package );
+// appendPackageBaseAttributes( id, package );
+//
+// if ( ! package->srcPackageIdent.name.empty() )
+// {
+// appendStringAttribute( id, attrPackageSourcePkgName(), package->srcPackageIdent.name );
+// appendStringAttribute( id, attrPackageSourcePkgEdition(), package->srcPackageIdent.edition.asString() );
+// }
- if ( ! package->srcPackageIdent.name.empty() )
- {
- appendStringAttribute( id, attrPackageSourcePkgName(), package->srcPackageIdent.name );
- appendStringAttribute( id, attrPackageSourcePkgEdition(), package->srcPackageIdent.edition.asString() );
- }
-
- return id;
+ //return id;
+ return 0;
}
-RecordId SolvStore::consumeSourcePackage( const data::RecordId & repository_id,
+RecordId SolvStore::consumeSourcePackage( const std::string & repository_id,
const data::SrcPackage_Ptr & package )
{
- RecordId id = appendResolvable( repository_id, ResTraits<SrcPackage>::kind,
- NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
- appendResObjectAttributes( id, package );
-
- appendOnMediaLocation( id, attrSrcPackageLocation, package->repositoryLocation );
- return id;
+// RecordId id = appendResolvable( repository_id, ResTraits<SrcPackage>::kind,
+// NVRA( package->name, package->edition, package->arch ), package->deps, package->shareDataWith );
+// appendResObjectAttributes( id, package );
+//
+// appendOnMediaLocation( id, attrSrcPackageLocation, package->repositoryLocation );
+ //return id;
+ return 0;
}
-RecordId SolvStore::consumePatch( const data::RecordId & repository_id,
+RecordId SolvStore::consumePatch( const std::string & repository_id,
const data::Patch_Ptr & patch)
-{
+{/*
RecordId id = appendResolvable(
repository_id, ResTraits<Patch>::kind,
- NVRA( patch->name, patch->edition, patch->arch ), patch->deps );
-
- appendResObjectAttributes( id, patch );
-
- // patch attributes
- appendNumericAttribute( id, attrPatchTimestamp(), patch->timestamp );
- appendStringAttribute( id, attrPatchCategory(), patch->category );
- appendStringAttribute( id, attrPatchId(), patch->id );
- appendBooleanAttribute( id, attrPatchRebootNeeded(), patch->rebootNeeded );
- appendBooleanAttribute( id, attrPatchAffectsPkgManager(), patch->affectsPkgManager );
-
-
- DBG << "got patch " << patch->name << ", atoms: ";
- // cosume atoms
- for (setdata::ResObject_Ptr::const_iterator p = patch->atoms.begin();
- p != patch->atoms.end(); ++p)
- {
- data::PackageAtom_Ptr atom = dynamic_pointer_castdata::PackageAtom(*p);
- if (atom)
- {
- DBG << atom->name << "(atom) ";
- consumePackageAtom(repository_id, atom);
- continue;
- }
-
- data::Script_Ptr script = dynamic_pointer_castdata::Script(*p);
- if (script)
- {
- DBG << script->name << "(script) ";
- consumeScript(repository_id, script);
- continue;
- }
-
- data::Message_Ptr message = dynamic_pointer_castdata::Message(*p);
- if (message)
- {
- DBG << message->name << "(message) ";
- consumeMessage(repository_id, message);
- continue;
- }
-
- ERR << " ignoring !badatom! ";
- if (*p) ERR << (*p)->name;
- ERR << endl;
- }
+ NVRA( patch->name, patch->edition, patch->arch ), patch->deps );*/
- DBG << endl;
- return id;
+// appendResObjectAttributes( id, patch );
+//
+// // patch attributes
+// appendNumericAttribute( id, attrPatchTimestamp(), patch->timestamp );
+// appendStringAttribute( id, attrPatchCategory(), patch->category );
+// appendStringAttribute( id, attrPatchId(), patch->id );
+// appendBooleanAttribute( id, attrPatchRebootNeeded(), patch->rebootNeeded );
+// appendBooleanAttribute( id, attrPatchAffectsPkgManager(), patch->affectsPkgManager );
+//
+//
+// DBG << "got patch " << patch->name << ", atoms: ";
+// // cosume atoms
+// for (setdata::ResObject_Ptr::const_iterator p = patch->atoms.begin();
+// p != patch->atoms.end(); ++p)
+// {
+// data::PackageAtom_Ptr atom = dynamic_pointer_castdata::PackageAtom(*p);
+// if (atom)
+// {
+// DBG << atom->name << "(atom) ";
+// consumePackageAtom(repository_id, atom);
+// continue;
+// }
+//
+// data::Script_Ptr script = dynamic_pointer_castdata::Script(*p);
+// if (script)
+// {
+// DBG << script->name << "(script) ";
+// consumeScript(repository_id, script);
+// continue;
+// }
+//
+// data::Message_Ptr message = dynamic_pointer_castdata::Message(*p);
+// if (message)
+// {
+// DBG << message->name << "(message) ";
+// consumeMessage(repository_id, message);
+// continue;
+// }
+//
+// ERR << " ignoring !badatom! ";
+// if (*p) ERR << (*p)->name;
+// ERR << endl;
+// }
+//
+// DBG << endl;
+ //return id;
+ return 0;
}
-RecordId SolvStore::consumePackageAtom( const data::RecordId & repository_id,
+RecordId SolvStore::consumePackageAtom( const std::string & repository_id,
const data::PackageAtom_Ptr & atom )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Atom>::kind,
- NVRA( atom->name, atom->edition, atom->arch ), atom->deps );
- appendResObjectAttributes( id, atom );
- appendPackageBaseAttributes( id, atom );
-
- for (setdata::PatchRpm_Ptr::const_iterator p = atom->patchRpms.begin();
- p != atom->patchRpms.end(); ++p)
- appendPatchRpm(repository_id, *p);
-
- for (setdata::DeltaRpm_Ptr::const_iterator d = atom->deltaRpms.begin();
- d != atom->deltaRpms.end(); ++d)
- appendDeltaRpm(repository_id, *d);
- return id;
+// RecordId id = appendResolvable( repository_id, ResTraits<Atom>::kind,
+// NVRA( atom->name, atom->edition, atom->arch ), atom->deps );
+// appendResObjectAttributes( id, atom );
+// appendPackageBaseAttributes( id, atom );
+//
+// for (setdata::PatchRpm_Ptr::const_iterator p = atom->patchRpms.begin();
+// p != atom->patchRpms.end(); ++p)
+// appendPatchRpm(repository_id, *p);
+//
+// for (setdata::DeltaRpm_Ptr::const_iterator d = atom->deltaRpms.begin();
+// d != atom->deltaRpms.end(); ++d)
+// appendDeltaRpm(repository_id, *d);
+ //7return id;
+ return 0;
}
-RecordId SolvStore::consumeMessage( const data::RecordId & repository_id,
+RecordId SolvStore::consumeMessage( const std::string & repository_id,
const data::Message_Ptr & message )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Message>::kind,
- NVRA( message->name, message->edition, message->arch ), message->deps );
- appendResObjectAttributes( id, message );
-
- appendTranslatedStringAttribute( id, attrMessageText(), message->text );
- return id;
+// RecordId id = appendResolvable( repository_id, ResTraits<Message>::kind,
+// NVRA( message->name, message->edition, message->arch ), message->deps );
+// appendResObjectAttributes( id, message );
+//
+// appendTranslatedStringAttribute( id, attrMessageText(), message->text );
+ //7return id;
+ return 0;
}
-RecordId SolvStore::consumeScript( const data::RecordId & repository_id,
+RecordId SolvStore::consumeScript( const std::string & repository_id,
const data::Script_Ptr & script )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Script>::kind,
- NVRA( script->name, script->edition, script->arch ), script->deps );
- appendResObjectAttributes( id, script );
-
- appendStringAttribute( id, attrScriptDoScript(), script->doScript );
- appendOnMediaLocation( id, attrScriptDoScriptLocation, script->doScriptLocation );
- appendStringAttribute( id, attrScriptUndoScript(), script->undoScript );
- appendOnMediaLocation( id, attrScriptUndoScriptLocation, script->undoScriptLocation );
- return id;
+ //RecordId id = appendResolvable( repository_id, ResTraits<Script>::kind,
+ //NVRA( script->name, script->edition, script->arch ), script->deps );
+// appendResObjectAttributes( id, script );
+//
+// appendStringAttribute( id, attrScriptDoScript(), script->doScript );
+// appendOnMediaLocation( id, attrScriptDoScriptLocation, script->doScriptLocation );
+// appendStringAttribute( id, attrScriptUndoScript(), script->undoScript );
+// appendOnMediaLocation( id, attrScriptUndoScriptLocation, script->undoScriptLocation );
+ //return id;
+ return 0;
}
-RecordId SolvStore::consumePattern( const data::RecordId & repository_id,
+RecordId SolvStore::consumePattern( const std::string & repository_id,
const data::Pattern_Ptr & pattern )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Pattern>::kind,
- NVRA( pattern->name, pattern->edition, pattern->arch ), pattern->deps );
- appendResObjectAttributes( id, pattern );
-
- appendBooleanAttribute( id, attrPatternIsDefault(), pattern->isDefault );
- appendBooleanAttribute( id, attrPatternUserVisible(), pattern->userVisible );
- appendTranslatedStringAttribute( id, attrPatternCategory(), pattern->category );
- appendStringAttribute( id, attrPatternIcon(), pattern->icon );
- appendStringAttribute( id, attrPatternOrder(), pattern->order );
+// RecordId id = appendResolvable( repository_id, ResTraits<Pattern>::kind,
+// NVRA( pattern->name, pattern->edition, pattern->arch ), pattern->deps );
+// appendResObjectAttributes( id, pattern );
+//
+// appendBooleanAttribute( id, attrPatternIsDefault(), pattern->isDefault );
+// appendBooleanAttribute( id, attrPatternUserVisible(), pattern->userVisible );
+// appendTranslatedStringAttribute( id, attrPatternCategory(), pattern->category );
+// appendStringAttribute( id, attrPatternIcon(), pattern->icon );
+// appendStringAttribute( id, attrPatternOrder(), pattern->order );
// We store them as string. They are
// (sometimes) evaluated by the YaST UI.
- appendStringContainerAttribute( id, attrPatternUiIncludes(), pattern->includes.begin(), pattern->includes.end() );
- appendStringContainerAttribute( id, attrPatternUiExtends(), pattern->extends.begin(), pattern->extends.end() );
+// appendStringContainerAttribute( id, attrPatternUiIncludes(), pattern->includes.begin(), pattern->includes.end() );
+// appendStringContainerAttribute( id, attrPatternUiExtends(), pattern->extends.begin(), pattern->extends.end() );
- return id;
+ //return id;
+ return 0;
}
-RecordId SolvStore::consumeProduct( const data::RecordId & repository_id,
+RecordId SolvStore::consumeProduct( const std::string & repository_id,
const data::Product_Ptr & product )
{
- RecordId id = appendResolvable( repository_id, ResTraits<Product>::kind,
- NVRA( product->name, product->edition, product->arch ), product->deps );
- appendResObjectAttributes( id, product );
-
- appendStringAttribute( id, attrProductType(), product->type );
- appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
- appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
- appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
- appendStringAttribute( id, attrProductReleasenotesUrl(), product->releasenotesUrl.asString() );
- appendStringContainerAttribute( id, attrProductUpdateUrls(), product->updateUrls );
- appendStringContainerAttribute( id, attrProductExtraUrls(), product->extraUrls );
- appendStringContainerAttribute( id, attrProductOptionalUrls(), product->optionalUrls );
- appendStringAttribute( id, attrProductDistributionName(), product->distributionName );
- appendStringAttribute( id, attrProductDistributionEdition(), product->distributionEdition.asString() );
- return id;
+// RecordId id = appendResolvable( repository_id, ResTraits<Product>::kind,
+// NVRA( product->name, product->edition, product->arch ), product->deps );
+// appendResObjectAttributes( id, product );
+//
+// appendStringAttribute( id, attrProductType(), product->type );
+// appendTranslatedStringAttribute( id, attrProductShortName(), product->shortName );
+// appendTranslatedStringAttribute( id, attrProductLongName(), product->longName );
+// appendStringContainerAttribute( id, attrProductFlags(), product->flags.begin(), product->flags.end() );
+// appendStringAttribute( id, attrProductReleasenotesUrl(), product->releasenotesUrl.asString() );
+// appendStringContainerAttribute( id, attrProductUpdateUrls(), product->updateUrls );
+// appendStringContainerAttribute( id, attrProductExtraUrls(), product->extraUrls );
+// appendStringContainerAttribute( id, attrProductOptionalUrls(), product->optionalUrls );
+// appendStringAttribute( id, attrProductDistributionName(), product->distributionName );
+// appendStringAttribute( id, attrProductDistributionEdition(), product->distributionEdition.asString() );
+ //return id;
+ return 0;
}
RecordId SolvStore::consumeChangelog( const data::RecordId &resolvable_id,
@@ -341,25 +392,26 @@
void SolvStore::updatePackageLang( const data::RecordId & resolvable_id,
const data::Packagebase_Ptr & data_r )
{
- appendTranslatedStringAttribute( resolvable_id, attrResObjectSummary(), data_r->summary );
- appendTranslatedStringAttribute( resolvable_id, attrResObjectDescription(), data_r->description );
- appendTranslatedStringAttribute( resolvable_id, attrResObjectLicenseToConfirm(), data_r->licenseToConfirm );
- appendTranslatedStringAttribute( resolvable_id, attrResObjectInsnotify(), data_r->insnotify );
- appendTranslatedStringAttribute( resolvable_id, attrResObjectDelnotify(), data_r->delnotify );
+// appendTranslatedStringAttribute( resolvable_id, attrResObjectSummary(), data_r->summary );
+// appendTranslatedStringAttribute( resolvable_id, attrResObjectDescription(), data_r->description );
+// appendTranslatedStringAttribute( resolvable_id, attrResObjectLicenseToConfirm(), data_r->licenseToConfirm );
+// appendTranslatedStringAttribute( resolvable_id, attrResObjectInsnotify(), data_r->insnotify );
+// appendTranslatedStringAttribute( resolvable_id, attrResObjectDelnotify(), data_r->delnotify );
}
-::_Solvable* SolvStore::appendResolvable( const data::RecordId &repository_id,
+_Solvable* SolvStore::appendResolvable( const std::string & repository_id,
const data::Resolvable_Ptr &res )
{
Repo *repo;
- map::const_iterator it = _pimpl->_id2repo.find(repository_id);
- if ( it == _pimpl->_id2repo.end() )
+ map::const_iterator it = _pimpl->_repoid2repo.find(repository_id);
+ if ( it == _pimpl->_repoid2repo.end() )
{
// throw
}
repo = it->second;
- Solvable *s = pool_id2solvable(_pimpl->_pool, repo_add_solvable(repo));
+ //Id
+ _Solvable *s = pool_id2solvable(_pimpl->_pool, repo_add_solvable(repo));
s->evr = str2id(_pimpl->_pool, res->edition.c_str(), 1);
// s->provides = adddep(pool, pd, s->provides, atts, 0);
//
@@ -374,79 +426,8 @@
}
-RecordId SolvStore::appendResolvable( const RecordId &repository_id,
- const Resolvable::Kind &kind,
- const NVRA &nvra,
- const data::Dependencies &deps )
-{
- return appendResolvable( repository_id,
- kind,
- nvra,
- deps,
- data::noRecordId );
-}
-
-data::RecordId
- SolvStore::appendResolvable( const data::RecordId &repository_id,
- const Resolvable::Kind &kind,
- const NVRA &nvra,
- const data::Dependencies &deps,
- const data::RecordId &shared_id )
-{
-
-// Solvable *s = pool_id2solvable(pool, repo_add_solvable(pd->repo));
-// s->evr = makeevr_atts(pool, pd, atts);
-// s->provides = adddep(pool, pd, s->provides, atts, 0);
-//
-// s->name = str2id(pool, nvra.name.c_str(), 1);
-// s->arch = str2id(pool, nvra.arch.c_str(), 1);
-// s->vendor = str2id(pool, nvra.vendor.c_str(), 1);
-//
-// if (!s->arch)
-// s->arch = ARCH_NOARCH;
-//
-// if (s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
-// s->provides = repo_addid_dep(pd->repo, s->provides, rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
-//
-// s->supplements = repo_fix_legacy(pd->repo, s->provides, s->supplements);
-
- // file
- //id = str2id(pool, pd->content, 1);
- //s->provides = repo_addid(pd->repo, s->provides, id);
-
-
-// long long id = _pimpl->con.insertid();
-//
-// appendDependencies( id, deps );
-
- return 0;
-}
-
-void SolvStore::appendDependencies( const RecordId &resolvable_id, const data::Dependencies &deps )
-{
- for ( data::Dependencies::const_iterator it = deps.begin(); it != deps.end(); ++it )
- {
- appendDependencyList( resolvable_id, it->first, it->second );
- }
-}
-
-void SolvStore::appendDependencyList( const RecordId &resolvable_id, Dep deptype, const data::DependencyList &caps )
-{
- for ( data::DependencyList::const_iterator it = caps.begin(); it != caps.end(); ++it )
- {
- appendDependency( resolvable_id, deptype, *it );
- }
-}
-
-void SolvStore::appendDependency( const RecordId &resolvable_id, Dep deptype, Capability cap )
-{
-#warning MIGRATE TO SAT
- // create capability from data
-}
-
-
/** \todo lookupOrAppend ? */
-RecordId SolvStore::appendPatchRpm(const zypp::data::RecordId &repository_id, const data::PatchRpm_Ptr & prpm)
+RecordId SolvStore::appendPatchRpm( const std::string & repository_id, const data::PatchRpm_Ptr & prpm)
{
RecordId id;
return id;
@@ -454,43 +435,13 @@
/** \todo lookupOrAppend ? */
-RecordId SolvStore::appendDeltaRpm(const zypp::data::RecordId &repository_id, const data::DeltaRpm_Ptr & drpm)
+RecordId SolvStore::appendDeltaRpm( const std::string & repository_id, const data::DeltaRpm_Ptr & drpm)
{
RecordId id;
return id;
}
-RecordId SolvStore::lookupOrAppendFile( const Pathname &path )
-{
- long long id = 0;
- return id;
-}
-
-void SolvStore::updateRepositoryStatus( const RecordId &id,
- const RepoStatus &status )
-{
- // NO OP for now
-}
-
-RecordId SolvStore::lookupOrAppendRepository( const string &alias )
-{
- map::const_iterator it = _pimpl->_name2repoid.find(alias);
- if (it == _pimpl->_name2repoid.end())
- {
- _pimpl->_name2repoid[alias] = ++_pimpl->_last_repoid;
- //_pimpl->_id2repo[_pimpl->_last_repoid] = ::repo_create(_pimpl->_pool, alias.c_str());
- }
- return _pimpl->_name2repoid[alias];
-}
-
-void SolvStore::cleanRepository( const data::RecordId &id,
- const ProgressData::ReceiverFnc & progressrcv )
-{
- // just delete the solv file
- //cleanupRepository(lookupRepository(
-}
-
void SolvStore::cleanRepository( const std::string &alias,
const ProgressData::ReceiverFnc & progressrcv )
{
@@ -506,120 +457,7 @@
bool SolvStore::isCached( const string &alias )
{
- return _pimpl->_name2repoid.find(alias) != _pimpl->_name2repoid.end();
-}
-
-RecordId SolvStore::lookupRepository( const string &alias )
-{
- map::const_iterator it = _pimpl->_name2repoid.find(alias);
- if (it == _pimpl->_name2repoid.end())
- ZYPP_THROW(CacheRecordNotFoundException());
-
- return _pimpl->_name2repoid[alias];
-}
-
-RecordId SolvStore::lookupOrAppendType( const string &klass, const string &name )
-{
- long long id = 0;
- return id;
-}
-
-RecordId SolvStore::lookupOrAppendName( const string &name )
-{
- long long id = 0;
- return id;
-}
-
-RecordId SolvStore::lookupOrAppendDirName( const string &name )
-{
- long long id = 0;
- return id;
-}
-
-RecordId SolvStore::lookupOrAppendFileName( const string &name )
-{
- long long id = 0;
- return id;
-}
-
-void SolvStore::setSharedData( const data::RecordId &resolvable_id,
- const data::RecordId &shared_id )
-{
-}
-
-void SolvStore::appendBooleanAttribute( const data::RecordId & resolvable_id,
- const std::string & klass,
- const std::string & name,
- bool value)
-{
- RecordId type_id = lookupOrAppendType( klass, name );
- appendNumericAttribute( resolvable_id, type_id, value ? 1 : 0 );
-}
-
-void SolvStore::appendNumericAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- int value )
-{
- RecordId type_id = lookupOrAppendType( klass, name );
- appendNumericAttribute( resolvable_id, type_id, value );
-}
-
-void SolvStore::appendNumericAttribute( const RecordId &resolvable_id,
- const RecordId &type_id,
- int value )
-{
- // weak resolvable_id
-}
-
-
-void SolvStore::appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- const TranslatedText &text )
-{
- set<Locale> locales = text.locales();
- for ( set<Locale>::const_iterator it = locales.begin(); it != locales.end(); ++it )
- {
- appendStringAttributeTranslation( resolvable_id, *it, klass, name, text.text(*it) );
- }
-}
-
-
-void SolvStore::appendStringAttributeTranslation( const data::RecordId &resolvable_id,
- const Locale &locale,
- const std::string &klass,
- const std::string &name,
- const std::string &text )
-{
- // don't bother with writing if the string is empty
- if (text.empty()) return;
-}
-
-void SolvStore::appendStringAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- const std::string &value )
-{
- // don't bother with writing if the string is empty
- if (value.empty()) return;
-}
-
-void SolvStore::appendStringAttribute( const RecordId &resolvable_id,
- const RecordId &type_id,
- const std::string &value )
-{
- // don't bother with writing if the string is empty
- if (value.empty()) return;
-}
-
-void SolvStore::appendStringAttribute( const RecordId &resolvable_id,
- const RecordId &lang_id,
- const RecordId &type_id,
- const string &value )
-{
- // don't bother with writing if the string is empty
- if (value.empty()) return;
+ return _pimpl->_repoid2repo.find(alias) != _pimpl->_repoid2repo.end();
}
}
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.h?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/cache/SolvStore.h Fri Jan 25 16:32:56 2008
@@ -25,6 +25,8 @@
#include "zypp/ProgressData.h"
#include "zypp/cache/Attribute.h"
+#include "satsolver/solvable.h"
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
@@ -61,7 +63,7 @@
* The data will be saved in the directory specified in
* \a dbdir. \a dbdir must exist.
*/
- SolvStore( const Pathname &dbdir );
+ SolvStore( const Pathname &solvdir );
/**
* Commit the changes.
@@ -77,7 +79,7 @@
* \param repository_id ownership.
* \param package Package data
*/
- virtual data::RecordId consumePackage(const data::RecordId &repository_id,
+ virtual data::RecordId consumePackage(const std::string &repo_id,
const data::Package_Ptr & package);
/**
@@ -87,7 +89,7 @@
* \param catalog_id ownership.
* \param srcpackage Source package data
*/
- virtual data::RecordId consumeSourcePackage( const data::RecordId &catalog_id,
+ virtual data::RecordId consumeSourcePackage( const std::string &repo_id,
const data::SrcPackage_Ptr & srcpackage );
/**
@@ -97,7 +99,7 @@
* \param repository_id ownership.
* \param patch Patch data
*/
- virtual data::RecordId consumePatch( const data::RecordId &repository_id,
+ virtual data::RecordId consumePatch( const std::string &repo_id,
const data::Patch_Ptr & patch );
/**
@@ -112,7 +114,7 @@
* \note this is somewhat specific to current YUM patch metadata design
* and may change (to consumeAtom(data::RecordId,data::Atom)).
*/
- virtual data::RecordId consumePackageAtom( const data::RecordId &repository_id,
+ virtual data::RecordId consumePackageAtom( const std::string &repo_id,
const data::PackageAtom_Ptr & atom );
/**
@@ -122,7 +124,7 @@
* \param repository_id ownership.
* \param message Message data
*/
- virtual data::RecordId consumeMessage( const data::RecordId & repository_id,
+ virtual data::RecordId consumeMessage( const std::string &repo_id,
const data::Message_Ptr & message);
/**
@@ -132,7 +134,7 @@
* \param repository_id ownership.
* \param script Script data
*/
- virtual data::RecordId consumeScript( const data::RecordId & repository_id,
+ virtual data::RecordId consumeScript( const std::string & repo_id,
const data::Script_Ptr & script);
/**
@@ -142,7 +144,7 @@
* \param repository_id ownership.
* \param pattern Pattern data
*/
- virtual data::RecordId consumePattern( const data::RecordId & repository_id,
+ virtual data::RecordId consumePattern( const std::string & repo_id,
const data::Pattern_Ptr & pattern );
/**
@@ -152,7 +154,7 @@
* \param repository_id ownership.
* \param pattern Pattern data
*/
- virtual data::RecordId consumeProduct( const data::RecordId &repository_id,
+ virtual data::RecordId consumeProduct( const std::string &repo_id,
const data::Product_Ptr & product );
/**
@@ -232,70 +234,8 @@
* other properties.
*
*/
- data::RecordId appendResolvable( const data::RecordId &repository_id,
- const Resolvable::Kind &kind,
- const NVRA &nvra,
- const data::Dependencies &deps );
-
- /**
- * \short Appends a resolvable, and sets shared data with another one
- *
- * \see appendResolvable
- * \param shared_id Resolvable that provides data in case
- * this one does not provide an attribute
- *
- * \note Not all attributes can be shared. \ref shared_id is just
- * a hint for the queries.
- */
- data::RecordId appendResolvable( const data::RecordId &repository_id,
- const Resolvable::Kind &kind,
- const NVRA &nvra,
- const data::Dependencies &deps,
- const data::RecordId &shared_id );
- /**
- * Adds dependencies to the store
- *
- * A map of dependency lists has to be specified. The map contains
- * list of capablities for each dependency type \ref zypp::Dep
- *
- * \a resolvable_id is the resolvable Id in the SolvStore
- * that will own those capabilities.
- *
- * FIXME should it \throw if the resolvable does not exist?
- */
- void appendDependencies( const data::RecordId &resolvable_id,
- const data::Dependencies &dependencies );
-
- /**
- * Adds dependencies to the store
- *
- * A lists of dependencies \a dlist to be specified. Among
- * which type of dependencies \ref zypp::Dep it is as
- * the \a deptype argument.
- *
- * \a resolvable_id is the resolvable Id in the SolvStore
- * that will own those capabilities.
- *
- * FIXME should it \throw if the resolvable does not exist?
- */
- void appendDependencyList( const data::RecordId &resolvable_id,
- Dep deptype,
- const data::DependencyList &dlist );
- /**
- * Adds a dependency to the store.
- *
- * A \ref CapabilityImpl::Ptr argument \a cap has to be specified.
- * Among which type of dependency \ref zypp::Dep it is as
- * the \a deptype argument.
- *
- * \a resolvable_id is the resolvable Id in the SolvStore
- * that will own the capability
- *
- * FIXME should it \throw if the resolvable does not exist?
- */
- void appendDependency( const data::RecordId &resolvable_id,
- Dep deptype,
- Capability cap );
+ _Solvable* appendResolvable( const std::string &repo_id,
+ const data::Resolvable_Ptr &res );
/**
* Insert patch RPM data into <tt>patch_packages</tt> table.
@@ -303,7 +243,7 @@
* \param prpm The patch RPM object to insert.
* \return Record ID of the newly inserted record.
*/
- data::RecordId appendPatchRpm( const data::RecordId &repo_id,
+ data::RecordId appendPatchRpm( const std::string &repo_id,
const data::PatchRpm_Ptr & prpm);
@@ -313,29 +253,11 @@
* \param drpm The delta RPM object to insert.
* \return Record ID of the newly inserted record.
*/
- data::RecordId appendDeltaRpm( const data::RecordId &repo_id,
+ data::RecordId appendDeltaRpm( const std::string &repo_id,
const data::DeltaRpm_Ptr & drpm);
/**
- * Returns the record id of a type
- *
- * Types are mostly used internally. To give concepts
- * a record id to associate with.
- * Examples could be arch::i386, lang::en_US
- * Packages::summary, rel:>, kind::Package
- *
- * \note If the type entry does not exist, it will
- * be created and the new inserted entry's id will
- * be returned.
- */
- data::RecordId lookupOrAppendType( const std::string &klass,
- const std::string &name );
- /** \overload */
- data::RecordId lookupOrAppendType( const Attribute &attr )
- { return lookupOrAppendType( attr.klass, attr.name ); }
-
- /**
* Returns the record id of a repository (Source)
*
* \param alias Unique alias for this repo
@@ -346,340 +268,6 @@
*/
data::RecordId lookupOrAppendRepository( const std::string &alias );
- /**
- * Set the resolvable shared data flag pointing to
- * another resolvable.
- *
- * This is a hint for cache readers. If any attribute
- * of a resolvable is empty, is because it is shared
- * with another resolvable.
- *
- * \param resolvable_id Id of the resolvable. Must exists
- * \param shared_id The resolvable providing the data
- * This one is a weak reference, the reader should just
- * try to look the data there as a hint.
- * use \ref data::noRecordId to reset the value.
- *
- */
- void setSharedData( const data::RecordId &resolvable_id,
- const data::RecordId &shared_id );
-
- /**
- * Append a numeric attribute to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param klass Type class i.e "Package" "lang" "kind"
- * \param name Type name i.e : "size" "media_number"
- * \param value numeric value
- */
- void appendNumericAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- int value );
- /** \overload */
- void appendNumericAttribute( const data::RecordId &resolvable_id,
- const Attribute& attr,
- int value )
- { appendNumericAttribute( resolvable_id, attr.klass, attr.name, value ); }
-
- /**
- * Append a translated string value to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param klass Type class i.e "Package" "lang" "kind"
- * \param name Type name i.e : "summary" "none" "Script"
- * \param text Translated text
- */
- void appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- const TranslatedText &text );
- /** \overload */
- void appendTranslatedStringAttribute( const data::RecordId &resolvable_id,
- const Attribute& attr,
- const TranslatedText &text )
- { appendTranslatedStringAttribute( resolvable_id, attr.klass, attr.name, text ); }
-
- /**
- * Append a string value to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param locale locale of the text language
- * \param klass Type class i.e "Package" "lang" "kind"
- * \param name Type name i.e : "summary" "none" "Script"
- * \param text text
- */
- void appendStringAttributeTranslation( const data::RecordId &resolvable_id,
- const Locale &locale,
- const std::string &klass,
- const std::string &name,
- const std::string &text );
- /** \overload */
- void appendStringAttributeTranslation( const data::RecordId &resolvable_id,
- const Locale &locale,
- const Attribute& attr,
- const std::string &text )
- { appendStringAttributeTranslation( resolvable_id, locale, attr.klass, attr.name, text ); }
-
- /**
- * Append a string value to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param klass Type class i.e "Package" "lang" "kind"
- * \param name Type name i.e : "summary" "none" "Script"
- * \param value string value
- */
- void appendStringAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- const std::string &value );
- /** \overload */
- void appendStringAttribute( const data::RecordId &resolvable_id,
- const Attribute& attr,
- const std::string &value )
- { appendStringAttribute( resolvable_id, attr.klass, attr.name, value ); }
-
- /**
- * Append a string value to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param type_id Type id, \see lookupOrAppendType
- * \param value string value
- */
- void appendStringAttribute( const data::RecordId &resolvable_id,
- const data::RecordId &type_id,
- const std::string &value );
-
- /**
- * Append strings from _Iterator to a resolvable.
- *
- * Uses \ref zypp::str::split(_Iterator,_Iterator, std::string) with
- * \ref ZConfig::cacheDBSplitJoinSeparator() as the second argument
- * (a separator string) of split().
- *
- * Any container of any class providing asString() can be used.
- *
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param klass Type class i.e "Package" "lang" "kind"
- * \param name Type name i.e : "summary" "none" "Script"
- * \param begin begin Iterator to the container
- * \param end end Iterator to the container
- */
- template <class _Iterator>
- void appendStringContainerAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- _Iterator begin,
- _Iterator end )
- {
- std::string value = str::join(begin, end, ZConfig::instance().cacheDBSplitJoinSeparator());
- appendStringAttribute( resolvable_id, klass, name, value );
- }
- /** \overload */
- template <class _Iterator>
- void appendStringContainerAttribute( const data::RecordId &resolvable_id,
- const Attribute& attr,
- _Iterator begin,
- _Iterator end )
- { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, begin, end ); }
-
- /**
- * Append strings from a _Container to a resolvable.
- *
- * Convenience method taking the container instead of it's
- * begin/end iterators as argument.
- *
- * \see appendStringContainerAttribute
- */
- template <class _Container>
- void appendStringContainerAttribute( const data::RecordId &resolvable_id,
- const std::string &klass,
- const std::string &name,
- const _Container & container )
- { appendStringContainerAttribute( resolvable_id, klass, name, container.begin(), container.end() ); }
- /** \overload */
- template <class _Container>
- void appendStringContainerAttribute( const data::RecordId &resolvable_id,
- const Attribute& attr,
- const _Container & container )
- { appendStringContainerAttribute( resolvable_id, attr.klass, attr.name, container ); }
-
- /**
- * Update a known repository checksum and timestamp
- *
- * \note If you don't provide timestamp it defaults
- * to now.
- *
- * It is responsability of the caller to operate with
- * a valid record id. You can get one
- * Using \ref lookupOrAppendRepository
- *
- * If the repository does not exists, nothing will happen
- */
- void updateRepositoryStatus( const data::RecordId &id,
- const RepoStatus &status );
-
- /**
- * \short Clean repository from cache
- *
- * \param id repository identifier in cache
- *
- * You can check existence using \ref isCached
- *
- * \throws CacheRecordNotFoundException if the repository
- * id does not refer to a valid repository.
- */
- void cleanRepository( const data::RecordId &id,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
-
- /**
- * \short Clean repository from cache
- *
- * \param alias Repository unique alias
- *
- * You can check existence using \ref isCached
- *
- * \throws CacheRecordNotFoundException if the repository
- * alias does not refer to a valid repository.
- */
- void cleanRepository( const std::string &alias,
- const ProgressData::ReceiverFnc & progressrcv = ProgressData::ReceiverFnc() );
-
- /**
- * get the status of a cached repository
- *
- * It is responsability of the caller to operate with
- * a valid alias. You can insert one
- * Using \ref lookupOrAppendRepository
- *
- * You can check existence using \ref isCached
- *
- * \throws CacheRecordNotFoundException if the repository
- * alias is unknown
- */
- RepoStatus repositoryStatus( const std::string &alias );
-
- /**
- * \short Does a repository exists in cache?
- *
- * True if the repository is cached
- */
- bool isCached( const std::string &alias );
-
- /**
- * \short looks the id for a repository in cache
- *
- * \param alias Repository unique alias
- *
- * \throws CacheRecordNotFoundException if the repository
- * alias is unknown
- */
- data::RecordId lookupRepository( const std::string &alias );
-
-
- /**
- * Returns the record id of a file entry \a path
- *
- * \note If the file entry does not exist, it will
- * be created and the new inserted entry's id will
- * be returned.
- */
- data::RecordId lookupOrAppendFile( const Pathname &path );
-
- /**
- * Returns the record id of a name entry \a name
- *
- * \note If the name entry does not exist, it will
- * be created and the new inserted entry's id will
- * be returned.
- */
- data::RecordId lookupOrAppendName( const std::string &name );
-
- /**
- * Returns the record id of a directory name entry \a name
- *
- * \note If the directory name entry does not exist, it will
- * be created and the new inserted entry's id will
- * be returned.
- */
- data::RecordId lookupOrAppendDirName( const std::string &name );
-
- /**
- * Returns the record id of a file name entry \a name
- *
- * \note If the file name entry does not exist, it will
- * be created and the new inserted entry's id will
- * be returned.
- */
- data::RecordId lookupOrAppendFileName( const std::string &name );
-
- protected:
-
- /**
- * Appends a solvable to the store.
- *
- * You have to specify with \a kind of resolvable are you inserting
- * and its \c NVRA (name version release and architecture ).
- * Optionaly you can pass a list of \c CapabilityImpl::Ptr
- * as dependencies for the resolvable.
- *
- * You have to specify the RecordId for the repository owning
- * this resolvable. Yuu can obtain it with
- * \ref lookupOrAppendRepository
- *
- * You can create those \a deps using \ref capability::parse
- * functions, or the build methods to create specific types
- * of capabilities:
- * \ref capability::buildVersioned for \c VersionedCap
- * \ref capability::buildNamed for \c NamedCap
- * etc.
- *
- * Once the resolvable is inserted, you will get back the id
- * if it in the store. Which you can use for later adding
- * other properties.
- *
- */
- ::_Solvable* appendResolvable( const data::RecordId &repository_id,
- const data::Resolvable_Ptr &res );
-
- protected:
- /**
- * Internally used function that appends a entry in
- * the capabilities table for a specific capability
- * entry.
- */
-// data::RecordId appendDependencyEntry( const data::RecordId &,
-// zypp::Dep, const Resolvable::Kind & );
-
- void appendStringAttribute( const data::RecordId &resolvable_id,
- const data::RecordId &lang_id,
- const data::RecordId &type_id,
- const std::string &value );
-
- /**
- * Append a numeric attribute to a resolvable
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param type_id attribute id
- * \param value numeric value
- */
- void appendNumericAttribute( const data::RecordId &resolvable_id,
- const data::RecordId &type_id,
- int value );
-
- /**
- * Append a bool attribute to a resolvable. Will be stored as
- * numeric 1 or 0.
- *
- * \param resolvable_id Resovable Id, owner of the attribute
- * \param type_id attribute id
- * \param value bool value
- */
- void appendBooleanAttribute( const data::RecordId & resolvable_id,
- const std::string & klass,
- const std::string & name,
- bool value);
- /** \overload */
- void appendBooleanAttribute( const data::RecordId & resolvable_id,
- const Attribute& attr,
- bool value)
- { appendBooleanAttribute( resolvable_id, attr.klass, attr.name, value ); }
-
-
/** \name Detail Attributes Inserters
* These functions are used by ResolvableConsumer interface functions
* to avoid some duplication across types.
@@ -692,6 +280,12 @@
const data::Packagebase_Ptr & package);
//@}
+ void cleanRepository( const std::string &alias,
+ const ProgressData::ReceiverFnc & progressrcv );
+
+ RepoStatus repositoryStatus( const std::string &alias );
+
+ bool isCached( const std::string &alias );
private:
/** Implementation. */
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/data/ResolvableDataConsumer.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/data/ResolvableDataConsumer.h?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/data/ResolvableDataConsumer.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/data/ResolvableDataConsumer.h Fri Jan 25 16:32:56 2008
@@ -29,14 +29,14 @@
ResolvableDataConsumer();
virtual ~ResolvableDataConsumer();
- virtual data::RecordId consumePackage ( const data::RecordId & repository_id, const data::Package_Ptr & ) = 0;
- virtual data::RecordId consumeSourcePackage( const data::RecordId & repository_id, const data::SrcPackage_Ptr & ) = 0;
- virtual data::RecordId consumeProduct ( const data::RecordId & repository_id, const data::Product_Ptr & ) = 0;
- virtual data::RecordId consumePatch ( const data::RecordId & repository_id, const data::Patch_Ptr & ) = 0;
- virtual data::RecordId consumePackageAtom ( const data::RecordId & repository_id, const data::PackageAtom_Ptr & ) = 0;
- virtual data::RecordId consumeMessage ( const data::RecordId & repository_id, const data::Message_Ptr & ) = 0;
- virtual data::RecordId consumeScript ( const data::RecordId & repository_id, const data::Script_Ptr & ) = 0;
- virtual data::RecordId consumePattern ( const data::RecordId & repository_id, const data::Pattern_Ptr & ) = 0;
+ virtual data::RecordId consumePackage ( const std::string & repository_id, const data::Package_Ptr & ) = 0;
+ virtual data::RecordId consumeSourcePackage( const std::string & repository_id, const data::SrcPackage_Ptr & ) = 0;
+ virtual data::RecordId consumeProduct ( const std::string & repository_id, const data::Product_Ptr & ) = 0;
+ virtual data::RecordId consumePatch ( const std::string & repository_id, const data::Patch_Ptr & ) = 0;
+ virtual data::RecordId consumePackageAtom ( const std::string & repository_id, const data::PackageAtom_Ptr & ) = 0;
+ virtual data::RecordId consumeMessage ( const std::string & repository_id, const data::Message_Ptr & ) = 0;
+ virtual data::RecordId consumeScript ( const std::string & repository_id, const data::Script_Ptr & ) = 0;
+ virtual data::RecordId consumePattern ( const std::string & repository_id, const data::Pattern_Ptr & ) = 0;
virtual data::RecordId consumeChangelog ( const data::RecordId & resolvable_id, const Changelog & ) = 0;
virtual data::RecordId consumeFilelist ( const data::RecordId & resolvable_id, const data::Filenames & ) = 0;
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.cc?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.cc Fri Jan 25 16:32:56 2008
@@ -72,7 +72,7 @@
data::Package_Ptr makePackageDataFromHeader( const RpmHeader::constPtr header,
set<string> * filerequires,
- const Pathname & location, data::RecordId &repoid )
+ const Pathname & location, std::string &repoid )
{
if ( ! header )
return 0;
@@ -130,7 +130,7 @@
class RepoParser::Impl
{
public:
- Impl( const data::RecordId & repositoryId_r,
+ Impl( const std::string & repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r )
: _repositoryId( repositoryId_r )
@@ -146,7 +146,7 @@
public:
private:
- data::RecordId _repositoryId;
+ std::string _repositoryId;
data::ResolvableDataConsumer & _consumer;
ProgressData _ticks;
Arch _sysarch;
@@ -247,7 +247,7 @@
// METHOD NAME : RepoParser::RepoParser
// METHOD TYPE : Ctor
//
-RepoParser::RepoParser( const data::RecordId & repositoryId_r,
+RepoParser::RepoParser( const std::string & repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r )
: _pimpl( new Impl( repositoryId_r, consumer_r, fnc_r ) )
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.h?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/plaindir/RepoParser.h Fri Jan 25 16:32:56 2008
@@ -47,7 +47,7 @@
* \param consumer_r consumer of parsed data
* \param fnc_r progress reporting function
*/
- RepoParser( const data::RecordId & repositoryId_r,
+ RepoParser( const std::string & repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() );
/** Dtor */
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.cc?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.cc Fri Jan 25 16:32:56 2008
@@ -53,7 +53,7 @@
class RepoParser::Impl
{
public:
- Impl( const data::RecordId & repositoryId_r,
+ Impl( const std::string & repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r )
: _repositoryId( repositoryId_r )
@@ -367,7 +367,7 @@
}
private:
- data::RecordId _repositoryId;
+ std::string _repositoryId;
data::ResolvableDataConsumer & _consumer;
ProgressData _ticks;
@@ -558,7 +558,7 @@
// METHOD NAME : RepoParser::RepoParser
// METHOD TYPE : Ctor
//
- RepoParser::RepoParser( const data::RecordId & repositoryId_r,
+ RepoParser::RepoParser( const std::string & repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r )
: _pimpl( new Impl( repositoryId_r, consumer_r, fnc_r ) )
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.h?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/susetags/RepoParser.h Fri Jan 25 16:32:56 2008
@@ -71,7 +71,7 @@
* \param consumer_r consumer of parsed data
* \param fnc_r progress reporting function
*/
- RepoParser( const data::RecordId & repositoryId_r,
+ RepoParser( const std::string &repositoryId_r,
data::ResolvableDataConsumer & consumer_r,
const ProgressData::ReceiverFnc & fnc_r = ProgressData::ReceiverFnc() );
/** Dtor */
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.cc
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.cc?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.cc (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.cc Fri Jan 25 16:32:56 2008
@@ -71,7 +71,7 @@
public:
/** CTOR */
Impl(
- const data::RecordId & repository_id,
+ const std::string &repo_id,
data::ResolvableDataConsumer & consumer,
const RepoParserOpts & options = RepoParserOpts(),
const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc()
@@ -158,7 +158,7 @@
private:
/** ID of the repository record in the DB (repositories.id) */
- data::RecordId _repository_id;
+ string _repository_id;
/** Object for processing the read data */
data::ResolvableDataConsumer & _consumer;
@@ -176,7 +176,7 @@
RepoParser::Impl::Impl(
- const data::RecordId & repository_id,
+ const std::string & repository_id,
data::ResolvableDataConsumer & consumer,
const RepoParserOpts & options,
const ProgressData::ReceiverFnc & progress)
@@ -460,7 +460,7 @@
///////////////////////////////////////////////////////////////////
RepoParser::RepoParser(
- const data::RecordId & repository_id,
+ const std::string & repository_id,
data::ResolvableDataConsumer & consumer,
const RepoParserOpts & options,
const ProgressData::ReceiverFnc & progress)
Modified: branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.h
URL: http://svn.opensuse.org/viewcvs/zypp/branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.h?rev=8372&r1=8371&r2=8372&view=diff
==============================================================================
--- branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.h (original)
+++ branches/tmp/ma/jump_sat/libzypp/zypp/parser/yum/RepoParser.h Fri Jan 25 16:32:56 2008
@@ -69,7 +69,7 @@
* \param progress progress reporting function
*/
RepoParser(
- const data::RecordId & repository_id,
+ const std::string &repo_id,
data::ResolvableDataConsumer & consumer,
const RepoParserOpts & options = RepoParserOpts(),
const ProgressData::ReceiverFnc & progress = ProgressData::ReceiverFnc()
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org