upgradelist.h 2.11 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, UD_SUPERSEDE } upgrade_decision;
7

8
struct package;
9
typedef upgrade_decision upgrade_decide_function(void *privdata, struct target *, struct package *, /*@null@*/ const char */*oldversion*/);
10 11 12

/* The main part: */

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

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

20 21
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 *);

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

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

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

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

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

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

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

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

45
#endif