distribution.h 5.43 KB
Newer Older
Bernhard Link's avatar
Bernhard Link committed
1 2
#ifndef REPREPRO_DISTRIBUTION_H
#define REPREPRO_DISTRIBUTION_H
3

4 5
struct distribution;

Bernhard Link's avatar
Bernhard Link committed
6
#ifndef REPREPRO_ERROR_H
7 8 9
#include "error.h"
#warning "What's hapening here?"
#endif
10 11 12
#ifndef REPREPRO_DATABASE_H
#include "database.h"
#endif
Bernhard Link's avatar
Bernhard Link committed
13
#ifndef REPREPRO_STRLIST_H
14
#include "strlist.h"
15
#endif
Bernhard Link's avatar
Bernhard Link committed
16
#ifndef REPREPRO_TARGET_H
17 18
#include "target.h"
#endif
19 20 21
#ifndef REPREPRO_EXPORTS_H
#include "exports.h"
#endif
22 23 24
#ifndef REPREPRO_CONTENTS_H
#include "contents.h"
#endif
25
struct overridefile;
26
struct uploaders;
27

28 29 30 31 32 33
enum exportoptions {
	deo_noexport = 0,
	deo_keepunknown,
	deo_COUNT,
};

34
struct distribution {
35
	struct distribution *next;
36 37
	/* the primary name to access this distribution: */
	char *codename;
Bernhard Link's avatar
Bernhard Link committed
38
	/* for more helpfull error messages: */
39
	const char *filename; /* only valid while parsing! */
Bernhard Link's avatar
Bernhard Link committed
40
	unsigned int firstline, lastline;
41 42 43
	/* additional information for the Release-file to be
	 * generated, may be NULL. only suite is sometimes used
	 * (and only for sanity checks) */
44
	/*@null@*/char *suite, *version;
45
	/*@null@*/char *origin, *label, *description,
46
		*notautomatic, *butautomaticupgrades, *signed_by;
47
	/* What architectures and components are there */
48
	struct atomlist architectures, components;
49 50
	/* which update rules to use */
	struct strlist updates;
51 52
	/* which rules to use to pull packages from other distributions */
	struct strlist pulls;
53 54
	/* the key to sign with, may have no entries to mean unsigned: */
	struct strlist signwith;
55
	/* the override file to use by default */
56
	/*@null@*/char *deb_override, *udeb_override, *dsc_override;
Bernhard Link's avatar
Bernhard Link committed
57 58
	/* fake component prefix (and codename antisuffix) for Release files: */
	/*@null@*/char *fakecomponentprefix;
Bernhard Link's avatar
Bernhard Link committed
59
	/* only loaded when you've done it yourself: */
60
	struct {
61
		/*@null@*/struct overridefile *dsc, *deb, *udeb;
62
	} overrides;
63 64
	/* the list of components containing a debian-installer dir,
	 * normally only "main" */
65
	struct atomlist udebcomponents;
66
	/* what kind of index files to generate */
67
	struct exportmode dsc, deb, udeb;
68 69
	bool exportoptions[deo_COUNT];
	/* (NONE must be 0 so it is the default) */
70
	enum trackingtype { dt_NONE=0, dt_KEEP, dt_ALL, dt_MINIMAL } tracking;
71 72
	struct trackingoptions { bool includechanges;
		bool includebyhand;
73
		bool includebuildinfos;
74 75 76 77
		bool includelogs;
		bool needsources;
		bool keepsources;
		bool embargoalls;
78
		} trackingoptions;
79 80
	/* what content files to generate */
	struct contentsoptions contents;
81
	struct atomlist contents_architectures,
82 83 84 85
		       contents_components,
		       contents_ucomponents;
	bool contents_architectures_set,
		       contents_components_set,
86 87 88
		       contents_ucomponents_set,
		       /* not used, just here to keep things simpler: */
		       udebcomponents_set;
89
	/* A list of all targets contained in the distribution*/
90
	struct target *targets;
91
	/* a filename to look for who is allowed to upload packages */
92 93 94
	/*@null@*/char *uploaders;
	/* only loaded after _loaduploaders */
	/*@null@*/struct uploaders *uploaderslist;
Bernhard Link's avatar
Bernhard Link committed
95 96
	/* how and where to log */
	/*@null@*/struct logger *logger;
97 98
	/* scripts to feed byhand/raw-* files in */
	/*@null@*/struct byhandhook *byhandhooks;
99 100 101
	/* a list of names beside Codename and Suite to accept .changes
	 * files via include */
	struct strlist alsoaccept;
102
	/* if != 0, number of seconds to add for Vaild-Until */
103
	unsigned long validfor;
104 105 106 107
	/* RET_NOTHING: do not export with EXPORT_CHANGED, EXPORT_NEVER
	 * RET_OK: export unless EXPORT_NEVER
	 * RET_ERROR_*: only export with EXPORT_FORCE */
	retvalue status;
108 109 110 111
	/* false: not looked at, do not export at all */
	bool lookedat;
	/* false: not requested, do not handle at all */
	bool selected;
112 113
	/* forbid all writing operations and exports if true */
	bool readonly;
114 115
	/* tracking information might be obsolete */
	bool needretrack;
Bernhard Link's avatar
Bernhard Link committed
116 117
	/* omitted because of --onlysmalldeletes */
	bool omitted;
118 119
};

