Commit 4629d3d2 authored by Bernhard Link's avatar Bernhard Link

store override data in a tree instead of an list and some preparations for...

store override data in a tree instead of an list and some preparations for patterns in override files
parent 43c7dadd
2010-06-26
* store override data in a tree instead of an list and
some preparations for patterns in override files.
2010-06-25
* Ignore overrides for fields starting with '$' and
warn about unknown fields to allow later introduction
......
......@@ -267,7 +267,7 @@ retvalue binaries_getchecksums(const char *chunk, struct checksumsarray *filekey
}
retvalue binaries_doreoverride(const struct distribution *distribution,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk) {
const struct overrideinfo *o;
const struct overridedata *o;
struct fieldtoadd *fields;
char *newchunk;
retvalue r;
......@@ -291,7 +291,7 @@ retvalue binaries_doreoverride(const struct distribution *distribution,const cha
}
retvalue ubinaries_doreoverride(const struct distribution *distribution,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk) {
const struct overrideinfo *o;
const struct overridedata *o;
struct fieldtoadd *fields;
char *newchunk;
......@@ -542,7 +542,7 @@ retvalue binaries_readdeb(struct deb_headers *deb, const char *filename, bool ne
}
/* do overwrites, add Filename and Checksums to the control-item */
retvalue binaries_complete(const struct deb_headers *pkg, const char *filekey, const struct checksums *checksums, const struct overrideinfo *override, const char *section, const char *priority, char **newcontrol) {
retvalue binaries_complete(const struct deb_headers *pkg, const char *filekey, const struct checksums *checksums, const struct overridedata *override, const char *section, const char *priority, char **newcontrol) {
struct fieldtoadd *replace;
char *newchunk;
enum checksumtype type;
......
......@@ -48,8 +48,8 @@ void binaries_debdone(struct deb_headers *);
retvalue binaries_calcfilekeys(component_t, const struct deb_headers *, packagetype_t, /*@out@*/struct strlist *);
struct overrideinfo;
retvalue binaries_complete(const struct deb_headers *, const char *filekey, const struct checksums *, const struct overrideinfo *, const char *section, const char *priority, char **newcontrol);
struct overridedata;
retvalue binaries_complete(const struct deb_headers *, const char *filekey, const struct checksums *, const struct overridedata *, const char *section, const char *priority, char **newcontrol);
retvalue binaries_adddeb(const struct deb_headers *, struct database *, const struct atomlist *forcedarchitectures, packagetype_t, struct distribution *, /*@null@*/struct trackingdata *, component_t, const struct strlist *filekeys, const char *control);
retvalue binaries_checkadddeb(const struct deb_headers *, struct database *, architecture_t forcearchitecture, packagetype_t, struct distribution *, bool tracking, component_t, bool permitnewerold);
......
......@@ -514,7 +514,7 @@ static retvalue changes_fixfields(const struct distribution *distribution, const
}
for( ; e != NULL ; e = e->next ) {
const struct overrideinfo *oinfo = NULL;
const struct overridedata *oinfo = NULL;
const char *force = NULL;
if( e->type == fe_BYHAND || e->type == fe_LOG ) {
......@@ -987,7 +987,7 @@ static retvalue changes_check_sourcefile(struct changes *changes, struct fileent
static retvalue dsc_prepare(struct changes *changes, struct fileentry *dsc, struct database *database, struct distribution *distribution, const char *dscfilename){
retvalue r;
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
char *dscbasename;
char *control;
int i;
......
......@@ -98,10 +98,10 @@ static retvalue deb_read(/*@out@*/struct debpackage **pkg, const char *filename,
return RET_OK;
}
static retvalue deb_preparelocation(struct debpackage *pkg, component_t forcecomponent, const struct atomlist *forcearchitectures, const char *forcesection, const char *forcepriority, packagetype_t packagetype, struct distribution *distribution, const struct overrideinfo **oinfo_ptr, const char *debfilename){
static retvalue deb_preparelocation(struct debpackage *pkg, component_t forcecomponent, const struct atomlist *forcearchitectures, const char *forcesection, const char *forcepriority, packagetype_t packagetype, struct distribution *distribution, const struct overridedata **oinfo_ptr, const char *debfilename){
const struct atomlist *components;
const struct overrideinfo *binoverride;
const struct overrideinfo *oinfo;
const struct overridefile *binoverride;
const struct overridedata *oinfo;
retvalue r;
if( packagetype == pt_udeb ) {
......@@ -204,7 +204,7 @@ static retvalue deb_preparelocation(struct debpackage *pkg, component_t forcecom
retvalue deb_prepare(/*@out@*/struct debpackage **deb, component_t forcecomponent, architecture_t forcearchitecture, const char *forcesection, const char *forcepriority, packagetype_t packagetype, struct distribution *distribution, const char *debfilename, const char * const givenfilekey, const struct checksums * checksums, const struct strlist *allowed_binaries, const char *expectedsourcepackage, const char *expectedsourceversion){
retvalue r;
struct debpackage *pkg;
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
char *control;
struct atomlist forcearchitectures;
......@@ -290,7 +290,7 @@ retvalue deb_add(struct database *database, component_t forcecomponent, const st
struct debpackage *pkg;
retvalue r;
struct trackingdata trackingdata;
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
char *control;
struct checksums *checksums;
......
......@@ -164,7 +164,7 @@ retvalue dsc_add(struct database *database, component_t forcecomponent, const ch
struct dscpackage *pkg;
struct trackingdata trackingdata;
char *destdirectory, *origdirectory;
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
char *control;
int i;
......
......@@ -22,7 +22,7 @@ struct distribution;
#ifndef REPREPRO_CONTENTS_H
#include "contents.h"
#endif
struct overrideinfo;
struct overridefile;
struct uploaders;
struct distribution {
......@@ -50,7 +50,7 @@ struct distribution {
/*@null@*/char *fakecomponentprefix;
/* only loaded when you've done it yourself: */
struct {
/*@null@*/struct overrideinfo *dsc,*deb,*udeb;
/*@null@*/struct overridefile *dsc, *deb, *udeb;
} overrides;
/* the list of components containing a debian-installer dir, normally only "main" */
struct atomlist udebcomponents;
......
......@@ -921,7 +921,7 @@ static retvalue candidate_usefile(const struct incoming *i,const struct candidat
return RET_OK;
}
static inline retvalue getsectionprioritycomponent(const struct incoming *i, const struct candidate *c, const struct distribution *into, const struct candidate_file *file, const char *name, const struct overrideinfo *oinfo, /*@out@*/const char **section_p, /*@out@*/const char **priority_p, /*@out@*/component_t *component) {
static inline retvalue getsectionprioritycomponent(const struct incoming *i, const struct candidate *c, const struct distribution *into, const struct candidate_file *file, const char *name, const struct overridedata *oinfo, /*@out@*/const char **section_p, /*@out@*/const char **priority_p, /*@out@*/component_t *component) {
retvalue r;
const char *section, *priority;
......@@ -1116,7 +1116,7 @@ static retvalue candidate_preparechangesfile(struct database *database,const str
static retvalue prepare_deb(struct database *database,const struct incoming *i,const struct candidate *c,struct candidate_perdistribution *per,const struct candidate_file *file) {
const char *section IFSTUPIDCC(=NULL), *priority IFSTUPIDCC(=NULL), *filekey;
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
struct candidate_package *package;
const struct distribution *into = per->into;
retvalue r;
......@@ -1249,7 +1249,7 @@ static retvalue prepare_source_file(struct database *database, const struct inco
static retvalue prepare_dsc(struct database *database,const struct incoming *i,const struct candidate *c,struct candidate_perdistribution *per,const struct candidate_file *file) {
const char *section IFSTUPIDCC(=NULL), *priority IFSTUPIDCC(=NULL);
const struct overrideinfo *oinfo;
const struct overridedata *oinfo;
struct candidate_package *package;
const struct distribution *into = per->into;
retvalue r;
......
This diff is collapsed.
......@@ -12,24 +12,24 @@
#include "chunks.h"
#endif
struct overrideinfo;
struct overridefile;
struct overridedata;
/* to avoid typos */
#define PRIORITY_FIELDNAME "Priority"
#define SECTION_FIELDNAME "Section"
void override_free(/*@only@*//*@null@*/struct overrideinfo *info);
retvalue override_read(const char *filename, /*@out@*/struct overrideinfo **info, bool source);
/*@null@*//*@dependent@*/const struct overrideinfo *override_search(/*@null@*/const struct overrideinfo *overrides,const char *package);
/*@null@*//*@dependent@*/const char *override_get(/*@null@*/const struct overrideinfo *override,const char *field);
void override_free(/*@only@*//*@null@*/struct overridefile *);
retvalue override_read(const char *filename, /*@out@*/struct overridefile **, bool /*source*/);
/*@null@*//*@dependent@*/const struct overridedata *override_search(/*@null@*/const struct overridefile *, const char * /*package*/);
/*@null@*//*@dependent@*/const char *override_get(/*@null@*/const struct overridedata *, const char * /*field*/);
/* add new fields to otherreplaces, but not "Section", or "Priority".
* incorporates otherreplaces, or frees them on error */
/*@null@*/struct fieldtoadd *override_addreplacefields(const struct overrideinfo *override, /*@only@*/struct fieldtoadd *otherreplaces);
/*@null@*/struct fieldtoadd *override_addreplacefields(const struct overridedata *, /*@only@*/struct fieldtoadd *);
/* as above, but all fields. and may return NULL if there are no overrides */
retvalue override_allreplacefields(const struct overrideinfo *, /*@out@*/struct fieldtoadd **);
retvalue override_allreplacefields(const struct overridedata *, /*@out@*/struct fieldtoadd **);
#endif
......@@ -323,7 +323,7 @@ retvalue sources_getchecksums(const char *chunk, struct checksumsarray *out) {
}
retvalue sources_doreoverride(const struct distribution *distribution,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk) {
const struct overrideinfo *o;
const struct overridedata *o;
struct fieldtoadd *fields;
char *newchunk;
retvalue r;
......@@ -545,7 +545,7 @@ void sources_done(struct dsc_headers *dsc) {
free(dsc->priority);
}
retvalue sources_complete(const struct dsc_headers *dsc, const char *directory, const struct overrideinfo *override, const char *section, const char *priority, char **newcontrol) {
retvalue sources_complete(const struct dsc_headers *dsc, const char *directory, const struct overridedata *override, const char *section, const char *priority, char **newcontrol) {
retvalue r;
struct fieldtoadd *name;
struct fieldtoadd *replace;
......
......@@ -40,8 +40,8 @@ retvalue sources_readdsc(struct dsc_headers *, const char *filename, const char
void sources_done(struct dsc_headers *);
struct overrideinfo;
retvalue sources_complete(const struct dsc_headers *, const char *directory, const struct overrideinfo *override, const char *section, const char *priority, char **newcontrol);
struct overridedata;
retvalue sources_complete(const struct dsc_headers *, const char *directory, const struct overridedata *override, const char *section, const char *priority, char **newcontrol);
char *calc_source_basename(const char *name, const char *version);
char *calc_sourcedir(component_t, const char *sourcename);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment