upgradelist.h 2.12 KB
Newer Older
Bernhard Link's avatar
Bernhard Link committed
1 2
#ifndef REPREPRO_UPGRADELIST_H
#define REPREPRO_UPGRADELIST_H
3 4 5

/* Things for making decisions what to upgrade and what not */

6
typedef enum { UD_ERROR, UD_LOUDNO, UD_NO, UD_UPGRADE, UD_HOLD } upgrade_decision;
7

Bernhard Link's avatar
Bernhard Link committed
8
typedef upgrade_decision upgrade_decide_function(void *privdata, const struct target *, const char *package, const char *source, const char *old_version, const char *new_version, const char *new_src_version, const char *newcontrolchunk);
9 10 11

/* The main part: */

12
struct target;
Bernhard Link's avatar
Bernhard Link committed
13
struct logger;
14
struct upgradelist;
15

16
retvalue upgradelist_initialize(struct upgradelist **, /*@dependent@*/struct target *);
17
void upgradelist_free(/*@only@*/struct upgradelist *);
18

19 20
typedef void dumpaction(const char */*packagename*/, /*@null@*/const char */*oldversion*/, /*@null@*/const char */*newversion*/, /*@null@*/const char */*bestcandidate*/, /*@null@*/const struct strlist */*newfilekeys*/, /*@null@*/const char */*newcontrol*/, void *);

21
void upgradelist_dump(struct upgradelist *, dumpaction *);
22

23
/* Take all items in 'filename' into account, and remember them coming from 'method' */
24
retvalue upgradelist_update(struct upgradelist *, /*@dependent@*/void *, const char * /*filename*/, upgrade_decide_function *, void *, bool /*ignorewrongarchitecture*/);
25

26
/* Take all items in source into account */
27
retvalue upgradelist_pull(struct upgradelist *, struct target *, upgrade_decide_function *, void *, void *);
28

29
/* mark all packages as deleted, so they will vanis unless readded or reholded */
30
retvalue upgradelist_deleteall(struct upgradelist *);
31

32
typedef retvalue enqueueaction(void *, const struct checksumsarray *, const struct strlist *, void *);
33
/* request all wanted files refering the methods given before */
34
retvalue upgradelist_enqueue(struct upgradelist *, enqueueaction *, void *);
35

Bernhard Link's avatar
Bernhard Link committed
36 37
bool upgradelist_isbigdelete(const struct upgradelist *);

38
retvalue upgradelist_install(struct upgradelist *, /*@null@*/struct logger *, bool /*ignoredelete*/, void (*)(void *, const char **, const char **));
39

Bernhard Link's avatar
Bernhard Link committed
40
/* remove all packages that would either be removed or upgraded by an upgrade */
41
retvalue upgradelist_predelete(struct upgradelist *, /*@null@*/struct logger *);
Bernhard Link's avatar
Bernhard Link committed
42

43
#endif