Commit 3ffd30d2 authored by Bernhard Link's avatar Bernhard Link

unify export handling

parent d2ce2206
2012-12-09 Bernhard R. Link <brlink@debian.org>
* unify export handling (moving it out of the
action specific code)
2012-12-02 Bernhard R. Link <brlink@debian.org>
* keep around relative release filenames always
......
......@@ -965,58 +965,6 @@ retvalue distribution_exportlist(enum exportwhen when, struct distribution *dist
return result;
}
retvalue distribution_export(enum exportwhen when, struct distribution *distribution) {
if (when == EXPORT_SILENT_NEVER) {
struct target *t;
for (t = distribution->targets ; t != NULL ; t = t->next)
t->wasmodified = false;
return RET_NOTHING;
}
if (when == EXPORT_NEVER) {
if (verbose >= 10)
fprintf(stderr,
"Not exporting %s because of --export=never.\n"
"Make sure to run a full export soon.\n", distribution->codename);
return RET_NOTHING;
}
if (when != EXPORT_FORCE &&
(RET_WAS_ERROR(distribution->status)||interrupted())) {
if (verbose >= 10)
fprintf(stderr,
"Not exporting %s because there have been errors and no --export=force.\n"
"Make sure to run a full export soon.\n", distribution->codename);
return RET_NOTHING;
}
if (when == EXPORT_CHANGED && distribution->status == RET_NOTHING) {
struct target *t;
if (verbose >= 10)
fprintf(stderr,
"Not exporting %s because of no recorded changes and --export=changed.\n",
distribution->codename);
/* some paranoid check */
for (t = distribution->targets ; t != NULL ; t = t->next) {
if (t->wasmodified) {
fprintf(stderr,
"A paranoid check found distribution %s would not have been exported,\n"
"despite having parts that are marked changed by deeper code.\n"
"Please report this and how you got this message as bugreport. Thanks.\n"
"Doing a export despite --export=changed....\n",
distribution->codename);
return export(distribution, true);
break;
}
}
return RET_NOTHING;
}
if (verbose >= 0)
printf("Exporting indices...\n");
return export(distribution, true);
}
/* get a pointer to the apropiate part of the linked list */
struct distribution *distribution_find(struct distribution *distributions, const char *name) {
......
......@@ -132,8 +132,6 @@ retvalue distribution_remove_packages(struct distribution *, const struct atomli
retvalue distribution_fullexport(struct distribution *distribution);
enum exportwhen {EXPORT_NEVER, EXPORT_SILENT_NEVER, EXPORT_CHANGED, EXPORT_NORMAL, EXPORT_FORCE };
retvalue distribution_export(enum exportwhen, struct distribution *);
retvalue distribution_snapshot(struct distribution *distribution, const char *name);
......@@ -147,6 +145,7 @@ retvalue distribution_match(struct distribution * /*alldistributions*/, int /*ar
struct distribution *distribution_find(struct distribution *, const char *);
retvalue distribution_freelist(/*@only@*/struct distribution *distributions);
enum exportwhen {EXPORT_NEVER, EXPORT_SILENT_NEVER, EXPORT_CHANGED, EXPORT_NORMAL, EXPORT_FORCE };
retvalue distribution_exportlist(enum exportwhen when, /*@only@*/struct distribution *distributions);
retvalue distribution_loadalloverrides(struct distribution *);
......
This diff is collapsed.
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