repodata_free_dircache(data);
queue_free(&pd.diskusageq);
+ if ((flags & REPO_EXTEND_SOLVABLES) != 0)
+ {
+ /* is this a filelist extension? */
+ if (repodata_has_keyname(data, SOLVABLE_FILELIST))
+ repodata_set_filelisttype(data, REPODATA_FILELIST_EXTENSION);
+ }
+ else
+ {
+ /* is this a primary with a filtered filelist? */
+ if (data->end > data->start)
+ {
+ repodata_set_filelisttype(data, REPODATA_FILELIST_FILTERED);
+ repodata_set_void(data, SOLVID_META, REPOSITORY_FILTEREDFILELIST);
+ }
+ }
+
if (!(flags & REPO_NO_INTERNALIZE))
repodata_internalize(data);
POOL_DEBUG(SOLV_DEBUG_STATS, "repo_add_rpmmd took %d ms\n", solv_timems(now));
solv_free(joinhash);
repodata_free_dircache(data);
+
+ if ((flags & REPO_EXTEND_SOLVABLES) != 0)
+ {
+ /* is this a filelist extension? */
+ if (repodata_has_keyname(data, SOLVABLE_FILELIST))
+ repodata_set_filelisttype(data, REPODATA_FILELIST_EXTENSION);
+ }
+ else
+ {
+ /* is this a primary with a filtered filelist? */
+ if (data->end > data->start)
+ {
+ repodata_set_filelisttype(data, REPODATA_FILELIST_FILTERED);
+ repodata_set_void(data, SOLVID_META, REPOSITORY_FILTEREDFILELIST);
+ }
+ }
+
if (!(flags & REPO_NO_INTERNALIZE))
repodata_internalize(data);
KNOWNID(SOLVABLE_INSTALLSTATUS, "solvable:installstatus"), /* debian install status */
KNOWNID(SOLVABLE_PREREQ_IGNOREINST, "solvable:prereq_ignoreinst"), /* ignore these pre-requires for installed packages */
+KNOWNID(REPOSITORY_FILTEREDFILELIST, "repository:filteredfilelist"), /* filelist in repository is filtered */
KNOWNID(ID_NUM_INTERNAL, 0)
repodata_set_constant;
repodata_set_constantid;
repodata_set_deltalocation;
+ repodata_set_filelisttype;
repodata_set_id;
repodata_set_idarray;
repodata_set_location;
repo->repodata[repo->nrepodata++] = data;
}
+ if ((flags & REPO_EXTEND_SOLVABLES) != 0)
+ {
+ if (repodata_has_keyname(&data, SOLVABLE_FILELIST))
+ repodata_set_filelisttype(repo->repodata + data.repodataid, REPODATA_FILELIST_EXTENSION);
+ }
+ else
+ {
+ if (repodata_lookup_type(&data, SOLVID_META, REPOSITORY_FILTEREDFILELIST))
+ repodata_set_filelisttype(repo->repodata + data.repodataid, REPODATA_FILELIST_FILTERED);
+ }
+
/* create stub repodata entries for all external */
if (!(flags & SOLV_ADD_NO_STUBS) && !parent)
{
if (data.keys[key].name == REPOSITORY_EXTERNAL && data.keys[key].type == REPOKEY_TYPE_FLEXARRAY)
break;
if (key < data.nkeys)
- repodata_create_stubs(repo->repodata + (repo->nrepodata - 1));
+ repodata_create_stubs(repo->repodata + data.repodataid);
}
POOL_DEBUG(SOLV_DEBUG_STATS, "repo_add_solv took %d ms\n", solv_timems(now));
}
}
+/* call the pool's loadcallback to load a stub repodata */
static void
repodata_stub_loader(Repodata *data)
{
Dataiterator di;
Id xkeyname = 0;
int i, cnt = 0;
+ int filelisttype = data->filelisttype;
dataiterator_init(&di, pool, repo, SOLVID_META, REPOSITORY_EXTERNAL, 0, 0);
while (dataiterator_step(&di))
else
{
repodata_add_stubkey(sdata, xkeyname, di.kv.id);
+ if (xkeyname == SOLVABLE_FILELIST && filelisttype == REPODATA_FILELIST_FILTERED)
+ repodata_set_filelisttype(sdata, REPODATA_FILELIST_EXTENSION);
xkeyname = 0;
}
}
return data;
}
+void
+repodata_set_filelisttype(Repodata *data, int type)
+{
+ data->filelisttype = type;
+}
+
unsigned int
repodata_memused(Repodata *data)
{
struct dircache;
#endif
-typedef struct _Repodata {
- Id repodataid; /* our id */
- struct _Repo *repo; /* back pointer to repo */
-
+/* repodata states */
#define REPODATA_AVAILABLE 0
#define REPODATA_STUB 1
#define REPODATA_ERROR 2
#define REPODATA_STORE 3
#define REPODATA_LOADING 4
+/* repodata filelist types */
+/* note that FILELIST_FILTERED means that the data contains a filtered
+ * filelist *AND* that it is authoritative for all included solvables. */
+#define REPODATA_FILELIST_FILTERED 1
+#define REPODATA_FILELIST_EXTENSION 2
+
+typedef struct _Repodata {
+ Id repodataid; /* our id */
+ struct _Repo *repo; /* back pointer to repo */
+
int state; /* available, stub or error */
void (*loadcallback)(struct _Repodata *);
FILE *fp; /* file pointer of solv file */
int error; /* corrupt solv file */
+ int filelisttype; /* type of filelist */
+
unsigned int schemadatalen; /* schema storage size */
Id *schematahash; /* unification helper */
* if valid, NULL if not possible */
const char *repodata_stringify(Pool *pool, Repodata *data, Repokey *key, struct _KeyValue *kv, int flags);
+/* filelist filter support */
+void repodata_set_filelisttype(Repodata *data, int filelisttype);
int repodata_filelistfilter_matches(Repodata *data, const char *str);
-
/* lookup functions */
Id repodata_lookup_type(Repodata *data, Id solvid, Id keyname);
Id repodata_lookup_id(Repodata *data, Id solvid, Id keyname);