+
+// FIXME: move into more generic code (metaindex ?)
+std::string MetaIndexFileName(metaIndex *metaindex)
+{
+ // FIXME: this cast is the horror, the horror
+ debReleaseIndex *r = (debReleaseIndex*)metaindex;
+
+ // see if we have a InRelease file
+ std::string PathInRelease = _config->FindDir("Dir::State::lists") +
+ URItoFileName(r->MetaIndexURI("InRelease"));
+ if (FileExists(PathInRelease))
+ return PathInRelease;
+
+ // and if not return the normal one
+ return _config->FindDir("Dir::State::lists") +
+ URItoFileName(r->MetaIndexURI("Release"));
+}
+
+
+