120
retvalue distribution_get(struct distribution * /*all*/, const char *, bool /*lookedat*/, /*@out@*/struct distribution **);
121

Bernhard Link's avatar
Bernhard Link committed
122
/* set lookedat, start logger, ... */
123
retvalue distribution_prepareforwriting(struct distribution *);
Bernhard Link's avatar
Bernhard Link committed
124

125
/*@dependent@*/struct target *distribution_getpart(const struct distribution *distribution, component_t, architecture_t, packagetype_t);
126

Bernhard Link's avatar
Bernhard Link committed
127
/* like distribtion_getpart, but returns NULL if there is no such target */
128
/*@null@*//*@dependent@*/struct target *distribution_gettarget(const struct distribution *distribution, component_t, architecture_t, packagetype_t);
Bernhard Link's avatar
Bernhard Link committed
129

Bernhard Link's avatar
Bernhard Link committed
130
retvalue distribution_fullexport(struct distribution *);
131

132

Bernhard Link's avatar
Bernhard Link committed
133
retvalue distribution_snapshot(struct distribution *, const char */*name*/);
Bernhard Link's avatar
Bernhard Link committed
134

Bernhard Link's avatar
Bernhard Link committed
135
/* read the configuration from all distributions */
136
retvalue distribution_readall(/*@out@*/struct distribution **distributions);
Bernhard Link's avatar
Bernhard Link committed
137

138 139
/* mark all dists from <conf> fitting in the filter given in <argc, argv> */
retvalue distribution_match(struct distribution * /*alldistributions*/, int /*argc*/, const char * /*argv*/ [], bool /*lookedat*/, bool /*readonly*/);
140

141
/* get a pointer to the apropiate part of the linked list */
142
struct distribution *distribution_find(struct distribution *, const char *);
143

144
retvalue distribution_freelist(/*@only@*/struct distribution *distributions);
Bernhard Link's avatar
Bernhard Link committed
145
enum exportwhen {EXPORT_NEVER, EXPORT_SILENT_NEVER, EXPORT_CHANGED, EXPORT_NORMAL, EXPORT_FORCE };
Bernhard Link's avatar
Bernhard Link committed
146
retvalue distribution_exportlist(enum exportwhen when, /*@only@*/struct distribution *);
147

148
retvalue distribution_loadalloverrides(struct distribution *);
149
void distribution_unloadoverrides(struct distribution *distribution);
150

151
retvalue distribution_loaduploaders(struct distribution *);
152
void distribution_unloaduploaders(struct distribution *distribution);
153
#endif