Commit 1dee1555 authored by Bernhard Link's avatar Bernhard Link

Better deal with multiple targets needing the same file when updating, some...

Better deal with multiple targets needing the same file when updating, some starts of Flat: update support
parent e0df4f8a
......@@ -257,13 +257,6 @@ retvalue binaries_getchecksums(const char *chunk, struct checksumsarray *filekey
return RET_OK;
}
char *binaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture) {
return mprintf("dists/%s/%s/binary-%s/Packages.gz",suite_from,component_from,architecture);
}
char *ubinaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture) {
return mprintf("dists/%s/%s/debian-installer/binary-%s/Packages.gz",suite_from,component_from,architecture);
}
retvalue binaries_doreoverride(const struct distribution *distribution,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk) {
const struct overrideinfo *o;
struct fieldtoadd *fields;
......
......@@ -19,8 +19,9 @@ 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_getfilekeys(const char *chunk, /*@out@*/struct strlist *);
retvalue binaries_getchecksums(const char *chunk, /*@out@*/struct checksumsarray *);
char *binaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture);
char *ubinaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture);
char *binaries_getflatupstreamindex(const char *suite_from, const char **);
char *binaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture, const char **);
char *ubinaries_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture, const char **);
retvalue binaries_doreoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
retvalue ubinaries_doreoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
retvalue binaries_retrack(const char *packagename, const char *chunk, trackingdb tracks, struct database *);
......
......@@ -176,6 +176,7 @@ static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), UN
#define CFstartparseVAR(sname,r) struct sname **r = (void*)result_p_ ## sname
#define CFfinishparse(sname) static retvalue finishparse ## sname(void *privdata_ ## sname, void *thisdata_ ## sname, void **lastdata_p_ ##sname, bool complete, struct configiterator *iter)
#define CFfinishparseVARS(sname,this,last,mydata) struct sname *this = thisdata_ ## sname, **last = (void*)lastdata_p_ ## sname; struct read_ ## sname ## _data *mydata = privdata_ ## sname
#define CFUfinishparseVARS(sname,this,last,mydata) struct sname *this = thisdata_ ## sname
#define CFhashesSETPROC(sname, field) \
static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), const char *name, void *data, struct configiterator *iter) { \
struct sname *item = data; \
......
......@@ -320,10 +320,6 @@ retvalue sources_getchecksums(const char *chunk, struct checksumsarray *out) {
return RET_OK;
}
char *sources_getupstreamindex(const char *suite_from, const char *component_from, UNUSED(const char *architecture)) {
return mprintf("dists/%s/%s/source/Sources.gz",suite_from,component_from);
}
retvalue sources_doreoverride(const struct distribution *distribution,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk) {
const struct overrideinfo *o;
struct fieldtoadd *fields;
......
......@@ -18,7 +18,8 @@ retvalue sources_getversion(const char *chunk, /*@out@*/char **version);
retvalue sources_getinstalldata(const struct target *t, const char *packagename, const char *version, const char *chunk, char **control, /*@out@*/struct strlist *filekeys, /*@out@*/struct checksumsarray *origfiles, /*@null@*//*@out@*/enum filetype *);
retvalue sources_getfilekeys(const char *, /*@out@*/struct strlist *);
retvalue sources_getchecksums(const char *, /*@out@*/struct checksumsarray *);
char *sources_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture);
char *sources_getflatupstreamindex(const char *suite_from, const char **);
char *sources_getupstreamindex(const char *suite_from, const char *component_from, const char *architecture, const char **);
retvalue sources_doreoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
retvalue sources_retrack(const char *packagename, const char *chunk, trackingdb tracks, struct database *);
retvalue sources_getsourceandversion(const char *chunk, const char *packagename, char **source, char **version);
......
......@@ -45,7 +45,7 @@
extern int verbose;
static retvalue target_initialize(const char *codename, const char *component, const char *architecture, /*@observer@*/const char *packagetype, get_name getname, get_version getversion, get_installdata getinstalldata, get_filekeys getfilekeys, get_checksums getchecksums, get_upstreamindex getupstreamindex, get_sourceandversion getsourceandversion, do_reoverride doreoverride,do_retrack doretrack, /*@null@*//*@only@*/char *directory, /*@dependent@*/const struct exportmode *exportmode, /*@out@*/struct target **d) {
static retvalue target_initialize(const char *codename, const char *component, const char *architecture, /*@observer@*/const char *packagetype, get_name getname, get_version getversion, get_installdata getinstalldata, get_filekeys getfilekeys, get_checksums getchecksums, get_sourceandversion getsourceandversion, do_reoverride doreoverride,do_retrack doretrack, /*@null@*//*@only@*/char *directory, /*@dependent@*/const struct exportmode *exportmode, /*@out@*/struct target **d) {
struct target *t;
assert(exportmode != NULL);
......@@ -74,7 +74,6 @@ static retvalue target_initialize(const char *codename, const char *component, c
t->getinstalldata = getinstalldata;
t->getfilekeys = getfilekeys;
t->getchecksums = getchecksums;
t->getupstreamindex = getupstreamindex;
t->getsourceandversion = getsourceandversion;
t->doreoverride = doreoverride;
t->doretrack = doretrack;
......@@ -87,7 +86,6 @@ retvalue target_initialize_ubinary(const char *codename, const char *component,
binaries_getname, binaries_getversion,
binaries_getinstalldata,
binaries_getfilekeys, binaries_getchecksums,
ubinaries_getupstreamindex,
binaries_getsourceandversion,
ubinaries_doreoverride, binaries_retrack,
mprintf("%s/debian-installer/binary-%s",component,architecture),
......@@ -98,7 +96,6 @@ retvalue target_initialize_binary(const char *codename, const char *component, c
binaries_getname, binaries_getversion,
binaries_getinstalldata,
binaries_getfilekeys, binaries_getchecksums,
binaries_getupstreamindex,
binaries_getsourceandversion,
binaries_doreoverride, binaries_retrack,
mprintf("%s/binary-%s",component,architecture),
......@@ -110,7 +107,7 @@ retvalue target_initialize_source(const char *codename, const char *component,co
sources_getname, sources_getversion,
sources_getinstalldata,
sources_getfilekeys, sources_getchecksums,
sources_getupstreamindex, sources_getsourceandversion,
sources_getsourceandversion,
sources_doreoverride, sources_retrack,
mprintf("%s/source",component), exportmode, target);
}
......
......@@ -29,7 +29,6 @@ typedef retvalue get_installdata(const struct target *,const char *,const char *
/* md5sums may be NULL */
typedef retvalue get_filekeys(const char *, /*@out@*/struct strlist *);
typedef retvalue get_checksums(const char *, /*@out@*/struct checksumsarray *);
typedef char *get_upstreamindex(const char *suite_from, const char *component_from, const char *architecture);
typedef retvalue do_reoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
typedef retvalue do_retrack(const char *packagename, const char *controlchunk, trackingdb, struct database *);
typedef retvalue get_sourceandversion(const char *chunk, const char *packagename, /*@out@*/char **source, /*@out@*/char **version);
......@@ -51,7 +50,6 @@ struct target {
get_installdata *getinstalldata;
get_filekeys *getfilekeys;
get_checksums *getchecksums;
get_upstreamindex *getupstreamindex;
get_sourceandversion *getsourceandversion;
do_reoverride *doreoverride;
do_retrack *doretrack;
......
......@@ -2,6 +2,8 @@
set -e
export LC_ALL=C
testrun() {
rules=$1
shift
......
......@@ -4,6 +4,7 @@ set -e
source $(dirname $0)/test.inc
runtest flat
runtest subcomponents
runtest various1
......
This diff is collapsed.
This diff is collapsed.
......@@ -310,7 +310,7 @@ static retvalue upgradelist_trypackage(void *data,const char *chunk){
&new->new_origfiles, &new->new_filetype);
if( RET_WAS_ERROR(r) ) {
package_data_free(new);
return RET_ERROR_OOM;
return r;
}
if( insertafter != NULL ) {
new->next = insertafter->next;
......
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