Commit e0b4ac4a authored by Bernhard Link's avatar Bernhard Link

unified files_ calling conventions

parent 4e69586b
......@@ -322,7 +322,7 @@ retvalue deb_add(const char *dbdir,DB *references,DB *filesdb,const char *mirror
/* then looking if we already have this, or copy it in */
r = files_checkin(filesdb,mirrordir,filekeys.values[0],debfilename,&md5andsize);
r = files_checkin(mirrordir,filesdb,filekeys.values[0],debfilename,&md5andsize);
if( RET_WAS_ERROR(r) ) {
strlist_done(&filekeys);
deb_free(pkg);
......
......@@ -256,7 +256,7 @@ int files_expect(DB *filesdb,const char *mirrordir,const char *filekey,const cha
}
/* check for several files in the database and in the pool if missing */
retvalue files_insert(DB *filesdb,const char *mirrordir,const struct strlist *filekeys,const struct strlist *md5sums) {
retvalue files_expectfiles(const char *mirrordir,DB *filesdb,const struct strlist *filekeys,const struct strlist *md5sums) {
int i;
retvalue r;
......@@ -278,7 +278,7 @@ retvalue files_insert(DB *filesdb,const char *mirrordir,const struct strlist *fi
}
/* print missing files */
retvalue files_printmissing(DB *filesdb,const char *mirrordir,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles) {
retvalue files_printmissing(const char *mirrordir,DB *filesdb,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles) {
int i;
retvalue ret,r;
......@@ -370,7 +370,7 @@ retvalue files_foreach(DB* filesdb,per_file_action action,void *privdata) {
* or the database had an error. return RET_NOTHING, if already there
* with correct md5sum. Return <md5andsize> with the data of this file,
* if no error (that is if RET_OK or RET_NOTHING) */
retvalue files_checkin(DB *filesdb,const char *mirrordir,const char *filekey,
retvalue files_checkin(const char *mirrordir,DB *filesdb,const char *filekey,
const char *origfilename, char **md5andsize) {
int dbret;
......
......@@ -30,9 +30,9 @@ retvalue files_detect(DB *filesdb,const char *mirrordir,const char *filekey);
retvalue files_expect(DB *filesdb,const char *mirrordir,const char *filekey,const char *md5andsize);
/* print missing files */
retvalue files_printmissing(DB *filesdb,const char *mirrordir,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles);
retvalue files_printmissing(const char *mirrordir,DB *filesdb,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles);
/* check for several files in the database and in the pool if missing */
retvalue files_insert(DB *filesdb,const char *mirrordir,const struct strlist *filekeys,const struct strlist *md5sums);
retvalue files_expectfiles(const char *mirrordir,DB *filesdb,const struct strlist *filekeys,const struct strlist *md5sums);
/* Copy file <origfilename> to <mirrordir>/<filekey> and add it to
* the database <filesdb>. Return RET_ERROR_WRONG_MD5 if already there
......@@ -40,13 +40,12 @@ retvalue files_insert(DB *filesdb,const char *mirrordir,const struct strlist *fi
* or the database had an error. return RET_NOTHING, if already there
* with correct md5sum. Return <md5andsize> with the data of this file,
* if no error (that is if RET_OK or RET_NOTHING) */
retvalue files_checkin(DB *filesdb,const char *mirrordir,const char *filekey,
retvalue files_checkin(const char *mirrordir,DB *filesdb,const char *filekey,
const char *origfilename, char **md5andsize);
/* Make sure filekeys with md5sums are in the pool. If not copy from
* sourcedir/file where file is the entry from files */
retvalue files_checkinfiles(const char *mirrordir,DB *filesdb,const char *sourcedir,
const struct strlist *basefilenames,const struct strlist *filekeys,const struct strlist *md5sums);
retvalue files_checkinfiles(const char *mirrordir,DB *filesdb,const char *sourcedir,const struct strlist *basefilenames,const struct strlist *filekeys,const struct strlist *md5sums);
/* The same for a single file: */
retvalue files_checkinfile(const char *mirrordir,DB *filesdb,const char *sourcedir,const char *basename,const char *filekey,const char *md5sum);
......
......@@ -457,7 +457,7 @@ static retvalue add(void *data,const char *chunk,const char *package,const char
/* Add package to distribution's database */
result = files_insert(dist->files,mirrordir,filekeys,md5sums);
result = files_expectfiles(mirrordir,dist->files,filekeys,md5sums);
if( RET_WAS_ERROR(result) )
return result;
......@@ -519,7 +519,7 @@ static retvalue showmissing(void *data,const char *chunk,const char *package,con
r = dirs_make_parents(mirrordir,filekeys);
if( RET_WAS_ERROR(r) )
return r;
ret = files_printmissing(dist->files,mirrordir,filekeys,md5sums,origfiles);
ret = files_printmissing(mirrordir,dist->files,filekeys,md5sums,origfiles);
return ret;
}
......@@ -1271,7 +1271,7 @@ static int includedsc(int argc,char *argv[]) {
if( !files )
return 1;
result =dsc_add(dbdir,references,files,mirrordir,component,section,priority,distribution,argv[2],force);
result =dsc_add(dbdir,references,files,mirrordir,component,section,priority,distribution,argv[2],NULL,NULL,NULL,NULL,force);
distribution_free(distribution);
r = files_done(files);
......
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