Commit 977b53b9 authored by Bernhard Link's avatar Bernhard Link

replaced downloadlist with downloachcache

parent 9996c074
......@@ -3,8 +3,8 @@ bin_PROGRAMS = mirrorer
CPPFLAGS = @CPPFLAGS@ -D_GNU_SOURCE=1 -DPKGDATADIR=\"$(pkgdatadir)\" -Wall
mirrorer_SOURCES = main.c guesscomponent.c files.c md5.c md5sum.c dirs.c chunks.c reference.c packages.c binaries.c sources.c names.c dpkgversions.c release.c mprintf.c updates.c strlist.c signature.c distribution.c extractcontrol.c checkindeb.c checkindsc.c checkin.c copyfile.c strtupel.c upgradelist.c target.c aptmethod.c downloadlist.c
mirrorer_SOURCES = main.c guesscomponent.c files.c md5.c md5sum.c dirs.c chunks.c reference.c packages.c binaries.c sources.c names.c dpkgversions.c release.c mprintf.c updates.c strlist.c signature.c distribution.c extractcontrol.c checkindeb.c checkindsc.c checkin.c copyfile.c strtupel.c upgradelist.c target.c aptmethod.c downloadcache.c
mirrorer_LDFLAGS += -ldb3
noinst_HEADERS = guesscomponent.h md5.h md5sum.h dirs.h files.h chunks.h reference.h packages.h binaries.h sources.h names.h release.h error.h mprintf.h updates.h strlist.h signature.h distribution.h extractcontrol.h checkindeb.h checkindsc.h copyfile.h strtupel.h upgradelist.h target.h aptmethod.h downloadlist.h
noinst_HEADERS = guesscomponent.h md5.h md5sum.h dirs.h files.h chunks.h reference.h packages.h binaries.h sources.h names.h release.h error.h mprintf.h updates.h strlist.h signature.h distribution.h extractcontrol.h checkindeb.h checkindsc.h copyfile.h strtupel.h upgradelist.h target.h aptmethod.h downloadcache.h
MAINTAINERCLEANFILES = Makefile.in configure install-sh stamp-h.in aclocal.m4 config.h.in mkinstalldirs
......@@ -38,16 +38,6 @@
extern int verbose;
struct tobedone {
struct tobedone *next;
/* must be saved to know where is should be moved to: */
char *uri;
char *filename;
/* if non-NULL, what is expected...*/
char *md5sum;
/* if non-NULL, add to the database after found (only if md5sum != NULL) */
char *filekey;
};
struct aptmethod {
struct aptmethod *next;
......@@ -358,7 +348,7 @@ static inline struct tobedone *newtodo(const char *baseuri,const char *origfile,
return todo;
}
retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const char *destfile,const char *md5sum,const char *filekey) {
retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const char *destfile,const char *md5sum,const char *filekey,struct tobedone **t) {
struct tobedone *todo;
todo = newtodo(method->baseuri,origfile,destfile,md5sum,filekey);
......@@ -372,6 +362,8 @@ retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const
method->lasttobedone->next = todo;
method->lasttobedone = todo;
}
if( t )
*t = todo;
return RET_OK;
}
......
......@@ -8,10 +8,22 @@
struct aptmethodrun;
struct aptmethod;
struct tobedone {
struct tobedone *next;
/* must be saved to know where is should be moved to: */
char *uri;
char *filename;
/* if non-NULL, what is expected...*/
char *md5sum;
/* if non-NULL, add to the database after found (only if md5sum != NULL) */
char *filekey;
};
retvalue aptmethod_initialize_run(struct aptmethodrun **run);
retvalue aptmethod_newmethod(struct aptmethodrun *run,const char *uri,const char *config,struct aptmethod **m);
/* md5sum can be NULL: */
retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const char *destfile,const char *md5sum,const char *filekey);
/* md5sum can be NULL(filekey then, too): if todo != NULL, then *todo will be set */
retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const char *destfile,const char *md5sum,const char *filekey,struct tobedone **todo);
retvalue aptmethod_download(struct aptmethodrun *run,const char *methoddir,filesdb filesdb);
retvalue aptmethod_shutdown(struct aptmethodrun *run);
......
......@@ -25,159 +25,52 @@
#include "names.h"
#include "dirs.h"
#include "files.h"
#include "aptmethod.h"
#include "downloadlist.h"
#include "downloadcache.h"
struct downloaditem {
struct download_upstream *upstream;
struct downloaditem *nextinupstream;
// todo: what is best, some tree, balanced tree, linear?
struct downloaditem *next,*prev;
char *filekey;
char *origfile;
char *md5sum;
struct tobedone *todo;
};
struct download_upstream {
struct downloadlist *list;
struct download_upstream *next;
char *method;
char *config;
struct downloaditem *items;
};
struct downloadlist {
struct download_upstream *upstreams;
filesdb filesdb;
struct downloadcache {
struct downloaditem *items;
};
filesdb downloadlist_filesdb(struct downloadlist *list) {
return list->filesdb;
}
/* Initialize a new download session */
retvalue downloadlist_initialize(struct downloadlist **download,const char *dbdir,const char *pooldir) {
struct downloadlist *list;
retvalue r;
retvalue downloadcache_initialize(struct downloadcache **download) {
struct downloadcache *cache;
list = calloc(1,sizeof(struct downloadlist));
if( list == NULL )
cache = malloc(sizeof(struct downloadcache));
if( cache == NULL )
return RET_ERROR_OOM;
r = files_initialize(&list->filesdb,dbdir,pooldir);
if( RET_WAS_ERROR(r) ) {
free(list);
return r;
}
*download = list;
cache->items = NULL;
*download = cache;
return RET_OK;
}
/* free all memory, cancel all queued downloads */
retvalue downloadlist_free(struct downloadlist *list) {
struct download_upstream *upstream;
struct downloaditem *item;
retvalue r;
/* free all memory */
retvalue downloadcache_free(struct downloadcache *download) {
while( list->upstreams ) {
upstream = list->upstreams;
list->upstreams = upstream->next;
free(upstream->method);
free(upstream->config);
while( upstream->items ) {
item = upstream->items;
upstream->items = item->nextinupstream;
free(item->filekey);
free(item->origfile);
free(item->md5sum);
free(item);
}
free(upstream);
}
r = files_done(list->filesdb);
free(list);
return r;
}
/* try to fetch and register all queued files */
retvalue downloadlist_run(struct downloadlist *list,const char *methoddir) {
struct aptmethodrun *run;
struct download_upstream *upstream;
retvalue r;
r = aptmethod_initialize_run(&run);
if( RET_WAS_ERROR(r) )
return r;
for( upstream = list->upstreams ;upstream; upstream = upstream->next) {
struct aptmethod *method;
struct downloaditem *item;
r = aptmethod_newmethod(run,upstream->method,upstream->config,&method);
if( RET_WAS_ERROR(r) ) {
aptmethod_shutdown(run);
return r;
}
for( item=upstream->items;item;item=item->nextinupstream) {
char *fullfilename;
fullfilename = calc_dirconcat(list->filesdb->mirrordir,item->filekey);
if( fullfilename == NULL ) {
aptmethod_shutdown(run);
return r;
}
(void)dirs_make_parent(fullfilename);
r = aptmethod_queuefile(method,item->origfile,
fullfilename,item->md5sum,item->filekey);
free(fullfilename);
if( RET_WAS_ERROR(r) ) {
aptmethod_shutdown(run);
return r;
}
}
}
r = aptmethod_download(run,methoddir,list->filesdb);
aptmethod_shutdown(run);
return r;
}
retvalue downloadlist_newupstream(struct downloadlist *list,
const char *method,const char *config,struct download_upstream **upstream) {
struct download_upstream *u;
assert(list && method && upstream);
struct downloaditem *item;
u = calloc(1,sizeof(struct download_upstream));
if( u == NULL )
return RET_ERROR_OOM;
if( config != NULL ) {
u->config = strdup(config);
if( u->config == NULL ) {
free(u);
return RET_ERROR_OOM;
}
} else
u->config = NULL;
u->method = strdup(method);
if( u->method == NULL ) {
free(u->config);
free(u);
return RET_ERROR_OOM;
while( download->items ) {
item = download->items;
download->items = item->next;
free(item);
}
u->list = list;
u->next = list->upstreams;
list->upstreams = u;
*upstream = u;
free(download);
return RET_OK;
}
const struct downloaditem *searchforitem(const struct downloadlist *list,
const struct downloaditem *searchforitem(const struct downloadcache *list,
const char *filekey) {
const struct downloaditem *item;
//TODO: there is no doubt, so use better than brute force...
for( item=list->items ; item ; item = item->next ) {
if( strcmp(filekey,item->filekey) == 0 )
if( strcmp(filekey,item->todo->filekey) == 0 )
return item;
}
return NULL;
......@@ -186,19 +79,21 @@ const struct downloaditem *searchforitem(const struct downloadlist *list,
/* queue a new file to be downloaded:
* results in RET_ERROR_WRONG_MD5, if someone else already asked
* for the same destination with other md5sum created. */
retvalue downloadlist_add(struct download_upstream *upstream,const char *origfile,const char *filekey,const char *md5sum) {
retvalue downloadcache_add(struct downloadcache *cache,filesdb filesdb,struct aptmethod *method,const char *orig,const char *filekey,const char *md5sum) {
const struct downloaditem *i;
struct downloaditem *item;
char *fullfilename;
retvalue r;
assert(upstream);
r = files_check(upstream->list->filesdb,filekey,md5sum);
assert(filesdb && cache && method);
r = files_check(filesdb,filekey,md5sum);
if( r != RET_NOTHING )
return r;
i = searchforitem(upstream->list,filekey);
i = searchforitem(cache,filekey);
if( i != NULL ) {
if( strcmp(md5sum,i->md5sum) == 0 )
if( strcmp(md5sum,i->todo->md5sum) == 0 )
return RET_NOTHING;
// TODO: print error;
return RET_ERROR_WRONG_MD5;
......@@ -206,24 +101,30 @@ retvalue downloadlist_add(struct download_upstream *upstream,const char *origfil
item = malloc(sizeof(struct downloaditem));
if( item == NULL )
return RET_ERROR_OOM;
item->filekey = strdup(filekey);
item->origfile = strdup(origfile);
item->md5sum = strdup(md5sum);
if( !item->filekey || !item->origfile || !item->md5sum ) {
free(item->filekey);
free(item->origfile);
fullfilename = calc_dirconcat(filesdb->mirrordir,filekey);
if( fullfilename == NULL ) {
free(item);
return RET_ERROR_OOM;
}
item->upstream = upstream;
item->nextinupstream = upstream->items;
upstream->items = item;
item->next = upstream->list->items;
upstream->list->items = item;
(void)dirs_make_parent(fullfilename);
r = aptmethod_queuefile(method,orig,fullfilename,md5sum,filekey,&item->todo);
free(fullfilename);
if( RET_WAS_ERROR(r) ) {
free(item);
return r;
}
if( cache->items )
cache->items->prev = item;
item->next = cache->items;
cache->items = item;
return RET_OK;
}
retvalue downloadlist_addfiles(struct download_upstream *upstream,
/* some as above, only for more files... */
retvalue downloadcache_addfiles(struct downloadcache *cache,filesdb filesdb,
struct aptmethod *method,
const struct strlist *origfiles,
const struct strlist *filekeys,
const struct strlist *md5sums) {
......@@ -237,7 +138,7 @@ retvalue downloadlist_addfiles(struct download_upstream *upstream,
result = RET_NOTHING;
for( i = 0 ; i < filekeys->count ; i++ ) {
r = downloadlist_add(upstream,
r = downloadcache_add(cache,filesdb,method,
origfiles->values[i],
filekeys->values[i],
md5sums->values[i]);
......
......@@ -12,32 +12,29 @@
#ifndef __MIRRORER_FILES_H
#include "files.h"
#endif
#ifndef __MIRRORER_DOWNLOADCACHE_H
#include "downloadcache.h"
#endif
#ifndef __MIRRORER_APTMETHOD_H
#include "aptmethod.h"
#endif
struct download_upstream;
struct downloadlist;
struct downloadcache;
/* Initialize a new download session */
retvalue downloadlist_initialize(struct downloadlist **download,const char *dbdir,const char *pooldir);
filesdb downloadlist_filesdb(struct downloadlist *list);
/* free all memory, cancel all queued downloads */
retvalue downloadlist_free(struct downloadlist *downloadlist);
retvalue downloadcache_initialize(struct downloadcache **download);
/* try to fetch and register all queued files */
retvalue downloadlist_run(struct downloadlist *list,const char *methodir);
/* free all memory */
retvalue downloadcache_free(struct downloadcache *download);
/* add a new origin to download files from */
retvalue downloadlist_newupstream(struct downloadlist *list,
const char *method,const char *config,
struct download_upstream **upstream);
/* queue a new file to be downloaded:
* results in RET_ERROR_WRONG_MD5, if someone else already asked
* for the same destination with other md5sum created. */
retvalue downloadlist_add(struct download_upstream *upstream,const char *orig,const char *filekey,const char *md5sum);
retvalue downloadcache_add(struct downloadcache *cache,filesdb filesdb,struct aptmethod *method,const char *orig,const char *filekey,const char *md5sum);
/* some as above, only for more files... */
retvalue downloadlist_addfiles(struct download_upstream *upstream,
retvalue downloadcache_addfiles(struct downloadcache *cache,filesdb filesdb,
struct aptmethod *method,
const struct strlist *origfiles,
const struct strlist *filekeys,
const struct strlist *md5sums);
......
......@@ -46,6 +46,7 @@
#include "checkindeb.h"
#include "checkindsc.h"
#include "checkin.h"
#include "downloadcache.h"
#ifndef STD_BASE_DIR
......@@ -682,8 +683,9 @@ static int update(int argc,char *argv[]) {
struct update_upstream *patterns;
struct distribution *distributions,*d;
struct aptmethodrun *run;
struct downloadlist *download;
struct downloadcache *download;
struct target *t;
filesdb files;
if( argc < 1 ) {
fprintf(stderr,"mirrorer update [<distributions>]\n");
......@@ -724,13 +726,12 @@ static int update(int argc,char *argv[]) {
}
}
result = aptmethod_download(run,"/usr/lib/apt/methods",NULL);
r = aptmethod_shutdown(run);
RET_UPDATE(result,r);
if( RET_WAS_ERROR(result) )
if( RET_WAS_ERROR(result) ) {
r = aptmethod_shutdown(run);
return EXIT_RET(result);
}
for( d=distributions; d ; d = d->next ) {
r = updates_checklists(listdir,d->upstreams,force);
......@@ -740,16 +741,15 @@ static int update(int argc,char *argv[]) {
}
}
result = downloadlist_initialize(&download,dbdir,mirrordir);
result = downloadcache_initialize(&download);
if( RET_WAS_ERROR(result) )
return EXIT_RET(result);
result = files_initialize(&files,dbdir,mirrordir);
if( RET_WAS_ERROR(result) )
return EXIT_RET(result);
for( d=distributions; d ; d = d->next ) {
r = updates_setdownloadupstreams(d->upstreams,download);
RET_UPDATE(result,r);
if( RET_WAS_ERROR(r) )
continue;
for( t = d->targets; t ; t = t->next ) {
r = upgradelist_initialize(&t->upgradelist,
t,dbdir,ud_always);
......@@ -762,7 +762,7 @@ static int update(int argc,char *argv[]) {
t->upgradelist = NULL;
continue;
}
r = upgradelist_enqueue(t->upgradelist,force);
r = upgradelist_enqueue(t->upgradelist,download,files,force);
if( RET_WAS_ERROR(r) ) {
upgradelist_free(t->upgradelist);
t->upgradelist = NULL;
......@@ -770,7 +770,10 @@ static int update(int argc,char *argv[]) {
}
}
}
result = downloadlist_run(download,"/usr/lib/apt/methods");
downloadcache_free(download);
result = aptmethod_download(run,"/usr/lib/apt/methods",NULL);
r = aptmethod_shutdown(run);
RET_UPDATE(result,r);
refs = references_initialize(dbdir);
if( ! refs )
......@@ -780,8 +783,7 @@ static int update(int argc,char *argv[]) {
for( t = d->targets; t ; t = t->next ) {
if( t->upgradelist == NULL )
continue;
r = upgradelist_install(t->upgradelist,
downloadlist_filesdb(download),
r = upgradelist_install(t->upgradelist,files,
refs,force);
RET_UPDATE(result,r);
upgradelist_free(t->upgradelist);
......@@ -791,7 +793,8 @@ static int update(int argc,char *argv[]) {
r = distribution_export(d,dbdir,distdir,force,1);
RET_ENDUPDATE(result,r);
}
downloadlist_free(download);
r = files_done(files);
RET_ENDUPDATE(result,r);
while( distributions ) {
d = distributions->next;
......
......@@ -75,7 +75,7 @@ struct update_upstream {
// distribution to go into (NULL for pattern)
const struct distribution *distribution;
// is set for non-pattern when fetching packages..
struct download_upstream *download;
struct aptmethod *download;
};
void update_upstream_free(struct update_upstream *update) {
......@@ -483,7 +483,7 @@ retvalue updates_getupstreams(const struct update_upstream *patterns,struct dist
}
/******************* Fetch all Lists for an update **********************/
retvalue queuelists(struct aptmethodrun *run,const char *listdir,const struct update_upstream *upstream) {
retvalue queuelists(struct aptmethodrun *run,const char *listdir,struct update_upstream *upstream) {
char *toget,*saveas;
int i,j;
struct aptmethod *method;
......@@ -493,18 +493,19 @@ retvalue queuelists(struct aptmethodrun *run,const char *listdir,const struct up
if( RET_WAS_ERROR(r) ) {
return r;
}
upstream->download = method;
if( !upstream->ignorerelease ) {
toget = mprintf("dists/%s/Release",upstream->suite_from);
saveas = calc_downloadedlistfile(listdir,upstream->distribution->codename,upstream->name,"Release","data");
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL);
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL,NULL);
if( RET_WAS_ERROR(r) )
return r;
if( upstream->verifyrelease != NULL ) {
toget = mprintf("dists/%s/Release.gpg",upstream->suite_from);
saveas = calc_downloadedlistfile(listdir,upstream->distribution->codename,upstream->name,"Release","gpg");
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL);
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL,NULL);
if( RET_WAS_ERROR(r) )
return r;
}
......@@ -516,7 +517,7 @@ retvalue queuelists(struct aptmethodrun *run,const char *listdir,const struct up
toget = mprintf("dists/%s/%s/source/Sources.gz",upstream->suite_from,comp);
saveas = calc_downloadedlistfile(listdir,upstream->distribution->codename,upstream->name,comp,"source");
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL);
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL,NULL);
if( RET_WAS_ERROR(r) )
return r;
......@@ -525,7 +526,7 @@ retvalue queuelists(struct aptmethodrun *run,const char *listdir,const struct up
toget = mprintf("dists/%s/%s/binary-%s/Packages.gz",upstream->suite_from,comp,arch);
saveas = calc_downloadedlistfile(listdir,upstream->distribution->codename,upstream->name,comp,arch);
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL);
r = aptmethod_queuefile(method,toget,saveas,NULL,NULL,NULL);
if( RET_WAS_ERROR(r) )
return r;
}
......@@ -687,17 +688,3 @@ retvalue updates_readlistsfortarget(struct upgradelist *list,struct target *targ
}
return result;
}
retvalue updates_setdownloadupstreams(struct update_upstream *upstreams,struct downloadlist *download) {
retvalue result,r;
struct update_upstream *upstream;
result = RET_NOTHING;
for( upstream=upstreams ; upstream ; upstream=upstream->next ) {
r = downloadlist_newupstream(download,upstream->method,upstream->config,&upstream->download);
RET_UPDATE(result,r);
}
return result;
}
......@@ -23,6 +23,4 @@ retvalue updates_checklists(const char *listdir,const struct update_upstream *up
retvalue updates_readlistsfortarget(struct upgradelist *list,struct target *target,const char *listdir,const struct update_upstream *upstreams,int force);
struct downloadlist;
retvalue updates_setdownloadupstreams(struct update_upstream *upstreams,struct downloadlist *download);
#endif
......@@ -25,8 +25,8 @@
#include "strlist.h"
#include "chunks.h"
#include "dpkgversions.h"
#include "downloadlist.h"
#include "target.h"
#include "downloadcache.h"
#include "upgradelist.h"
extern int verbose;
......@@ -46,7 +46,7 @@ struct package_data {
* NULL means nothing found. */
char *new_version;
/* where the recent version comes from: */
struct download_upstream *upstream;
struct aptmethod *aptmethod;
/* the new control-chunk for the package to go in
* non-NULL if new_version && newversion > version_in_use */
......@@ -65,7 +65,7 @@ struct upgradelist {
/* NULL or the last/next thing to test in alphabetical order */
struct package_data *current,*last;
/* internal...*/
struct download_upstream *currentupstream;
struct aptmethod *currentaptmethod;
};
static void package_data_free(struct package_data *data){
......@@ -98,7 +98,7 @@ static retvalue save_package_version(void *d,const char *packagename,const char
return RET_ERROR_OOM;
}
package->upstream = NULL;
package->aptmethod = NULL;
package->name = strdup(packagename);
if( package->name == NULL ) {
free(package);
......@@ -177,7 +177,7 @@ retvalue upgradelist_free(struct upgradelist *upgrade) {
return RET_OK;
}
retvalue upgradelist_trypackage(struct upgradelist *upgrade,const char *chunk){
static retvalue upgradelist_trypackage(struct upgradelist *upgrade,const char *chunk){
char *packagename,*version;
retvalue r;
upgrade_decision decision;
......@@ -257,8 +257,8 @@ retvalue upgradelist_trypackage(struct upgradelist *upgrade,const char *chunk){
free(version);
return RET_ERROR_OOM;
}
assert(upgrade->currentupstream);
new->upstream = upgrade->currentupstream;
assert(upgrade->currentaptmethod);
new->aptmethod = upgrade->currentaptmethod;
new->name = packagename;
packagename = NULL; //to be sure...
new->new_version = version;
......@@ -326,8 +326,8 @@ retvalue upgradelist_trypackage(struct upgradelist *upgrade,const char *chunk){
free(current->new_version);
current->new_version = version;
current->version = version;
assert(upgrade->currentupstream);
current->upstream = upgrade->currentupstream;
assert(upgrade->currentaptmethod);
current->aptmethod = upgrade->currentaptmethod;
strlist_move(&current->new_filekeys,&files);
strlist_move(&current->new_md5sums,&md5sums);
strlist_move(&current->new_origfiles,&origfiles);
......@@ -337,11 +337,11 @@ retvalue upgradelist_trypackage(struct upgradelist *upgrade,const char *chunk){
return RET_OK;
}
retvalue upgradelist_update(struct upgradelist *upgrade,struct download_upstream *upstream,const char *filename,int force){
retvalue upgradelist_update(struct upgradelist *upgrade,struct aptmethod *method,const char *filename,int force){
upgrade->current = upgrade->list;
upgrade->last = NULL;
upgrade->currentupstream = upstream;
upgrade->currentaptmethod = method;
return chunk_foreach(filename,(void*)upgradelist_trypackage,upgrade,force,0);
}
......@@ -362,15 +362,15 @@ retvalue upgradelist_listmissing(struct upgradelist *upgrade,filesdb files){
}
/* request all wanted files in the downloadlists given before */
retvalue upgradelist_enqueue(struct upgradelist *upgrade,int force) {
retvalue upgradelist_enqueue(struct upgradelist *upgrade,struct downloadcache *cache,filesdb filesdb,int force) {
struct package_data *pkg;
retvalue result,r;
pkg = upgrade->list;
result = RET_NOTHING;
while( pkg ) {
if( pkg->version == pkg->new_version ) {
assert(pkg->upstream);
r = downloadlist_addfiles(pkg->upstream,
assert(pkg->aptmethod);
r = downloadcache_addfiles(cache,filesdb,pkg->aptmethod,
&pkg->new_origfiles,
&pkg->new_filekeys,
&pkg->new_md5sums);
......
......@@ -4,8 +4,11 @@
#ifndef __MIRRORER_PACKAGES_H
#include "packages.h"
#endif
#ifndef __MIRRORER_DOWNLOADLIST_H
#include "downloadlist.h"
#ifndef __MIRRORER_APTMETHOD_H
#include "aptmethod.h"
#endif
#ifndef __MIRRORER_DOWNLOADCACHE_H
#include "downloadcache.h"
#endif
/* Things for making decisions what to upgrade and what not */
......@@ -27,15 +30,15 @@ retvalue upgradelist_free(struct upgradelist *upgrade);
retvalue upgradelist_dump(struct upgradelist *upgrade);
retvalue upgradelist_listmissing(struct upgradelist *upgrade,filesdb files);
/* Take all items in 'filename' into account, and remember them coming from 'upstream */
retvalue upgradelist_update(struct upgradelist *upgrade,struct download_upstream *upstream,const char *filename,int force);
/* Take all items in 'filename' into account, and remember them coming from 'method' */
retvalue upgradelist_update(struct upgradelist *upgrade,struct aptmethod *method,const char *filename,int force);
//TODO add a function to reduce data-load by removing anything not needed
//any longer. (perhaps with a flag to remove all packages that are no
//longer available upstream)
/* request all wanted files in the downloadlists given before */
retvalue upgradelist_enqueue(struct upgradelist *upgrade,int force);
/* request all wanted files refering the methods given before */
retvalue upgradelist_enqueue(struct upgradelist *upgrade,struct downloadcache *cache,filesdb filesdb,int force);
retvalue upgradelist_install(struct upgradelist *upgrade,filesdb files,DB *references,int force);
......
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