Commit 5427c698 authored by Bernhard Link's avatar Bernhard Link

modify Contents fields, change meaning of empty fields in updates and pulls,...

modify Contents fields, change meaning of empty fields in updates and pulls, forbid empty architectures or components list in distributions
parent f383fbc5
2007-09-22 Bernhard R. Link <brlink@debian.org>
* make empty Architectures and Components fields
in conf/distributions an error.
* Contents: fields no longer has a rate value,
ContentsComponents/Architectures/UComponents
triggers or disables contents generation if non-/empty.
* empty Architecturs/Components/UdebComponents in
conf/updates and conf/pulls now mean nothing instead of all.
2007-09-21 Bernhard R. Link <brlink@debian.org>
* save cached filelists of packages for Contents files
in a preprocessed form, needing only about half the disk
......
......@@ -4,6 +4,7 @@ Updates between 2.2.4 and 3.0.0:
* native support of comments (i.e. lines starting with # are now ignored,
instead of treated as ignored headers)
* better support of tabs
* meaning of empty fields changed, empty now means nothing and not all.
- always parse the whole distributions file first before doing anything else
(avoids actions started in the wrong base directory and helps to catch more
disambiguities, may lead to the need of a valid config file for some actions
......@@ -27,7 +28,8 @@ Updates between 2.2.4 and 3.0.0:
- added removesrc and removefilter
- new format for contents.cache.db. Only needs half of the disk space and runtime
to generate Contents files, but you need to run translatefilelists to translate
the cached items.
the cached items. Also format and meaning of the Contents-fields changed, a
rate no longer can be specified.
Updates between 2.2.3 and 2.2.4:
- [SECURITY] fix bug causing a Release.gpg with only
......
TODO:
update test-suite to work with different architecture, block sizes and
ways dpkg-deb puts the headers...
check for empty lists... (decide which should not be empty and which may)
test new config parser
do not put/leave files in pool when include gets an older version than already there
write more automated test-cases
......
......@@ -111,21 +111,34 @@ static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), UN
#define CFcheckuniqstrlistSETPROC(sname, field, checker) \
static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), UNUSED(const char *confdir), const char *name, void *data, struct configiterator *iter) { \
struct sname *item = data; \
return config_getuniqwords(iter, name, checker, &item->field); \
retvalue r; \
r = config_getuniqwords(iter, name, checker, &item->field); \
if( r == RET_NOTHING ) { \
fprintf(stderr, \
"Error parsing %s, line %d, column %d:\n" \
" An empty %s-field is not allowed.\n", config_filename(iter), \
config_line(iter), \
config_column(iter), \
name); \
r = RET_ERROR; \
} \
return r; \
}
#define CFuniqstrlistSETPROC(sname, field) \
static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), UNUSED(const char *confdir), const char *name, void *data, struct configiterator *iter) { \
struct sname *item = data; \
return config_getuniqwords(iter, name, NULL, &item->field); \
}
#define CFuniqstrlistSETPROCsub(sname, name, field) \
static retvalue configparser_ ## sname ## _set_ ## name ## _ ## field(UNUSED(void *dummy), UNUSED(const char *confdir), const char *name, void *data, struct configiterator *iter) { \
#define CFuniqstrlistSETPROCset(sname, name) \
static retvalue configparser_ ## sname ## _set_ ## name (UNUSED(void *dummy), UNUSED(const char *confdir), const char *name, void *data, struct configiterator *iter) { \
struct sname *item = data; \
return config_getuniqwords(iter, name, NULL, &item->name.field); \
item->name ## _set = true; \
return config_getuniqwords(iter, name, NULL, &item->name); \
}
#define CFsplitstrlistSETPROC(sname, field) \
static retvalue configparser_ ## sname ## _set_ ## field(UNUSED(void *dummy), UNUSED(const char *confdir), const char *name, void *data, struct configiterator *iter) { \
struct sname *item = data; \
item->field ## _set = true; \
return config_getsplitwords(iter, name, &item->field ## _from, &item->field ## _into); \
}
#define CFtruthSETPROC(sname, field) \
......
......@@ -38,20 +38,15 @@
extern int verbose;
void contentsoptions_done(struct contentsoptions *options) {
strlist_done(&options->architectures);
strlist_done(&options->components);
strlist_done(&options->ucomponents);
}
struct distribution;
/* options are zerroed when called, when error is returned contentsopions_done
* is called by the caller */
retvalue contentsoptions_parse(struct distribution *distribution, struct configiterator *iter) {
enum contentsflags { cf_udebs, cf_nodebs, cf_uncompressed, cf_gz, cf_bz2, cf_COUNT};
enum contentsflags { cf_disable, cf_dummy, cf_udebs, cf_nodebs, cf_uncompressed, cf_gz, cf_bz2, cf_COUNT};
bool flags[cf_COUNT];
static const struct constant contentsflags[] = {
{"0", cf_disable},
{"1", cf_dummy},
{"2", cf_dummy},
{"udebs", cf_udebs},
{"nodebs", cf_nodebs},
{".bz2", cf_bz2},
......@@ -60,20 +55,29 @@ retvalue contentsoptions_parse(struct distribution *distribution, struct configi
{NULL, -1}
};
retvalue r;
long long l;
r = config_getnumber(iter, "Contents rate", &l, 0, INT_MAX);
assert( r != RET_NOTHING );
if( RET_WAS_ERROR(r) )
return r;
distribution->contents.rate = l;
distribution->contents.flags.enabled = true;
memset(flags, 0, sizeof(flags));
r = config_getflags(iter, "Contents", contentsflags, flags,
IGNORABLE(unknownfield), "");
if( r == RET_ERROR_UNKNOWNFIELD )
fputs(
"Note that the format of the Contents field has changed with reprepro 3.0.0.\n"
"There is no longer a number needed (nor possible) there.\n", stderr);
if( RET_WAS_ERROR(r) )
return r;
if( flags[cf_dummy] ) {
fputs(
"Warning: Contents-headers in conf/distribution no longer need an\n"
"rate argument. Ignoring the number there, this might cause a error\n"
"future versions.\n", stderr);
} else if( flags[cf_disable] ) {
fputs(
"Warning: Contents-headers in conf/distribution no longer need an\n"
"rate argument. Treating the '0' as sign to not activate Contents-\n"
"-generation, but it will cause an error in future version.\n", stderr);
}
#ifndef HAVE_LIBBZ2
if( flags[cf_bz2] ) {
......@@ -85,8 +89,6 @@ retvalue contentsoptions_parse(struct distribution *distribution, struct configi
flags[cf_bz2] = false;
}
#endif
if( !flags[cf_uncompressed] && !flags[cf_gz] && !flags[cf_bz2] )
flags[cf_gz] = true;
distribution->contents.compressions = 0;
if( flags[cf_uncompressed] )
distribution->contents.compressions |= IC_FLAG(ic_uncompressed);
......@@ -99,19 +101,11 @@ retvalue contentsoptions_parse(struct distribution *distribution, struct configi
distribution->contents.flags.udebs = flags[cf_udebs];
distribution->contents.flags.nodebs = flags[cf_nodebs];
if( distribution->contents.rate == 0 )
return RET_NOTHING;
return RET_OK;
}
struct addcontentsdata {
int rate;
size_t work, leisure;
struct filelist_list *contents;
};
static retvalue addpackagetocontents(struct database *database, UNUSED(struct distribution *di), UNUSED(struct target *ta), const char *packagename, const char *chunk, void *data) {
struct addcontentsdata *d = data;
struct filelist_list *contents = data;
retvalue r;
char *section, *filekey;
......@@ -125,7 +119,7 @@ static retvalue addpackagetocontents(struct database *database, UNUSED(struct di
free(section);
return r;
}
r = filelist_addpackage(d->contents, database,
r = filelist_addpackage(contents, database,
packagename, section, filekey);
free(filekey);
......@@ -137,17 +131,17 @@ static retvalue genarchcontents(struct database *database, struct distribution *
retvalue r;
char *contentsfilename;
struct filetorelease *file;
struct addcontentsdata data;
struct filelist_list *contents;
const struct strlist *components;
data.rate = distribution->contents.rate;
data.work = data.leisure = 0;
if( distribution->contents.components.count > 0 )
components = &distribution->contents.components;
if( distribution->contents_components_set )
components = &distribution->contents_components;
else
components = &distribution->components;
if( components->count == 0 )
return RET_NOTHING;
if( onlyneeded ) {
struct target *target;
for( target=distribution->targets; target!=NULL;
......@@ -177,21 +171,21 @@ static retvalue genarchcontents(struct database *database, struct distribution *
}
free(contentsfilename);
r = filelist_init(&data.contents);
r = filelist_init(&contents);
if( RET_WAS_ERROR(r) ) {
release_abortfile(file);
return r;
}
r = distribution_foreach_package_c(distribution, database,
components, architecture, "deb",
addpackagetocontents, &data);
addpackagetocontents, contents);
if( !RET_WAS_ERROR(r) )
r = filelist_write(data.contents, file);
r = filelist_write(contents, file);
if( RET_WAS_ERROR(r) )
release_abortfile(file);
else
r = release_finishfile(release,file);
filelist_free(data.contents);
filelist_free(contents);
return r;
}
......@@ -199,17 +193,16 @@ static retvalue genarchudebcontents(struct database *database, struct distributi
retvalue r;
char *contentsfilename;
struct filetorelease *file;
struct addcontentsdata data;
struct filelist_list *contents;
const struct strlist *components;
data.rate = distribution->contents.rate;
data.work = data.leisure = 0;
if( distribution->contents.ucomponents.count > 0 )
components = &distribution->contents.ucomponents;
if( distribution->contents_ucomponents_set )
components = &distribution->contents_ucomponents;
else
components = &distribution->udebcomponents;
if( components->count == 0 )
return RET_NOTHING;
if( onlyneeded ) {
struct target *target;
......@@ -239,19 +232,19 @@ static retvalue genarchudebcontents(struct database *database, struct distributi
printf(" generating %s...\n",contentsfilename);
}
free(contentsfilename);
r = filelist_init(&data.contents);
r = filelist_init(&contents);
if( RET_WAS_ERROR(r) )
return r;
r = distribution_foreach_package_c(distribution, database,
components, architecture, "udeb",
addpackagetocontents, &data);
addpackagetocontents, contents);
if( !RET_WAS_ERROR(r) )
r = filelist_write(data.contents, file);
r = filelist_write(contents, file);
if( RET_WAS_ERROR(r) )
release_abortfile(file);
else
r = release_finishfile(release,file);
filelist_free(data.contents);
filelist_free(contents);
return r;
}
......@@ -260,9 +253,12 @@ retvalue contents_generate(struct database *database, struct distribution *distr
int i;
const struct strlist *architectures;
if( distribution->contents.compressions == 0 )
distribution->contents.compressions = IC_FLAG(ic_gzip);
result = RET_NOTHING;
if( distribution->contents.architectures.count > 0 ) {
architectures = &distribution->contents.architectures;
if( distribution->contents_architectures_set ) {
architectures = &distribution->contents_architectures;
} else {
architectures = &distribution->architectures;
}
......@@ -271,12 +267,12 @@ retvalue contents_generate(struct database *database, struct distribution *distr
if( strcmp(architecture,"source") == 0 )
continue;
if( !distribution->contents.flags.nodebs) {
if( !distribution->contents.flags.nodebs ) {
r = genarchcontents(database, distribution,
architecture,release,onlyneeded);
RET_UPDATE(result,r);
}
if( distribution->contents.flags.udebs) {
if( distribution->contents.flags.udebs ) {
r = genarchudebcontents(database, distribution,
architecture,release,onlyneeded);
RET_UPDATE(result,r);
......@@ -284,5 +280,3 @@ retvalue contents_generate(struct database *database, struct distribution *distr
}
return result;
}
......@@ -12,19 +12,14 @@
#endif
struct contentsoptions {
size_t rate;
struct {
bool enabled:1;
bool udebs:1;
bool nodebs:1;
} flags;
compressionset compressions;
struct strlist architectures,
components,
ucomponents;
};
void contentsoptions_done(struct contentsoptions *options);
struct distribution;
struct configiterator;
......
......@@ -71,7 +71,9 @@ static retvalue distribution_free(struct distribution *distribution) {
exportmode_done(&distribution->dsc);
exportmode_done(&distribution->deb);
exportmode_done(&distribution->udeb);
contentsoptions_done(&distribution->contents);
strlist_done(&distribution->contents_architectures);
strlist_done(&distribution->contents_components);
strlist_done(&distribution->contents_ucomponents);
override_free(distribution->overrides.deb);
override_free(distribution->overrides.udeb);
override_free(distribution->overrides.dsc);
......@@ -247,23 +249,45 @@ CFfinishparse(distribution) {
}
if( notpropersuperset(&n->architectures, "Architectures",
&n->contents.architectures, "ContentsArchitectures",
&n->contents_architectures, "ContentsArchitectures",
iter, n) ||
notpropersuperset(&n->components, "Components",
&n->contents.components, "ContentsComponents",
&n->contents_components, "ContentsComponents",
iter, n) ||
notpropersuperset(&n->udebcomponents, "UDebComponents",
&n->contents.ucomponents, "ContentsUComponents",
&n->contents_ucomponents, "ContentsUComponents",
iter, n) ||
// TODO: instead of checking here make sure it can have more
// in the rest of the code...
// in the rest of the code...:
notpropersuperset(&n->components, "Components",
&n->udebcomponents, "UDebComponents",
iter, n) ) {
(void)distribution_free(n);
return RET_ERROR;
}
/* overwrite creation of contents files based on given lists: */
if( n->contents_components_set ) {
if ( n->contents_components.count > 0 ) {
n->contents.flags.enabled = true;
n->contents.flags.nodebs = false;
} else {
n->contents.flags.nodebs = true;
}
}
if( n->contents_ucomponents_set ) {
if ( n->contents_ucomponents.count > 0 ) {
n->contents.flags.enabled = true;
n->contents.flags.udebs = true;
} else {
n->contents.flags.udebs = false;
}
}
if( n->contents_architectures_set ) {
if( n->contents_architectures.count > 0 )
n->contents.flags.enabled = true;
else
n->contents.flags.enabled = false;
}
/* prepare substructures */
r = createtargets(n);
......@@ -299,9 +323,9 @@ CFuniqstrlistSETPROC(distribution, udebcomponents)
CFuniqstrlistSETPROC(distribution, alsoaccept)
CFstrlistSETPROC(distribution, updates)
CFstrlistSETPROC(distribution, pulls)
CFuniqstrlistSETPROCsub(distribution, contents, architectures)
CFuniqstrlistSETPROCsub(distribution, contents, components)
CFuniqstrlistSETPROCsub(distribution, contents, ucomponents)
CFuniqstrlistSETPROCset(distribution, contents_architectures)
CFuniqstrlistSETPROCset(distribution, contents_components)
CFuniqstrlistSETPROCset(distribution, contents_ucomponents)
CFexportmodeSETPROC(distribution, udeb)
CFexportmodeSETPROC(distribution, deb)
CFexportmodeSETPROC(distribution, dsc)
......@@ -731,7 +755,7 @@ static retvalue export(struct distribution *distribution,
break;
}
}
if( !RET_WAS_ERROR(result) && distribution->contents.rate > 0 ) {
if( !RET_WAS_ERROR(result) && distribution->contents.flags.enabled ) {
r = contents_generate(database, distribution,
release, onlyneeded);
}
......
......@@ -65,6 +65,12 @@ struct distribution {
} trackingoptions;
/* what content files to generate */
struct contentsoptions contents;
struct strlist contents_architectures,
contents_components,
contents_ucomponents;
bool contents_architectures_set,
contents_components_set,
contents_ucomponents_set;
/* A list of all targets contained in the distribution*/
struct target *targets;
/* a filename to look for who is allowed to upload packages */
......
......@@ -717,16 +717,12 @@ Enable the creation of Contents files listing all the files
within the binary packages of a distribution.
(Which is quite slow, you have been warned).
The first argument is the rate at which to extract the files
from packages.
If it is 1, every file will be processed.
If it is 2, at least half of the uncached files and at most half
of all files are read to extract their filelist.
If it is 3, at least a third of yet uncached files and at most a
third of all files is read.
And so on...
In earlier versions, the first argument was a rate at which
to extract file lists.
As this did not work and was no longer easily possible after
some factorisation, this is no longer supported.
After that a space separated list of options can be given.
The arguments of this field is a space separated list of options.
If there is a \fBudebs\fP keyword, \fB.udeb\fPs are also listed
(in a file called \fBuContents\-\fP\fIarchitecture\fP.)
If there is a \fBnodebs\fP keyword, \fB.deb\fPs are not listed.
......@@ -737,19 +733,31 @@ of only gzipped.
.TP
.B ContentsArchitectures
Limit generation of Contents files to the architectures given.
If this field is not there or empty, all architectures are processed.
If this field is not there, all architectures are processed.
An empty field means no architectures are processed, thus not
very useful.
.TP
.B ContentsComponents
Limit what components are processed for the Contents files to
the components given.
If this field is not there or empty, all components are processed.
Limit what components are processed for the \fBContents-\fP\fIarch\fP
files to the components given.
If this field is not there, all components are processed.
An empty field is equivalent to specify \fBnodebs\fP in the
\fBContents\fP field, while a non-empty field overrides a
\fBnodebs\fP there.
.TP
.B ContentsUComponents
Limit what components are processed for the uContents files to
the components given.
If this field is not there or empty, all components are processed.
(Note unless you specify \fBudebs\fP in the \fBContents:\fP line,
no udeb Components are processed at all.)
If this field is not there and there is the \fBudebs\fP keyword
in the Contents field, all .udebs of all components are put
in the \fBuContents.\fP\fIarch\fP files.
If this field is not there and there is no \fBudebs\fP keyword
in the Contents field, no \fBuContents\fP-\fIarch\fP files are
generated at all.
A non-empty fields implies generation of \fBuContents\fP-\fIarch\fP
files (just like the \fBudebs\fP keyword in the Contents field),
while an empty one causes no \fBuContents-\fP\fIarch\fP files to
be generated.
.TP
.B Uploaders
Specified a file (relative to confdir if not starting with a slash)
......@@ -858,9 +866,21 @@ is replaced by "<codename>/whatever"
The components to update. Each item can be either the name
of a component or a pair of a upstream component and a local
component separated with ">". (e.g. "main>all contrib>all non\-free>notall")
Items with a local part are ignored. If no items are there
all from the updated distribution are taken. (Use some non existing
like "none", if you want none).
If this field is not there, all components from the distribution
to update are tried.
And emtpy field means no source or .deb packages are updated by this rule,
but only .udeb packages, if there are any.
A rule might list components not available in all distributions
using this rule. In this case unknown components are silently
ignored.
(Unless you start reprepro with the \fB\-\-fast\fP option,
it will warn about components unusable in all distributions using
that rule. As exceptions, unusable components called \fBnone\fP
are never warned about, for compatibility with versions prior to
3.0.0 where and empty field had a different meaning.)
.TP
.B Architectures
The architectures to update. If omitted all from the distribution
......@@ -868,7 +888,7 @@ to update from. (As with components, you can use ">" to download
from one Architecture and add into an other one. (This only determine
in which Package list they land, it neither overwrites the Architecture
line in its description, nor the one in the filename determined from this
one. In other words, it is no really useful without additional things)
one. In other words, it is no really useful without additional filtering)
.TP
.B UDebComponents
Like
......@@ -947,9 +967,17 @@ The codename of the distribution to pull packages from.
.TP
.B Components
The components of the distribution to get from.
Unknown items are ignored to ease rule reuse.
If there are no items, all components from distribution are taken.
(Use some non existing like "none", if you want none).
If this field is not there,
all components from the distribution to update are tried.
A rule might list components not available in all distributions using this
rule. In this case unknown components are silently ignored.
(Unless you start reprepro with the \-\-fast option,
it will warn about components unusable in all distributions using that rule.
As exception, unusable components called \fBnone\fP are never warned about,
for compatibility with versions prior to 3.0.0 where and empty field had
a different meaning.)
.TP
.B Architectures
The architectures to update.
......
......@@ -51,13 +51,16 @@ struct pull_rule {
char *name;
//e.g. "From: woody"
char *from;
//e.g. "Architectures: i386 sparc mips" (empty means all)
//e.g. "Architectures: i386 sparc mips" (not set means all)
struct strlist architectures_from;
struct strlist architectures_into;
//e.g. "Components: main contrib" (empty means all)
bool architectures_set;
//e.g. "Components: main contrib" (not set means all)
struct strlist components;
//e.g. "UDebComponents: main" // (empty means all)
bool components_set;
//e.g. "UDebComponents: main" // (not set means all)
struct strlist udebcomponents;
bool udebcomponents_set;
// NULL means no condition
/*@null@*/term *includecondition;
struct filterlist filterlist;
......@@ -93,12 +96,29 @@ void pull_freerules(struct pull_rule *p) {
CFlinkedlistinit(pull_rule)
CFvalueSETPROC(pull_rule, name)
CFvalueSETPROC(pull_rule, from)
CFsplitstrlistSETPROC(pull_rule, architectures)
CFuniqstrlistSETPROC(pull_rule, components)
CFuniqstrlistSETPROC(pull_rule, udebcomponents)
CFuniqstrlistSETPROCset(pull_rule, components)
CFuniqstrlistSETPROCset(pull_rule, udebcomponents)
CFfilterlistSETPROC(pull_rule, filterlist)
CFtermSETPROC(pull_rule, includecondition)
CFUSETPROC(pull_rule, architectures) {
CFSETPROCVAR(pull_rule, this);
retvalue r;
this->architectures_set = true;
r = config_getsplitwords(iter, "Architectures",
&this->architectures_from,
&this->architectures_into);
if( r == RET_NOTHING ) {
fprintf(stderr,
"Warning parsing %s, line %u: an empty Architectures field\n"
"causes the whole rule to do nothing.\n",
config_filename(iter),
config_markerline(iter));
}
return r;
}
static const struct configfield pullconfigfields[] = {
CFr("Name", pull_rule, name),
CFr("From", pull_rule, from),
......@@ -289,7 +309,7 @@ static retvalue pull_createsource(struct pull_rule *rule,
assert( rule != NULL );
assert( rule->distribution != NULL );
if( rule->architectures_into.count > 0 ) {
if( rule->architectures_set ) {
a_from = &rule->architectures_from;
a_into = &rule->architectures_into;
} else {
......@@ -297,12 +317,12 @@ static retvalue pull_createsource(struct pull_rule *rule,
a_into = &rule->distribution->architectures;
}
if( strcmp(target->packagetype,"udeb") == 0 ) {
if( rule->udebcomponents.count > 0 )
if( rule->udebcomponents_set )
c = &rule->udebcomponents;
else
c = &rule->distribution->udebcomponents;
} else {
if( rule->components.count > 0 )
if( rule->components_set )
c = &rule->components;
else
c = &rule->distribution->components;
......
......@@ -263,7 +263,7 @@ Log: logfile
Codename: B
Architectures: ${FAKEARCHITECTURE} source
Components: dog cat
Contents: 1
Contents:
Log: logfile
CONFEND
testrun - -b . export 3<<EOF
......
......@@ -140,17 +140,20 @@ struct update_pattern {
bool ignorerelease;
//e.g. "VerifyRelease: B629A24C38C6029A" (NULL means not check)
/*@null@*/char *verifyrelease;
//e.g. "Architectures: i386 sparc mips" (empty means all)
//e.g. "Architectures: i386 sparc mips" (not set means all)
struct strlist architectures_from;
struct strlist architectures_into;
bool architectures_set;
//e.g. "Components: main>main non-free>non-free contrib>contrib"
// (empty means all)
struct strlist components_from;
struct strlist components_into;
bool components_set;
//e.g. "UDebComponents: main>main"
// (empty means all)
struct strlist udebcomponents_from;
struct strlist udebcomponents_into;
bool udebcomponents_set;
// NULL means no condition
/*@null@*/term *includecondition;
struct filterlist filterlist;
......@@ -315,11 +318,27 @@ CFvalueSETPROC(update_pattern, verifyrelease)
CFlinelistSETPROC(update_pattern, config)
CFtruthSETPROC(update_pattern, ignorerelease)
CFscriptSETPROC(update_pattern, listhook)
CFsplitstrlistSETPROC(update_pattern, architectures)
CFsplitstrlistSETPROC(update_pattern, components)
CFsplitstrlistSETPROC(update_pattern, udebcomponents)
CFfilterlistSETPROC(update_pattern, filterlist)
CFtermSETPROC(update_pattern, includecondition)
CFUSETPROC(update_pattern, architectures) {
CFSETPROCVAR(update_pattern, this);
retvalue r;
this->architectures_set = true;
r = config_getsplitwords(iter, "Architectures",
&this->architectures_from,
&this->architectures_into);
if( r == RET_NOTHING ) {
fprintf(stderr,
"Warning parsing %s, line %u: an empty Architectures field\n"
"causes the whole pattern to do nothing.\n",
config_filename(iter),
config_markerline(iter));
}
return r;
}
static const struct configfield updateconfigfields[] = {
CFr("Name", update_pattern, name),
......@@ -384,54 +403,65 @@ static void checkpatternsforunused(const struct update_pattern *patterns, const
for( p = patterns ; p != NULL ; p = p->next ) {
if( !p->used )
continue;
found = strlist_preparefoundlist(&p->architectures_into);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
markfound(&d->updates, p->name, &p->architectures_into,
&d->architectures, found);
}
for( i = 0 ; i < p->architectures_into.count ; i++ ) {
if( found[i] )
if( p->architectures_set ) {
/* no architectures to update means nothing to do */
if( p->architectures_into.count == 0 )
continue;
fprintf(stderr,
found = strlist_preparefoundlist(&p->architectures_into);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
markfound(&d->updates, p->name, &p->architectures_into,
&d->architectures, found);
}
for( i = 0 ; i < p->architectures_into.count ; i++ ) {
if( found[i] )
continue;
fprintf(stderr,
"Warning: Update-pattern '%s' wants to put something in architecture '%s',\n"
"but no distribution using that rule has an architecture of that name.\n",
p->name, p->architectures_into.values[i]);
}
free(found);
found = strlist_preparefoundlist(&p->components_into);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
markfound(&d->updates, p->name, &p->components_into,
&d->components, found);
}
for( i = 0 ; i < p->components_into.count ; i++ ) {
if( found[i] )
continue;
fprintf(stderr,
p->name, p->architectures_into.values[i]);
}
free(found);
}
if( p->components_set && p->components_into.count > 0 ) {
found = strlist_preparefoundlist(&p->components_into);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
markfound(&d->updates, p->name, &p->components_into,
&d->components, found);
}
for( i = 0 ; i < p->components_into.count ; i++ ) {
if( found[i] )
continue;
fprintf(stderr,
"Warning: Update-pattern '%s' wants to put something in component '%s',\n"
"but no distribution using that rule has an component of that name.\n",
p->name, p->components_into.values[i]);
}
free(found);
found = strlist_preparefoundlist(&p->udebcomponents_into);
if( found == NULL )
return;
for( d = distributions ; d != NULL ; d = d->next ) {
markfound(&d->updates, p->name, &p->udebcomponents_into,
&d->udebcomponents, found);
}
for( i = 0 ; i < p->udebcomponents_into.count ; i++ ) {
if( found[i] )
continue;