Commit 6a423027 authored by Bernhard Link's avatar Bernhard Link

obsolete --overridedir

parent 9b2fde21
......@@ -2,6 +2,8 @@
* remove the dbdirs and all its parents created at startup
that are still empty at shutdown. (Does not make much difference
yet, as most commands create an empty file database in there.)
* obsolete --overridedir, overrides belong to conf dir like all
the other config files now.
2007-09-02 Bernhard R. Link <brlink@debian.org>
* fix uninitialized use of errno in listclean.
......
......@@ -4,6 +4,10 @@ Updates since 2.2.4:
* native support of comments (i.e. lines starting with # are now ignored,
instead of treated as ignored headers)
* better support of tabs
- obsolete --overridedir and searching files in overrides/ directory by default.
This places are still search, but so is the configuration directory now and
future version will stop accepting --overridedir and not search in that
directory.
Updates since 2.2.3:
- [SECURITY] fix bug causing a Release.gpg with only
......
......@@ -860,25 +860,25 @@ struct distribution *distribution_find(struct distribution *distributions, const
return NULL;
}
retvalue distribution_loadalloverrides(struct distribution *distribution, const char *overridedir) {
retvalue distribution_loadalloverrides(struct distribution *distribution, const char *confdir, const char *overridedir) {
retvalue r;
if( distribution->overrides.deb == NULL ) {
r = override_read(overridedir,distribution->deb_override,&distribution->overrides.deb);
r = override_read(confdir, overridedir, distribution->deb_override, &distribution->overrides.deb);
if( RET_WAS_ERROR(r) ) {
distribution->overrides.deb = NULL;
return r;
}
}
if( distribution->overrides.udeb == NULL ) {
r = override_read(overridedir,distribution->udeb_override,&distribution->overrides.udeb);
r = override_read(confdir, overridedir, distribution->udeb_override, &distribution->overrides.udeb);
if( RET_WAS_ERROR(r) ) {
distribution->overrides.udeb = NULL;
return r;
}
}
if( distribution->overrides.dsc == NULL ) {
r = override_read(overridedir,distribution->dsc_override,&distribution->overrides.dsc);
r = override_read(confdir, overridedir, distribution->dsc_override, &distribution->overrides.dsc);
if( RET_WAS_ERROR(r) ) {
distribution->overrides.dsc = NULL;
return r;
......
......@@ -127,7 +127,7 @@ struct distribution *distribution_find(struct distribution *distributions, const
retvalue distribution_freelist(/*@only@*/struct distribution *distributions);
retvalue distribution_exportandfreelist(enum exportwhen when, /*@only@*/struct distribution *distributions,const char *confdir, const char *distdir, struct database *);
retvalue distribution_loadalloverrides(struct distribution *, const char *overridedir);
retvalue distribution_loadalloverrides(struct distribution *, const char *confdir, const char *overridedir);
void distribution_unloadoverrides(struct distribution *distribution);
retvalue distribution_loaduploaders(struct distribution *, const char *confdir);
......
......@@ -108,10 +108,14 @@ when not in an update run.
If none is given, \fIbasedir\fP\fB/lists\fP is used.
.TP
.B \-\-overridedir \fIoverridedir\fP
.B \-\-overridedir \fIoverridedir\fP \fR(OBSOLETE)\fP
Sets the directory where specified override\-files will be searched in if
they do not start with a slash.
If none is given, \fIbasedir\fP\fB/override\fP is used.
.br
This will be removed in a future version.
Since reprepro 2.4.0, also the directory given to \-\-confdir is searched
for override files.
.TP
.B \-\-methoddir \fImethoddir\fP
Look in \fImethoddir\fP instead of
......
......@@ -1474,7 +1474,7 @@ static retvalue check_architecture_availability(const struct incoming *i, const
return RET_OK;
}
static retvalue candidate_add(const char *overridedir,struct database *database, struct strlist *dereferenced, struct incoming *i, struct candidate *c) {
static retvalue candidate_add(const char *confdir, const char *overridedir,struct database *database, struct strlist *dereferenced, struct incoming *i, struct candidate *c) {
struct candidate_perdistribution *d;
struct candidate_file *file;
retvalue r;
......@@ -1488,7 +1488,7 @@ static retvalue candidate_add(const char *overridedir,struct database *database,
return r;
for( d = c->perdistribution ; d != NULL ; d = d->next ) {
r = distribution_loadalloverrides(d->into, overridedir);
r = distribution_loadalloverrides(d->into, confdir, overridedir);
if( RET_WAS_ERROR(r) )
return r;
}
......@@ -1660,7 +1660,7 @@ static retvalue process_changes(const char *confdir,const char *overridedir,stru
i->files.values[ofs]);
r = RET_ERROR;
} else
r = candidate_add(overridedir, database,
r = candidate_add(confdir, overridedir, database,
dereferenced,
i, c);
if( RET_WAS_ERROR(r) && i->cleanup[cuf_on_error] ) {
......
......@@ -1499,7 +1499,7 @@ ACTION_F(reoverride) {
fprintf(stderr,"Reapplying override to %s...\n",d->codename);
}
r = distribution_loadalloverrides(d, overridedir);
r = distribution_loadalloverrides(d, confdir, overridedir);
if( RET_IS_OK(r) ) {
r = distribution_foreach_rwopenedpart(d, database,
component, architecture, packagetype,
......@@ -1574,9 +1574,13 @@ ACTION_D(includedeb) {
}
if( isudeb )
result = override_read(overridedir,distribution->udeb_override,&distribution->overrides.udeb);
result = override_read(confdir, overridedir,
distribution->udeb_override,
&distribution->overrides.udeb);
else
result = override_read(overridedir,distribution->deb_override,&distribution->overrides.deb);
result = override_read(confdir, overridedir,
distribution->deb_override,
&distribution->overrides.deb);
if( RET_WAS_ERROR(result) ) {
r = distribution_free(distribution);
RET_ENDUPDATE(result,r);
......@@ -1660,7 +1664,9 @@ ACTION_D(includedsc) {
assert( result != RET_NOTHING );
if( RET_WAS_ERROR(result) )
return result;
result = override_read(overridedir,distribution->dsc_override,&distribution->overrides.dsc);
result = override_read(confdir, overridedir,
distribution->dsc_override,
&distribution->overrides.dsc);
if( RET_WAS_ERROR(result) ) {
r = distribution_free(distribution);
RET_ENDUPDATE(result,r);
......@@ -1734,7 +1740,7 @@ ACTION_D(include) {
if( RET_WAS_ERROR(result) )
return result;
result = distribution_loadalloverrides(distribution,overridedir);
result = distribution_loadalloverrides(distribution, confdir, overridedir);
if( RET_WAS_ERROR(result) ) {
r = distribution_free(distribution);
RET_ENDUPDATE(result,r);
......@@ -2460,6 +2466,8 @@ static void handle_option(int c,const char *optarg) {
CONFIGDUP(listdir,optarg);
break;
case LO_OVERRIDEDIR:
if( verbose >= -1 )
fprintf(stderr, "Warning: --overridedir is obsolete. \nPlease put override files in the conf dir for compatibility with future version.\n");
CONFIGDUP(overridedir,optarg);
break;
case LO_CONFDIR:
......
......@@ -33,6 +33,8 @@
#include "names.h"
#include "override.h"
extern int verbose;
struct overrideinfo {
struct overrideinfo *next;
char *packagename;
......@@ -87,7 +89,7 @@ static inline retvalue newoverrideinfo(const char *firstpart,const char *secondp
return RET_OK;
}
retvalue override_read(const char *overridedir,const char *filename,struct overrideinfo **info) {
retvalue override_read(const char *confdir, const char *overridedir, const char *filename, struct overrideinfo **info) {
struct overrideinfo *root = NULL ,*last = NULL;
FILE *file;
char buffer[1001];
......@@ -96,12 +98,24 @@ retvalue override_read(const char *overridedir,const char *filename,struct overr
*info = NULL;
return RET_OK;
}
if( overridedir != NULL && filename[0] != '/' ) {
if( filename[0] != '/' ) {
char *fn = calc_dirconcat(overridedir,filename);
if( fn == NULL )
return RET_ERROR_OOM;
file = fopen(fn,"r");
file = fopen(fn, "r");
free(fn);
if( file != NULL ) {
if( verbose >= -1 )
fprintf(stderr,
"Warning: usage of a seperate directory for override files is obsolete.\n"
"Please put in conf dir instead for compatility with future versions.\n");
} else {
fn = calc_dirconcat(confdir, filename);
if( fn == NULL )
return RET_ERROR_OOM;
file = fopen(fn, "r");
free(fn);
}
} else
file = fopen(filename,"r");
......
......@@ -21,7 +21,7 @@ struct overrideinfo;
void override_free(/*@only@*//*@null@*/struct overrideinfo *info);
/* when filename does not start with '/' read override info from overridedir/filename,
* otherwise from filename directly.. */
retvalue override_read(const char *overridedir,const char *filename,/*@out@*/struct overrideinfo **info);
retvalue override_read(const char *confdir, const char *overridedir,const char *filename,/*@out@*/struct overrideinfo **info);
/*@null@*//*@dependent@*/const struct overrideinfo *override_search(/*@null@*/const struct overrideinfo *overrides,const char *package);
/*@null@*//*@dependent@*/const char *override_get(/*@null@*/const struct overrideinfo *override,const char *field);
......
......@@ -555,14 +555,13 @@ dodiff results.expected results
echo "DebOverride: debo" >> conf/distributions
echo "DscOverride: dsco" >> conf/distributions
mkdir override
echo "bird Section cat/tasty" > override/debo
echo "bird Priority hungry" >> override/debo
echo "bird Task lunch" >> override/debo
echo "bird-addons Section cat/ugly" >> override/debo
echo "bird Section cat/nest" > override/dsco
echo "bird Priority hurry" >> override/dsco
echo "bird Homepage gopher://tree" >> override/dsco
echo "bird Section cat/tasty" > conf/debo
echo "bird Priority hungry" >> conf/debo
echo "bird Task lunch" >> conf/debo
echo "bird-addons Section cat/ugly" >> conf/debo
echo "bird Section cat/nest" > conf/dsco
echo "bird Priority hurry" >> conf/dsco
echo "bird Homepage gopher://tree" >> conf/dsco
mv i2/* i/
rmdir i2
......@@ -1786,8 +1785,7 @@ echo -e '%g/^Date:/s/Date: .*/Date: normalized/\n%g/gz$/s/^ 163be0a88c70ca629fd5
dodiff dists/test1/Release.expected dists/test1/Release || exit 1
mkdir -p override
cat > override/srcoverride <<END
cat > conf/srcoverride <<END
simple Section ugly/games
simple Priority optional
simple Maintainer simple.source.maintainer
......@@ -1796,7 +1794,7 @@ bloat+-0a9z.app Priority optional
bloat+-0a9z.app X-addition totally-unsupported
bloat+-0a9z.app Maintainer bloat.source.maintainer
END
cat > override/binoverride <<END
cat > conf/binoverride <<END
simple Maintainer simple.maintainer
simple Section ugly/base
simple Priority optional
......
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