Commit 8374d090 authored by Bernhard Link's avatar Bernhard Link

start of some refactoring

parent 759bf82f
#ifndef REPREPRO_APTMETHOD_H
#define REPREPRO_APTMETHOD_H
#ifndef REPREPRO_FILES_H
#include "files.h"
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
struct aptmethodrun;
......@@ -31,7 +31,7 @@ retvalue aptmethod_newmethod(struct aptmethodrun *run,const char *uri,const char
retvalue aptmethod_queuefile(struct aptmethod *method,const char *origfile,const char *destfile,/*@null@*/const char *md5sum,/*@null@*/const char *filekey,/*@out@*//*@null@*/struct tobedone **);
retvalue aptmethod_queueindexfile(struct aptmethod *method,const char *origfile,const char *destfile);
retvalue aptmethod_download(struct aptmethodrun *run,const char *methoddir,/*@null@*/filesdb filesdb);
retvalue aptmethod_download(struct aptmethodrun *run,const char *methoddir,struct database *);
retvalue aptmethod_shutdown(/*@only@*/struct aptmethodrun *run);
#endif
......@@ -21,7 +21,7 @@ char *ubinaries_getupstreamindex(struct target *target,const char *suite_from,
const char *component_from,const char *architecture);
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(struct target *t,const char *packagename,const char *chunk, trackingdb tracks,references refs);
retvalue binaries_retrack(struct target *t,const char *packagename,const char *chunk, trackingdb tracks,struct database *);
retvalue binaries_getsourceandversion(struct target *,const char *chunk,const char *packagename,char **source,char **version);
/* Functions for checkindeb.c and incoming.c: */
......@@ -50,6 +50,6 @@ retvalue binaries_calcfilekeys(const char *component,const struct deb_headers *,
struct overrideinfo;
retvalue binaries_complete(const struct deb_headers *,const char *filekey,const char *md5sum,const struct overrideinfo *,const char *section,const char *priority,char **newcontrol);
retvalue binaries_adddeb(const struct deb_headers *,const char *dbdir,references,const char *forcearchitecture,const char *packagetype,struct distribution *,struct strlist *dereferencedfilekeys,struct trackingdata *,const char *component,const struct strlist *filekeys,const char *control);
retvalue binaries_checkadddeb(const struct deb_headers *,const char *dbdir,const char *forcearchitecture,const char *packagetype,struct distribution *,bool_t tracking,const char *component,bool_t permitnewerold);
retvalue binaries_adddeb(const struct deb_headers *,struct database *,const char *forcearchitecture,const char *packagetype,struct distribution *,struct strlist *dereferencedfilekeys,struct trackingdata *,const char *component,const struct strlist *filekeys,const char *control);
retvalue binaries_checkadddeb(const struct deb_headers *,struct database *,const char *forcearchitecture,const char *packagetype,struct distribution *,bool_t tracking,const char *component,bool_t permitnewerold);
#endif
......@@ -5,6 +5,9 @@
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_DISTRIBUTION_H
#include "distribution.h"
#endif
......@@ -14,7 +17,7 @@
* get it from the files or try to guess it.
* if dereferencedfilekeys is != NULL, add filekeys that lost reference,
* if tracks != NULL, update/add tracking information there... */
retvalue changes_add(const char *dbdir,/*@null@*/trackingdb tracks,references refs,filesdb filesdb,/*@null@*/const char *packagetypeonly,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcearchitecture,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,const char *changesfilename,int delete,/*@null@*/struct strlist *dereferencedfilekeys);
retvalue changes_add(struct database *,/*@null@*/trackingdb tracks,/*@null@*/const char *packagetypeonly,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcearchitecture,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,const char *changesfilename,int delete,/*@null@*/struct strlist *dereferencedfilekeys);
#endif
......@@ -8,8 +8,8 @@
#ifndef REPREPRO_DISTRIBUTION_H
#include "distribution.h"
#endif
#ifndef REPREPRO_FILES_H
#include "files.h"
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
/* insert the given .deb into the mirror in <component> in the <distribution>
......@@ -19,12 +19,12 @@
* package. (forcesection and forcepriority have higher priority than the
* information there),
* if dereferencedfilekeys is != NULL, add there filekeys that lost a reference */
retvalue deb_add(const char *dbdir,references refs,filesdb filesdb,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcearchitecture,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,const char *packagetype,struct distribution *distribution,const char *debfilename,/*@null@*/const char *givenfilekey,/*@null@*/const char *givenmd5sum,int delete,/*@null@*/struct strlist *dereferencedfilekeys,/*@null@*/trackingdb);
retvalue deb_add(struct database *,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcearchitecture,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,const char *packagetype,struct distribution *distribution,const char *debfilename,/*@null@*/const char *givenfilekey,/*@null@*/const char *givenmd5sum,int delete,/*@null@*/struct strlist *dereferencedfilekeys,/*@null@*/trackingdb);
/* in two steps */
struct debpackage;
retvalue deb_addprepared(const struct debpackage *pkg, const char *dbdir,references refs,const char *forcearchitecture,const char *packagetype,struct distribution *distribution,struct strlist *dereferencedfilekeys,struct trackingdata *trackingdata);
retvalue deb_hardlinkfiles(struct debpackage *deb,filesdb filesdb,const char *debfilename);
retvalue deb_prepare(/*@out@*/struct debpackage **deb,filesdb filesdb,const char * const forcecomponent,const char * const forcearchitecture,const char *forcesection,const char *forcepriority,const char * const packagetype,struct distribution *distribution,const char *debfilename,const char * const givenfilekey,const char * const givenmd5sum,int delete,bool_t needsourceversion,const struct strlist *allowed_binaries,const char *expectedsourcename,const char *expectedsourceversion);
retvalue deb_addprepared(const struct debpackage *pkg, struct database *,const char *forcearchitecture,const char *packagetype,struct distribution *distribution,struct strlist *dereferencedfilekeys,struct trackingdata *trackingdata);
retvalue deb_hardlinkfiles(struct debpackage *deb,struct database *,const char *debfilename);
retvalue deb_prepare(/*@out@*/struct debpackage **deb,struct database *,const char * const forcecomponent,const char * const forcearchitecture,const char *forcesection,const char *forcepriority,const char * const packagetype,struct distribution *distribution,const char *debfilename,const char * const givenfilekey,const char * const givenmd5sum,int delete,bool_t needsourceversion,const struct strlist *allowed_binaries,const char *expectedsourcename,const char *expectedsourceversion);
void deb_free(/*@only@*/struct debpackage *pkg);
#endif
......@@ -5,17 +5,17 @@
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_DISTRIBUTION_H
#include "distribution.h"
#endif
#ifndef REPREPRO_FILES_H
#include "files.h"
#endif
/* insert the given .dsc into the mirror in <component> in the <distribution>
* if component is NULL, guess it from the section.
* if dereferenced_filekeys is != NULL, add there the filekeys that lost a reference*/
retvalue dsc_add(const char *dbdir,references refs,filesdb filesdb,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,const char *dscfilename,int delete,/*@null@*/struct strlist *dereferencedfilekeys, /*@null@*/trackingdb tracks);
retvalue dsc_add(struct database *,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,const char *dscfilename,int delete,/*@null@*/struct strlist *dereferencedfilekeys, /*@null@*/trackingdb tracks);
/* in two steps:
* If basename, filekey and directory are != NULL, then they are used instead
......@@ -24,8 +24,8 @@ retvalue dsc_add(const char *dbdir,references refs,filesdb filesdb,/*@null@*/con
* delete should be D_INPLACE then
*/
struct dscpackage *pkg;
retvalue dsc_prepare(struct dscpackage **dsc,filesdb filesdb,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,/*@null@*/const char *sourcedir, const char *dscfilename,/*@null@*/const char *filekey,/*@null@*/const char *basename,/*@null@*/const char *directory,/*@null@*/const char *md5sum,int delete, const char *expectedname, const char *expectedversion);
retvalue dsc_addprepared(const struct dscpackage *pkg,const char *dbdir,references refs,struct distribution *distribution,/*@null@*/struct strlist *dereferencedfilekeys, /*@null@*/struct trackingdata *trackingdata);
retvalue dsc_prepare(struct dscpackage **dsc,struct database *,/*@null@*/const char *forcecomponent,/*@null@*/const char *forcesection,/*@null@*/const char *forcepriority,struct distribution *distribution,/*@null@*/const char *sourcedir, const char *dscfilename,/*@null@*/const char *filekey,/*@null@*/const char *basename,/*@null@*/const char *directory,/*@null@*/const char *md5sum,int delete, const char *expectedname, const char *expectedversion);
retvalue dsc_addprepared(const struct dscpackage *pkg,struct database *,struct distribution *distribution,/*@null@*/struct strlist *dereferencedfilekeys, /*@null@*/struct trackingdata *trackingdata);
void dsc_free(/*@only@*/struct dscpackage *pkg);
......
......@@ -4,6 +4,9 @@
#ifndef REPREPRO_STRLIST_H
#include "strlist.h"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_RELEASE_H
#include "release.h"
#endif
......@@ -24,9 +27,7 @@ void contentsoptions_done(struct contentsoptions *options);
struct distribution;
retvalue contentsoptions_parse(struct distribution *distribution,
const char *chunk);
retvalue contents_generate(filesdb files, struct distribution *distribution, const char *dbdir, struct release *release, bool_t onlyneeded);
retvalue contentsoptions_parse(struct distribution *distribution,const char *chunk);
retvalue contents_generate(struct database *,struct distribution *,struct release *,bool_t onlyneeded);
#endif
......@@ -7,6 +7,9 @@ struct distribution;
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_STRLIST_H
#include "strlist.h"
#endif
......@@ -90,17 +93,23 @@ typedef retvalue distribution_each_action(void *data, struct target *t, struct d
* not NULL or "all", only do those parts */
retvalue distribution_foreach_part(struct distribution *distribution,/*@null@*/const char *component,/*@null@*/const char *architecture,/*@null@*/const char *packagetype,distribution_each_action action,/*@null@*/void *data);
/* call <action> for each part of <distribution>, within initpackagesdb/closepackagesdb */
retvalue distribution_foreach_roopenedpart(struct distribution *,struct database *,const char *component,const char *architecture,const char *packagetype,distribution_each_action action,void *data);
/* call <action> for each part of <distribution>, within initpackagesdb/closepackagesdb,
* setting distribution->status to some error if there are any*/
retvalue distribution_foreach_rwopenedpart(struct distribution *,struct database *,const char *component,const char *architecture,const char *packagetype,distribution_each_action action,void *data);
/*@dependent@*/struct target *distribution_getpart(const struct distribution *distribution,const char *component,const char *architecture,const char *packagetype);
/* like distribtion_getpart, but returns NULL if there is no such target */
/*@dependent@*/struct target *distribution_gettarget(const struct distribution *distribution,const char *component,const char *architecture,const char *packagetype);
retvalue distribution_fullexport(struct distribution *distribution,const char *confdir,const char *dbdir,const char *distdir,filesdb);
retvalue distribution_fullexport(struct distribution *distribution,const char *confdir,const char *distdir,struct database *);
enum exportwhen {EXPORT_NEVER, EXPORT_CHANGED, EXPORT_NORMAL, EXPORT_FORCE };
retvalue distribution_export(enum exportwhen when, struct distribution *distribution,const char *confdir,const char *dbdir,const char *distdir,filesdb);
retvalue distribution_export(enum exportwhen when, struct distribution *distribution,const char *confdir,const char *distdir,struct database *);
retvalue distribution_snapshot(struct distribution *distribution,const char *confdir,const char *dbdir,const char *distdir,references refs,const char *name);
retvalue distribution_snapshot(struct distribution *distribution,const char *confdir,const char *distdir,struct database *,const char *name);
/* get all dists from <conf> fitting in the filter given in <argc,argv> */
retvalue distribution_getmatched(const char *confdir,const char *logdir,int argc,const char *argv[],bool_t lookedat,/*@out@*/struct distribution **distributions);
......@@ -109,7 +118,7 @@ retvalue distribution_getmatched(const char *confdir,const char *logdir,int argc
struct distribution *distribution_find(struct distribution *distributions, const char *name);
retvalue distribution_freelist(/*@only@*/struct distribution *distributions);
retvalue distribution_exportandfreelist(enum exportwhen when, /*@only@*/struct distribution *distributions,const char *confdir, const char *dbdir, const char *distdir, filesdb);
retvalue distribution_exportandfreelist(enum exportwhen when, /*@only@*/struct distribution *distributions,const char *confdir, const char *distdir, struct database *);
retvalue distribution_loadalloverrides(struct distribution *, const char *overridedir);
void distribution_unloadoverrides(struct distribution *distribution);
......
......@@ -9,8 +9,8 @@
#include "strlist.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_FILES_H
#include "files.h"
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_APTMETHOD_H
#include "aptmethod.h"
......@@ -27,7 +27,7 @@ struct downloadcache {
};
/* Initialize a new download session */
retvalue downloadcache_initialize(const char *dbdir,enum spacecheckmode mode,off_t reserveddb,off_t reservedother,struct downloadcache **download);
retvalue downloadcache_initialize(struct database *,enum spacecheckmode mode,off_t reserveddb,off_t reservedother,struct downloadcache **download);
/* free all memory */
retvalue downloadcache_free(/*@null@*//*@only@*/struct downloadcache *download);
......@@ -35,10 +35,10 @@ retvalue downloadcache_free(/*@null@*//*@only@*/struct downloadcache *download);
/* 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 downloadcache_add(struct downloadcache *cache,filesdb filesdb,struct aptmethod *method,const char *orig,const char *filekey,const char *md5sum);
retvalue downloadcache_add(struct downloadcache *cache,struct database *database,struct aptmethod *method,const char *orig,const char *filekey,const char *md5sum);
/* some as above, only for more files... */
retvalue downloadcache_addfiles(struct downloadcache *cache,filesdb filesdb,
retvalue downloadcache_addfiles(struct downloadcache *cache,struct database *,
struct aptmethod *method,
const struct strlist *origfiles,
const struct strlist *filekeys,
......
......@@ -4,6 +4,9 @@
#ifndef REPREPRO_RELEASE_H
#include "release.h"
#endif
#ifndef REPREPRO_PACKAGES_H
#include "packages.h"
#endif
struct exportmode {
/* "Packages", "Sources" or something like that */
......
......@@ -5,33 +5,36 @@
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#include "filelist.h"
typedef struct s_filesdb *filesdb;
struct filesdb;
/* initalize "md5sum and size"-database */
retvalue files_initialize(/*@out@*/ filesdb *filesdb,const char *dbpath,const char *mirrordir);
retvalue files_initialize(/*@out@*/struct filesdb **,const char *dbdir,const char *mirrordir);
/* release the files-database initialized got be files_initialize */
retvalue files_done(/*@only@*/filesdb db);
retvalue files_done(/*@only@*/struct filesdb *);
/* Add file's md5sum to database */
retvalue files_add(filesdb filesdb,const char *filekey,const char *md5sum);
retvalue files_add(struct database *,const char *filekey,const char *md5sum);
/* remove file's md5sum from database */
retvalue files_remove(filesdb filesdb,const char *filekey,bool_t ignoremissing);
retvalue files_remove(struct database *,const char *filekey,bool_t ignoremissing);
/* delete the file and remove its md5sum from database,
* also try to rmdir empty directories it is in if rmdirs is true */
retvalue files_deleteandremove(filesdb filesdb,const char *filekey, bool_t rmdirs, bool_t ignoremissing);
retvalue files_deleteandremove(struct database *,const char *filekey, bool_t rmdirs, bool_t ignoremissing);
/* check for file in the database and if not found there in the pool */
retvalue files_expect(filesdb filesdb,const char *filekey,const char *md5sum);
retvalue files_expect(struct database *,const char *filekey,const char *md5sum);
/* same for multiple files */
retvalue files_expectfiles(filesdb filesdb,const struct strlist *filekeys,const struct strlist *md5sums);
retvalue files_expectfiles(struct database *,const struct strlist *filekeys,const struct strlist *md5sums);
/* print missing files */
retvalue files_printmissing(filesdb filesdb,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles);
retvalue files_printmissing(struct database *,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles);
/* what to do with files */
/* file should already be there, just make sure it is in the database */
......@@ -60,40 +63,40 @@ retvalue files_printmissing(filesdb filesdb,const struct strlist *filekeys,const
* (the original file is not deleted in that case, even if delete is positive)
* 4) add it to the database
*/
retvalue files_include(filesdb filesdb,const char *sourcefilename,const char *filekey, /*@null@*/const char *md5sum, /*@null@*/char **calculatedmd5sum, int delete);
retvalue files_include(struct database *,const char *sourcefilename,const char *filekey, /*@null@*/const char *md5sum, /*@null@*/char **calculatedmd5sum, int delete);
/* same as above, but use sourcedir/basename instead of sourcefilename */
retvalue files_includefile(filesdb filesdb,const char *sourcedir,const char *basename, const char *filekey, const char *md5sum, /*@null@*/char **calculatedmd5sum, int delete);
retvalue files_includefile(struct database *,const char *sourcedir,const char *basename, const char *filekey, const char *md5sum, /*@null@*/char **calculatedmd5sum, int delete);
/* the same, but with multiple files */
retvalue files_includefiles(filesdb filesdb,const char *sourcedir,const struct strlist *basenames, const struct strlist *filekeys, const struct strlist *md5sums, int delete);
retvalue files_includefiles(struct database *,const char *sourcedir,const struct strlist *basenames, const struct strlist *filekeys, const struct strlist *md5sums, int delete);
typedef retvalue per_file_action(void *data,const char *filekey,const char *md5sum);
/* callback for each registered file */
retvalue files_foreach(filesdb filesdb,per_file_action action,void *data);
retvalue files_foreach(struct database *,per_file_action action,void *data);
/* check if all files are corect. (skip md5sum if fast is true) */
retvalue files_checkpool(filesdb filesdb,bool_t fast);
retvalue files_checkpool(struct database *,bool_t fast);
/* dump out all information */
retvalue files_printmd5sums(filesdb filesdb);
retvalue files_printmd5sums(struct database *);
/* concat mirrordir. return NULL if OutOfMemory */
char *files_calcfullfilename(const filesdb filesdb,const char *filekey);
char *files_calcfullfilename(const struct database *,const char *filekey);
/* look for the given filekey and add it into the filesdatabase */
retvalue files_detect(filesdb db,const char *filekey);
retvalue files_detect(struct database *,const char *filekey);
retvalue files_getfilelist(filesdb db,const char *filekey,const struct filelist_package *package, struct filelist_list *filelist);
retvalue files_genfilelist(filesdb db,const char *filekey,const struct filelist_package *package, struct filelist_list *filelist);
retvalue files_regenerate_filelist(filesdb db, bool_t redo);
retvalue files_addfilelist(filesdb db,const char *filekey,const char *filelist);
retvalue files_getfilelist(struct database *,const char *filekey,const struct filelist_package *package, struct filelist_list *filelist);
retvalue files_genfilelist(struct database *,const char *filekey,const struct filelist_package *package, struct filelist_list *filelist);
retvalue files_regenerate_filelist(struct database *, bool_t redo);
retvalue files_addfilelist(struct database *,const char *filekey,const char *filelist);
/* hardlink file with known md5sum and add it to database */
retvalue files_hardlink(filesdb db,const char *tempfile, const char *filekey,const char *md5sum);
retvalue files_hardlink(struct database *,const char *tempfile, const char *filekey,const char *md5sum);
/* check if file is already there (RET_NOTHING) or could be added (RET_OK)
* or RET_ERROR_WRONG_MD5SUM if filekey is already there with different md5sum */
retvalue files_ready(filesdb db,const char *filekey,const char *md5sum);
retvalue files_ready(struct database *,const char *filekey,const char *md5sum);
#endif
#ifndef REPREPRO_FREESPACE_H
#define REPREPRO_FREESPACE_H
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
struct devices;
enum spacecheckmode { scm_NONE, /* scm_ASSUMESINGLEFS, */ scm_FULL };
retvalue space_prepare(const char *dbdir,/*@out@*/struct devices **,enum spacecheckmode,off_t reservedfordb,off_t reservedforothers);
retvalue space_prepare(struct database *,/*@out@*/struct devices **,enum spacecheckmode,off_t reservedfordb,off_t reservedforothers);
retvalue space_needed(/*@null@*/struct devices *,const char *filename,const char *md5sum);
......
......@@ -40,16 +40,4 @@ enum config_option_owner { CONFIG_OWNER_DEFAULT=0,
CONFIG_OWNER_FILE,
CONFIG_OWNER_ENVIRONMENT,
CONFIG_OWNER_CMDLINE};
#if LIBDB_VERSION == 44
#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
#elif LIBDB_VERSION == 43
#define DB_OPEN(database,filename,name,type,flags) database->open(database,NULL,filename,name,type,flags,0664)
#else
#if LIBDB_VERSION == 3
#define DB_OPEN(database,filename,name,type,flags) database->open(database,filename,name,type,flags,0664)
#else
#error Unexpected LIBDB_VERSION!
#endif
#endif
#endif
......@@ -6,5 +6,5 @@
#warning "What's hapening here?"
#endif
retvalue process_incoming(const char *basedir,const char *confdir,const char *overridedir,filesdb files,const char *dbdir,references refs,struct strlist *dereferenced,struct distribution *distributions,const char *name,/*@null@*/const char *onlychangesfilename);
retvalue process_incoming(const char *basedir,const char *confdir,const char *overridedir, struct database *,struct strlist *dereferenced,struct distribution *distributions,const char *name,/*@null@*/const char *onlychangesfilename);
#endif
......@@ -24,7 +24,7 @@ bool_t logger_rerun_needs_target(const struct logger *,const struct target *);
retvalue logger_reruninfo(struct logger *,struct target *,const char *name,const char *version,const char *control,/*@null@*/const struct strlist *filekeys);
/* do work that is left */
retvalue logger_continue(struct logger*);
retvalue logger_continue(struct logger *);
/* wait for all jobs to finish */
void logger_wait(void);
void logger_warn_waiting(void);
......
......@@ -9,20 +9,20 @@
#include "strlist.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_NAMES_H
#include "names.h"
#endif
#ifndef REPREPRO_FILES_H
#include "files.h"
#endif
typedef struct s_packagesdb *packagesdb;
/* initialize the packages-database for <identifier> */
retvalue packages_initialize(/*@out@*/packagesdb *pkgs,const char *dbpath,const char *identifier);
retvalue packages_initialize(/*@out@*/packagesdb *pkgs, struct database *,const char *identifier);
/* The same but calculate the identifier */
retvalue packages_init(packagesdb *pkgs,const char *dbpath,const char *codename,const char *component,const char *architecture,const char *packagetype);
retvalue packages_init(packagesdb *pkgs, struct database *,const char *codename,const char *component,const char *architecture,const char *packagetype);
/* release the packages-database initialized got be packages_initialize */
retvalue packages_done(/*@only@*/packagesdb db);
......@@ -43,13 +43,14 @@ typedef retvalue per_package_action(void *data,const char *package,/*@temp@*/con
/* call action once for each saved chunk: */
retvalue packages_foreach(packagesdb packagesdb,per_package_action *action,/*@temp@*/ /*@null@*/void *data);
struct distribution;
/* action to be called by packages_modifyall */
typedef retvalue per_package_modifier(const struct distribution *data,const char *package,const char *chunk, char **newchunk);
/* call action once for each saved chunk and replace with a new one, if it returns RET_OK: */
retvalue packages_modifyall(packagesdb db,per_package_modifier *action,const struct distribution *privdata,bool_t *setifmodified);
/* get a list of all identifiers once created */
retvalue packages_getdatabases(const char *dbpath, struct strlist *identifiers);
retvalue packages_getdatabases(struct database *, struct strlist *identifiers);
/* remove the package database for the given identifier */
retvalue packages_drop(const char *dbpath, const char *identifier);
retvalue packages_drop(struct database *,const char *identifier);
#endif
......@@ -5,9 +5,6 @@
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_REFERENCES_H
#include "reference.h"
#endif
#ifndef REPREPRO_RELEASE_H
#include "release.h"
#endif
......@@ -27,7 +24,7 @@ void pull_freerules(/*@only@*/struct pull_rule *p);
void pull_freedistributions(/*@only@*/struct pull_distribution *p);
retvalue pull_prepare(const char *confdir,const char *logdir,struct pull_rule *rules,struct distribution *,/*@out@*/struct pull_distribution **,struct distribution **alsoneeded);
retvalue pull_update(const char *dbdir,filesdb filesdb,references refs,struct pull_distribution *distributions,struct strlist *dereferencedfilekeys);
retvalue pull_checkupdate(const char *dbdir,struct pull_distribution *distributions);
retvalue pull_update(struct database *,struct pull_distribution *distributions,struct strlist *dereferencedfilekeys);
retvalue pull_checkupdate(struct database *,struct pull_distribution *distributions);
#endif
......@@ -11,45 +11,48 @@
#warning "What's happening?"
#endif
typedef struct references *references;
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
struct references;
retvalue references_initialize(/*@out@*/references *ref, const char *path);
retvalue references_done(/*@only@*/references ref);
retvalue references_initialize(/*@out@*/struct references **ref, const char *path);
retvalue references_done(/*@only@*/struct references *ref);
/* remove all references from a given identifier */
retvalue references_remove(references ref,const char *neededby,/*@null@*/struct strlist *);
retvalue references_remove(struct database *,const char *neededby,/*@null@*/struct strlist *);
/* Add an reference by <identifer> for the given <files>,
* excluding <exclude>, if it is nonNULL. */
retvalue references_insert(references ref,const char *identifer,
retvalue references_insert(struct database *,const char *identifer,
const struct strlist *files,const struct strlist *exclude);
/* Add an reference by <identifer> for the given <files>,
* do not error out if reference already exists */
retvalue references_add(references ref,const char *identifer,const struct strlist *files);
retvalue references_add(struct database *,const char *identifer,const struct strlist *files);
/* Remove reference by <identifer> for the given <oldfiles>,
* excluding <exclude>, if it is nonNULL.
* if dereferencedfilekeys is != NULL, add those losing one reference,
* files will be freed (or moved to dereferencedfilekeys) */
retvalue references_delete(references ref,const char *identifer,
retvalue references_delete(struct database *,const char *identifer,
struct strlist *files,/*@null@*/const struct strlist *exclude,
/*@null@*/struct strlist *dereferencedfilekeys);
/* add an reference to a file for an identifier. */
retvalue references_increment(references ref,const char *needed,const char *needey);
retvalue references_increment(struct database *,const char *needed,const char *needey);
/* delete reference to a file for an identifier */
retvalue references_decrement(references ref,const char *needed,const char *needey);
retvalue references_decrement(struct database *,const char *needed,const char *needey);
/* check if an item is needed, returns RET_NOTHING if not */
retvalue references_isused(references ref,const char *what);
retvalue references_isused(struct database *,const char *what);
/* check if a reference is found as expected */
retvalue references_check(references ref,const char *referee,const struct strlist *what);
retvalue references_check(struct database *,const char *referee,const struct strlist *what);
/* print out all referee-referenced-pairs. */
retvalue references_dump(references ref);
retvalue references_dump(struct database *);
#endif
......@@ -8,6 +8,9 @@
#ifndef REPREPRO_STRLIST_H
#include "strlist.h"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
struct release;
......@@ -21,7 +24,7 @@ typedef unsigned int compressionset; /* 1 << indexcompression */
#define IC_FLAG(a) (1<<(a))
/* Initialize Release generation */
retvalue release_init(const char *dbdir, const char *distdir, const char *codename, struct release **release);
retvalue release_init(struct release **release, struct database *database, const char *distdir, const char *codename);
/* same but for a snapshot */
retvalue release_initsnapshot(const char *distdir, const char *codename, const char *name, struct release **release);
......
......@@ -20,7 +20,7 @@ retvalue sources_getfilekeys(struct target *t,const char *chunk,/*@out@*/struct
char *sources_getupstreamindex(struct target *target,const char *suite_from,
const char *component_from,const char *architecture);
retvalue sources_doreoverride(const struct distribution *,const char *packagename,const char *controlchunk,/*@out@*/char **newcontrolchunk);
retvalue sources_retrack(struct target *t,const char *packagename,const char *chunk, trackingdb tracks,references refs);
retvalue sources_retrack(struct target *t,const char *packagename,const char *chunk, trackingdb tracks,struct database *);
retvalue sources_getsourceandversion(struct target *,const char *chunk,const char *packagename,char **source,char **version);
/* Functions for checkindsc.c and incoming.c: */
......
......@@ -7,6 +7,9 @@
#ifndef REPREPRO_NAMES_H
#include "names.h"
#endif
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
#ifndef REPREPRO_TRACKINGT_H
#include "trackingt.h"
#endif
......@@ -28,7 +31,7 @@ typedef retvalue get_filekeys(struct target *,const char *,/*@out@*/struct strli
typedef char *get_upstreamindex(struct target *,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(struct target *,const char *packagename,const char *controlchunk,trackingdb,references);
typedef retvalue do_retrack(struct target *,const char *packagename,const char *controlchunk,trackingdb,struct database *);
typedef retvalue get_sourceandversion(struct target *,const char *chunk,const char *packagename,char **source,char **version);
struct target {
......@@ -63,24 +66,24 @@ retvalue target_initialize_binary(const char *codename,const char *component,con
retvalue target_initialize_source(const char *codename,const char *component,/*@dependent@*/const struct exportmode *exportmode,/*@out@*/struct target **target);
retvalue target_free(struct target *target);
retvalue target_export(struct target *target,const char *confdir,const char *dbdir,bool_t onlyneeded, bool_t snapshot, struct release *release);
retvalue target_export(struct target *target,const char *confdir,struct database *,bool_t onlyneeded, bool_t snapshot, struct release *release);
retvalue target_printmd5sums(const char *dirofdist,const struct target *target,FILE *out,int force);
/* This opens up the database, if db != NULL, *db will be set to it.. */
retvalue target_initpackagesdb(struct target *target, const char *dbdir);
retvalue target_initpackagesdb(struct target *target, struct database *);
/* this closes databases... */
retvalue target_closepackagesdb(struct target *target);
/* The following calls can only be called if target_initpackagesdb was called before: */
struct logger;
retvalue target_addpackage(struct target *target,/*@null@*/struct logger *logger,references refs,const char *name,const char *version,const char *control,const struct strlist *filekeys,bool_t downgrade,/*@null@*/struct strlist *dereferencedfilekeys,/*@null@*/struct trackingdata *,enum filetype);
retvalue target_addpackage(struct target *,/*@null@*/struct logger *,struct database *,const char *name,const char *version,const char *control,const struct strlist *filekeys,bool_t downgrade,/*@null@*/struct strlist *dereferencedfilekeys,/*@null@*/struct trackingdata *,enum filetype);
retvalue target_checkaddpackage(struct target *target,const char *name,const char *version,bool_t tracking,bool_t permitnewerold);
retvalue target_removepackage(struct target *target,struct logger *logger,references refs,const char *name,/*@null@*/const char *oldpversion,/*@null@*/struct strlist *dereferencedfilekeys,struct trackingdata *);
retvalue target_check(struct target *target,filesdb filesdb,references refsdb);
retvalue target_rereference(struct target *target,references refs);
retvalue target_addsnapshotreference(struct target *target,const char *dbdir,references refs,const char *name);
retvalue target_retrack(struct target *target,trackingdb tracks,references refs);
retvalue target_removepackage(struct target *,struct logger *,struct database *,const char *name,/*@null@*/const char *oldpversion,/*@null@*/struct strlist *dereferencedfilekeys,struct trackingdata *);
retvalue target_check(struct target *,struct database *);
retvalue target_rereference(struct target *,struct database *);
retvalue target_addsnapshotreference(struct target *,struct database *,const char *name);
retvalue target_retrack(struct target *,trackingdb,struct database *);
retvalue target_reoverride(struct target *target,const struct distribution *);
retvalue target_rerunnotifiers(struct target *, struct logger *);
......
#ifndef REPREPRO_TRACKINGT_H
#define REPREPRO_TRACKINGT_H
#ifndef REPREPRO_REFERENCE_H
#include "reference.h"
#endif
enum filetype { ft_ALL_BINARY='a',
ft_ARCH_BINARY='b',
ft_CHANGES = 'c',
......
......@@ -5,9 +5,6 @@
#include "error.h"
#warning "What's hapening here?"
#endif
#ifndef REPREPRO_REFERENCES_H
#include "reference.h"
#endif
#ifndef REPREPRO_RELEASE_H
#include "release.h"
#endif
......@@ -37,9 +34,9 @@ retvalue updates_calcindices(const char *listdir,const struct update_pattern *pa
/* remove all files ${listdir}/${distribution}_* that will not be needed. */
retvalue updates_clearlists(const char *listdir,struct update_distribution *distributions);
retvalue updates_update(const char *dbdir,const char *methoddir,filesdb filesdb,references refs,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys,enum spacecheckmode mode,off_t reserveddb,off_t reservedother);
retvalue updates_iteratedupdate(const char *confdir,const char *dbdir,const char *distdir,const char *methoddir,filesdb filesdb,references refs,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys, enum exportwhen export,enum spacecheckmode mode,off_t reserveddb,off_t reservedother);
retvalue updates_checkupdate(const char *dbdir,const char *methoddir,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold);
retvalue updates_predelete(const char *dbdir,const char *methoddir,references refs,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys);
retvalue updates_update(struct database *,const char *methoddir,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys,enum spacecheckmode mode,off_t reserveddb,off_t reservedother);
retvalue updates_iteratedupdate(const char *confdir,struct database *,const char *distdir,const char *methoddir,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys, enum exportwhen export,enum spacecheckmode mode,off_t reserveddb,off_t reservedother);
retvalue updates_checkupdate(struct database *,const char *methoddir,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold);
retvalue updates_predelete(struct database *database,const char *methoddir,struct update_distribution *distributions,bool_t nolistsdownload,bool_t skipold,struct strlist *dereferencedfilekeys);
#endif
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