Commit 3702e5da authored by Bernhard Link's avatar Bernhard Link

atomize architecture, component and packagetype fields (at least in most places)

parent 23357fd0
2008-10-05
* Internaly atomize components architectures and packagetypes.
Causes multiple checks for unknown identifiers to be earlier or
more strict. (And fields in conf/distributions have more
restrictions w.r.t their order).
2008-10-01
* warn if an update rule references local components or architectures
that were not seen in conf/distributions (old behaviour was to check
......
......@@ -13,7 +13,8 @@ TODO:
(or alternatively allow ! in inclusion lists).
half far goals:
handle components, architectures and types as numeric atoms for filters
use numeric atoms for components, architectures and types in more
places (especially in filters)
rewrite error handling, caching error messages and handling Ctrl-C better.
far goals:
......
......@@ -26,22 +26,47 @@
const char **atoms_architectures;
const char **atoms_components;
const char * const packagetypes[3] = { "dsc", "deb", "udeb" };
const char **atoms_packagetype = (const char **)&packagetypes;
const char * const packagetypes[4] = { "!!NONE!!", "dsc", "deb", "udeb" };
const char **atoms_packagetypes = (const char **)&packagetypes;
const char **atoms_commands;
static int command_count;
static const char * const types[4] = {"architecture", "component", "packagetype", "command"};
const char **atomtypes = (const char **)types;
/* trivial implementation for now, perhaps make it more complicated later */
static struct strlist architectures, components;
retvalue atoms_init(void) {
retvalue atoms_init(int count) {
retvalue r;
strlist_init(&architectures);
strlist_init(&components);
/* add a 0th entry to all, so 0 means uninitialized */
r = strlist_add_dup(&architectures, "!!NONE!!");
if( RET_WAS_ERROR(r) )
return r;
r = strlist_add_dup(&architectures, "source");
if( RET_WAS_ERROR(r) )
return r;
r = strlist_add_dup(&architectures, "all");
if( RET_WAS_ERROR(r) )
return r;
r = strlist_add_dup(&components, "!!NONE!!");
if( RET_WAS_ERROR(r) )
return r;
/* a fallback component to put things without a component in */
r = strlist_add_dup(&components, "strange");
if( RET_WAS_ERROR(r) )
return r;
atoms_components = (const char**)components.values;
atoms_architectures = (const char**)architectures.values;
command_count = count;
if( command_count > 0 ) {
atoms_commands = calloc(command_count + 1, sizeof(const char*));
if( FAILEDTOALLOC(atoms_commands) )
return RET_ERROR_OOM;
}
return RET_OK;
}
......@@ -83,18 +108,213 @@ retvalue component_intern(const char *value, component_t *atom_p) {
}
architecture_t architecture_find(const char *value) {
return (architecture_t)strlist_ofs(&architectures, value);
int i = strlist_ofs(&architectures, value);
if( i < 0 )
return atom_unknown;
else
return (architecture_t)i;
}
architecture_t architecture_find_l(const char *value, size_t l) {
architecture_t a;
for( a = architectures.count - 1 ; a > 0 ; a-- ) {
const char *name = atoms_architectures[a];
size_t len = strlen(name);
if( len == l && memcmp(name, value, len) == 0 )
return a;
}
return atom_unknown;
}
component_t component_find(const char *value) {
return (component_t)strlist_ofs(&components, value);
int i = strlist_ofs(&components, value);
if( i < 0 )
return atom_unknown;
else
return (architecture_t)i;
}
packagetype_t packagetype_find(const char *value) {
if( strcmp(value, "dsc") == 0 )
return (packagetype_t)0;
return pt_dsc;
else if( strcmp(value, "deb") == 0 )
return (packagetype_t)1;
return pt_deb;
else if( strcmp(value, "udeb") == 0 )
return (packagetype_t)2;
return pt_udeb;
else
return atom_unknown;
}
static inline command_t command_find(const char *value) {
command_t c;
for( c = command_count ; c > 0 ; c-- ) {
if( strcmp(atoms_commands[c], value) == 0 )
return c;
}
return atom_unknown;
}
atom_t atom_find(enum atom_type type, const char *value) {
switch( type ) {
case at_packagetype:
return packagetype_find(value);
case at_architecture:
return architecture_find(value);
case at_component:
return component_find(value);
case at_command:
return command_find(value);
default:
return atom_unknown;
}
}
retvalue atom_intern(enum atom_type type, const char *value, atom_t *atom_p) {
assert( type == at_architecture || type == at_component );
switch( type ) {
case at_architecture:
return architecture_intern(value, atom_p);
case at_component:
return component_intern(value, atom_p);
default:
return RET_ERROR;
}
}
void atomlist_init(struct atomlist *list) {
list->count = 0; list->size = 0;
list->atoms = 0;
}
void atomlist_done(struct atomlist *list) {
if( list->size > 0 ) {
assert( list->atoms != 0 );
free(list->atoms);
}
/* reset atoms but not size, so reuse can be catched */
list->atoms = NULL;
}
/* add a atom uniquely (perhaps sorted), RET_NOTHING when already there */
retvalue atomlist_add_uniq(struct atomlist *list, atom_t atom) {
int i;
atom_t *n;
assert( atom_defined(atom) );
for( i = 0 ; i < list->count ; i++ ) {
if( list->atoms[i] == atom )
return RET_NOTHING;
}
if( list->size <= list->count ) {
n = realloc(list->atoms, (sizeof(atom_t))*(list->count + 8) );
if( FAILEDTOALLOC(n) )
return RET_ERROR_OOM;
list->size = list->count + 8;
list->atoms = n;
}
list->atoms[list->count++] = atom;
return RET_OK;
}
retvalue atomlist_add(struct atomlist *list, atom_t atom) {
atom_t *n;
assert( atom_defined(atom) );
if( list->size <= list->count ) {
n = realloc(list->atoms, (sizeof(atom_t))*(list->count + 8) );
if( FAILEDTOALLOC(n) )
return RET_ERROR_OOM;
list->size = list->count + 8;
list->atoms = n;
}
list->atoms[list->count++] = atom;
return RET_OK;
}
/* replace the contents of dest with those from orig, which get emptied */
void atomlist_move(struct atomlist *dest, struct atomlist *orig) {
dest->atoms = orig->atoms;
dest->count = orig->count;
dest->size = orig->size;
/* reset atoms but not size, so reuse can be catched */
orig->atoms = NULL;
}
bool atomlist_in(const struct atomlist *list, atom_t atom) {
int i;
for( i = 0 ; i < list->count ; i++ ) {
if( list->atoms[i] == atom )
return true;
}
return false;
}
int atomlist_ofs(const struct atomlist *list, atom_t atom) {
int i;
for( i = 0 ; i < list->count ; i++ ) {
if( list->atoms[i] == atom )
return i;
}
return -1;
}
bool atomlist_subset(const struct atomlist *list, const struct atomlist *subset, atom_t *missing) {
int i, j;
for( j = 0 ; j < subset->count ; j++ ) {
atom_t atom = subset->atoms[j];
for( i = 0 ; i < list->count ; i++ ) {
if( list->atoms[i] == atom )
break;
}
if( i >= list->count ) {
if( missing != NULL )
*missing = atom;
return false;
}
}
return true;
}
retvalue atomlist_fprint(FILE *file, enum atom_type type, const struct atomlist *list) {
const char **atoms = NULL;
int c;
atom_t *p;
retvalue result;
assert(list != NULL);
assert(file != NULL);
switch( type ) {
case at_architecture:
atoms = atoms_architectures;
break;
case at_component:
atoms = atoms_components;
break;
case at_packagetype:
atoms = atoms_packagetypes;
break;
case at_command:
atoms = atoms_commands;
break;
}
assert(atoms != NULL);
c = list->count;
p = list->atoms;
result = RET_OK;
while( c > 0 ) {
if( fputs(atoms[*(p++)], file) == EOF )
result = RET_ERROR;
if( --c > 0 && fputc(' ', file) == EOF )
result = RET_ERROR;
}
return result;
}
......@@ -5,18 +5,64 @@ typedef int atom_t;
typedef atom_t architecture_t;
typedef atom_t component_t;
typedef atom_t packagetype_t;
typedef atom_t command_t;
#define atom_unknown ((atom_t)-1)
#define architecture_all ((atom_t)0)
enum atom_type { at_architecture, at_component, at_packagetype, at_command };
extern const char **atoms_architectures, **atoms_components, **atoms_packagetype;
#define atom_unknown ((atom_t)0)
retvalue atoms_init(void);
#define architecture_source ((architecture_t)1)
#define architecture_all ((architecture_t)2)
#define component_strange ((component_t)1)
#define pt_dsc ((packagetype_t)1)
#define pt_deb ((packagetype_t)2)
#define pt_udeb ((packagetype_t)3)
#define atom_defined(a) ((a) > (atom_t)0)
extern const char **atomtypes, **atoms_architectures, **atoms_components, **atoms_packagetypes, **atoms_commands;
retvalue atoms_init(int command_count);
retvalue architecture_intern(const char *, /*@out@*/architecture_t *);
architecture_t architecture_find(const char *);
architecture_t architecture_find_l(const char *, size_t);
retvalue component_intern(const char *, /*@out@*/component_t *);
component_t component_find(const char *);
packagetype_t packagetype_find(const char *);
atom_t atom_find(enum atom_type, const char *);
retvalue atom_intern(enum atom_type, const char *, /*@out@*/atom_t *);
#define limitation_missed(a, b) ((atom_defined(a) && (a) != (b) ))
struct atomlist {
atom_t *atoms;
int count, size;
};
void atomlist_init(/*@out@*/struct atomlist *);
void atomlist_done(/*@special@*/struct atomlist *atomlist) /*@releases atomlist->values @*/;
/* add a atom uniquely (not sorted, component guessing might not like it),
* RET_NOTHING when already there */
retvalue atomlist_add_uniq(struct atomlist *, atom_t);
/* always add to the end */
retvalue atomlist_add(struct atomlist *, atom_t);
/* replace the contents of dest with those from orig, which get emptied */
void atomlist_move(/*@out@*/struct atomlist *, /*@special@*/struct atomlist *orig) /*@releases orig->values @*/;
bool atomlist_in(const struct atomlist *, atom_t);
int atomlist_ofs(const struct atomlist *, atom_t);
/* if missing != NULL And subset no subset of atomlist, set *missing to the first missing one */
bool atomlist_subset(const struct atomlist *, const struct atomlist *subset, /*@null@*/atom_t *missing);
/* print a space separated list of elements */
retvalue atomlist_fprint(FILE *, enum atom_type, const struct atomlist *);
#endif
......@@ -29,6 +29,7 @@
#include "strlist.h"
#include "names.h"
#include "chunks.h"
#include "sources.h"
#include "binaries.h"
#include "names.h"
#include "dpkgversions.h"
......@@ -42,6 +43,19 @@ extern int verbose;
static const char * const deb_checksum_headers[cs_COUNT] = {
"MD5sum", "SHA1", "SHA256", "Size"};
static char *calc_binary_basename(const char *name, const char *version, architecture_t arch, packagetype_t packagetype) {
const char *v;
assert( name != NULL && version != NULL && atom_defined(arch) && atom_defined(packagetype) );
v = strchr(version, ':');
if( v != NULL )
v++;
else
v = version;
return mprintf("%s_%s_%s.%s", name, v, atoms_architectures[arch],
atoms_packagetypes[packagetype]);
}
/* get checksums out of a "Packages"-chunk. */
static retvalue binaries_parse_checksums(const char *chunk, /*@out@*/struct checksums **checksums_p) {
retvalue result, r;
......@@ -74,10 +88,32 @@ static retvalue binaries_parse_checksums(const char *chunk, /*@out@*/struct chec
return checksums_init(checksums_p, checksums);
}
retvalue binaries_getarchitecture(const char *chunk, architecture_t *architecture_p) {
char *parch;
retvalue r;
r = chunk_getvalue(chunk, "Architecture", &parch);
if( r == RET_NOTHING ) {
fprintf(stderr, "Internal Error: Missing Architecture: header in '%s'!\n",
chunk);
return RET_ERROR;
}
if( RET_WAS_ERROR(r) )
return r;
*architecture_p = architecture_find(parch);
free(parch);
if( !atom_defined(*architecture_p) ) {
fprintf(stderr, "Internal Error: Unexpected Architecture: header in '%s'!\n",
chunk);
return RET_ERROR;
}
return RET_OK;
}
/* get somefields out of a "Packages.gz"-chunk. returns RET_OK on success, RET_NOTHING if incomplete, error otherwise */
static retvalue binaries_parse_chunk(const char *chunk, const char *packagename, const char *packagetype, const char *version, /*@out@*/char **sourcename_p, /*@out@*/char **basename_p, /*@out@*/enum filetype *ft_p) {
static retvalue binaries_parse_chunk(const char *chunk, const char *packagename, packagetype_t packagetype_atom, architecture_t package_architecture, const char *version, /*@out@*/char **sourcename_p, /*@out@*/char **basename_p) {
retvalue r;
char *parch;
char *mysourcename,*mybasename;
assert(packagename!=NULL);
......@@ -93,27 +129,14 @@ static retvalue binaries_parse_chunk(const char *chunk, const char *packagename,
return r;
}
/* generate a base filename based on package,version and architecture */
r = chunk_getvalue(chunk,"Architecture",&parch);
if( !RET_IS_OK(r) ) {
free(mysourcename);
return r;
}
if( strcmp(parch, "all") == 0 )
*ft_p = ft_ALL_BINARY;
else
*ft_p = ft_ARCH_BINARY;
r = properpackagename(packagename);
if( !RET_WAS_ERROR(r) )
r = properversion(version);
if( !RET_WAS_ERROR(r) )
r = properfilenamepart(parch);
if( RET_WAS_ERROR(r) ) {
free(parch);
return r;
}
mybasename = calc_binary_basename(packagename,version,parch,packagetype);
free(parch);
mybasename = calc_binary_basename(packagename, version,
package_architecture, packagetype_atom);
if( mybasename == NULL ) {
free(mysourcename);
return RET_ERROR_OOM;
......@@ -143,7 +166,7 @@ retvalue binaries_getfilekeys(const char *chunk, struct strlist *files) {
return r;
}
static retvalue calcfilekeys(const char *component, const char *sourcename, const char *basefilename, struct strlist *filekeys) {
static retvalue calcfilekeys(component_t component_atom, const char *sourcename, const char *basefilename, struct strlist *filekeys) {
char *filekey;
retvalue r;
......@@ -151,17 +174,17 @@ static retvalue calcfilekeys(const char *component, const char *sourcename, cons
if( RET_WAS_ERROR(r) ) {
return r;
}
filekey = calc_filekey(component, sourcename, basefilename);
filekey = calc_filekey(component_atom, sourcename, basefilename);
if( filekey == NULL )
return RET_ERROR_OOM;
r = strlist_init_singleton(filekey,filekeys);
return r;
}
static inline retvalue calcnewcontrol(const char *chunk, const char *sourcename, const char *basefilename, const char *component, struct strlist *filekeys, char **newchunk) {
static inline retvalue calcnewcontrol(const char *chunk, const char *sourcename, const char *basefilename, component_t component_atom, struct strlist *filekeys, char **newchunk) {
retvalue r;
r = calcfilekeys(component, sourcename, basefilename, filekeys);
r = calcfilekeys(component_atom, sourcename, basefilename, filekeys);
if( RET_WAS_ERROR(r) )
return r;
......@@ -187,14 +210,14 @@ retvalue binaries_getversion(const char *control, char **version) {
return r;
}
retvalue binaries_getinstalldata(const struct target *t, const char *packagename, const char *version, const char *chunk, char **control, struct strlist *filekeys, struct checksumsarray *origfiles, /*@null@*//*@out@*/enum filetype *type_p) {
retvalue binaries_getinstalldata(const struct target *t, const char *packagename, const char *version, architecture_t package_architecture, const char *chunk, char **control, struct strlist *filekeys, struct checksumsarray *origfiles) {
char *sourcename IFSTUPIDCC(=NULL), *basefilename IFSTUPIDCC(=NULL);
struct checksumsarray origfilekeys;
retvalue r;
enum filetype ft IFSTUPIDCC(='?');
r = binaries_parse_chunk(chunk, packagename, t->packagetype,
version, &sourcename, &basefilename, &ft);
r = binaries_parse_chunk(chunk, packagename,
t->packagetype_atom, package_architecture,
version, &sourcename, &basefilename);
if( RET_WAS_ERROR(r) ) {
return r;
} else if( r == RET_NOTHING ) {
......@@ -208,15 +231,13 @@ retvalue binaries_getinstalldata(const struct target *t, const char *packagename
}
r = calcnewcontrol(chunk, sourcename, basefilename,
t->component, filekeys, control);
t->component_atom, filekeys, control);
if( RET_WAS_ERROR(r) ) {
checksumsarray_done(&origfilekeys);
} else {
assert( r != RET_NOTHING );
checksumsarray_move(origfiles, &origfilekeys);
}
if( type_p != NULL )
*type_p = ft;
free(sourcename); free(basefilename);
return r;
}
......@@ -448,7 +469,6 @@ static inline retvalue getvalue_n(const char *chunk,const char *field,char **val
void binaries_debdone(struct deb_headers *pkg) {
free(pkg->name);free(pkg->version);
free(pkg->source);free(pkg->sourceversion);
free(pkg->architecture);
free(pkg->control);
free(pkg->section);
free(pkg->priority);
......@@ -456,6 +476,7 @@ void binaries_debdone(struct deb_headers *pkg) {
retvalue binaries_readdeb(struct deb_headers *deb, const char *filename, bool needssourceversion) {
retvalue r;
char *architecture;
r = extractcontrol(&deb->control,filename);
if( RET_WAS_ERROR(r) )
......@@ -478,7 +499,16 @@ retvalue binaries_readdeb(struct deb_headers *deb, const char *filename, bool ne
r = getvalue(filename,deb->control,"Version",&deb->version);
if( RET_WAS_ERROR(r) )
return r;
r = getvalue(filename,deb->control,"Architecture",&deb->architecture);
r = getvalue(filename, deb->control, "Architecture", &architecture);
if( RET_WAS_ERROR(r) )
return r;
r = properfilenamepart(architecture);
if( RET_WAS_ERROR(r) ) {
free(architecture);
return r;
}
r = architecture_intern(architecture, &deb->architecture_atom);
free(architecture);
if( RET_WAS_ERROR(r) )
return r;
/* can be there, otherwise we also know what it is */
......@@ -555,7 +585,7 @@ retvalue binaries_complete(const struct deb_headers *pkg, const char *filekey, c
return RET_OK;
}
retvalue binaries_adddeb(const struct deb_headers *deb, struct database *database, const char *forcearchitecture, const char *packagetype, struct distribution *distribution, struct strlist *dereferencedfilekeys, struct trackingdata *trackingdata, const char *component, const struct strlist *filekeys, bool *usedmarker, const char *control) {
retvalue binaries_adddeb(const struct deb_headers *deb, struct database *database, architecture_t forcearchitecture, packagetype_t packagetype, struct distribution *distribution, struct strlist *dereferencedfilekeys, struct trackingdata *trackingdata, component_t component, const struct strlist *filekeys, bool *usedmarker, const char *control) {
retvalue r,result;
int i;
......@@ -565,9 +595,9 @@ retvalue binaries_adddeb(const struct deb_headers *deb, struct database *databas
result = RET_NOTHING;
if( strcmp(deb->architecture,"all") != 0 ) {
if( deb->architecture_atom != architecture_all ) {
struct target *t = distribution_getpart(distribution,
component, deb->architecture,
component, deb->architecture_atom,
packagetype);
r = target_initpackagesdb(t, database, READWRITE);
if( !RET_WAS_ERROR(r) ) {
......@@ -582,12 +612,13 @@ retvalue binaries_adddeb(const struct deb_headers *deb, struct database *databas
filekeys, usedmarker,
false,
dereferencedfilekeys,
trackingdata, ft_ARCH_BINARY);
trackingdata,
deb->architecture_atom);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r,r2);
}
RET_UPDATE(result,r);
} else if( forcearchitecture != NULL && strcmp(forcearchitecture,"all") != 0 ) {
} else if( atom_defined(forcearchitecture) && forcearchitecture != architecture_all ) {
struct target *t = distribution_getpart(distribution,
component, forcearchitecture,
packagetype);
......@@ -604,16 +635,20 @@ retvalue binaries_adddeb(const struct deb_headers *deb, struct database *databas
filekeys, usedmarker,
false,
dereferencedfilekeys,
trackingdata, ft_ALL_BINARY);
trackingdata,
deb->architecture_atom);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r,r2);
}
RET_UPDATE(result,r);
} else for( i = 0 ; i < distribution->architectures.count ; i++ ) {
/*@dependent@*/struct target *t;
if( strcmp(distribution->architectures.values[i],"source") == 0 )
architecture_t a = distribution->architectures.atoms[i];
if( a == architecture_source )
continue;
t = distribution_getpart(distribution,component,distribution->architectures.values[i],packagetype);
t = distribution_getpart(distribution,
component, a, packagetype);
r = target_initpackagesdb(t, database, READWRITE);
if( !RET_WAS_ERROR(r) ) {
retvalue r2;
......@@ -627,7 +662,8 @@ retvalue binaries_adddeb(const struct deb_headers *deb, struct database *databas
filekeys, usedmarker,
false,
dereferencedfilekeys,
trackingdata, ft_ALL_BINARY);
trackingdata,
deb->architecture_atom);
r2 = target_closepackagesdb(t);
RET_ENDUPDATE(r,r2);
}
......@@ -638,7 +674,7 @@ retvalue binaries_adddeb(const struct deb_headers *deb, struct database *databas
return result;
}
static inline retvalue checkadddeb(struct database *database, struct distribution *distribution, const char *component, const char *architecture, const char *packagetype, bool tracking, const struct deb_headers *deb, bool permitnewerold) {
static inline retvalue checkadddeb(struct database *database, struct distribution *distribution, component_t component, architecture_t architecture, packagetype_t packagetype, bool tracking, const struct deb_headers *deb, bool permitnewerold) {
retvalue r;
struct target *t;
......@@ -661,28 +697,28 @@ static inline retvalue checkadddeb(struct database *database, struct distributio
return r;
}
retvalue binaries_checkadddeb(const struct deb_headers *deb, struct database *database, const char *forcearchitecture, const char *packagetype, struct distribution *distribution, bool tracking, const char *component, bool permitnewerold) {
retvalue binaries_checkadddeb(const struct deb_headers *deb, struct database *database, architecture_t forcearchitecture, packagetype_t packagetype, struct distribution *distribution, bool tracking, component_t component, bool permitnewerold) {
retvalue r,result;
int i;
/* finally put it into one or more architectures of the distribution */
result = RET_NOTHING;
if( strcmp(deb->architecture,"all") != 0 ) {
if( deb->architecture_atom != architecture_all ) {
r = checkadddeb(database, distribution,
component, deb->architecture, packagetype,
component, deb->architecture_atom, packagetype,
tracking, deb,
permitnewerold);
RET_UPDATE(result,r);
} else if( forcearchitecture != NULL && strcmp(forcearchitecture,"all") != 0 ) {
} else if( atom_defined(forcearchitecture) && forcearchitecture != architecture_all ) {
r = checkadddeb(database, distribution,
component, forcearchitecture, packagetype,
tracking, deb,
permitnewerold);
RET_UPDATE(result,r);
} else for( i = 0 ; i < distribution->architectures.count ; i++ ) {
const char *a = distribution->architectures.values[i];
if( strcmp(a, "source") == 0 )
architecture_t a = distribution->architectures.atoms[i];
if( a == architecture_source )
continue;
r = checkadddeb(database, distribution,
component, a, packagetype,
......@@ -693,12 +729,12 @@ retvalue binaries_checkadddeb(const struct deb_headers *deb, struct database *da
return result;
}
retvalue binaries_calcfilekeys(const char *component,const struct deb_headers *deb,const char *packagetype,struct strlist *filekeys) {
retvalue binaries_calcfilekeys(component_t component, const struct deb_headers *deb, packagetype_t packagetype, struct strlist *filekeys) {
retvalue r;
char *basefilename;
basefilename = calc_binary_basename(deb->name, deb->version,
deb->architecture, packagetype);
deb->architecture_atom, packagetype);
if( FAILEDTOALLOC(basefilename) )
return RET_ERROR_OOM;
......
......@@ -15,7 +15,8 @@
/* Functions for the target.h-stuff: */
retvalue binaries_getversion(const char *chunk,char **version);
retvalue binaries_getinstalldata(const struct target *t, const char *packagename, const char *version, const char *chunk, /*@out@*/char **control, /*@out@*/struct strlist *filekeys, /*@out@*/struct checksumsarray *origfiles, /*@null@*//*@out@*/enum filetype *);
retvalue binaries_getinstalldata(const struct target *t, const char *packagename, const char *version, architecture_t, const char *chunk, /*@out@*/char **control, /*@out@*/struct strlist *filekeys, /*@out@*/struct checksumsarray *origfiles);
retvalue binaries_getarchitecture(const char *chunk, /*@out@*/architecture_t *);
retvalue binaries_getfilekeys(const char *chunk, /*@out@*/struct strlist *);
retvalue binaries_getchecksums(const char *chunk, /*@out@*/struct checksumsarray *);
retvalue binaries_doreoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
......@@ -27,7 +28,8 @@ retvalue binaries_getsourceandversion(const char *chunk, const char *packagename
struct deb_headers {
char *name,*version;
char *source,*architecture;
char *source;
architecture_t architecture_atom;
char *control;
/* only extracted when requested: */
/*@null@*/char *sourceversion;
......@@ -44,11 +46,11 @@ struct deb_headers {
retvalue binaries_readdeb(struct deb_headers *, const char *filename, bool needssourceversion);
void binaries_debdone(struct deb_headers *);
retvalue binaries_calcfilekeys(const char *component,const struct deb_headers *,const char *packagetype,struct strlist *filekeys);
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);
retvalue binaries_adddeb(const struct deb_headers *, struct database *, /*@null@*/const char *forcearchitecture, const char *packagetype, struct distribution *, /*@null@*/struct strlist *dereferencedfilekeys, /*@null@*/struct trackingdata *, const char *component, const struct strlist *filekeys, bool *usedmarker, const char *control);
retvalue binaries_checkadddeb(const struct deb_headers *, struct database *, const char *forcearchitecture, const char *packagetype, struct distribution *, bool tracking, const char *component, bool permitnewerold);