Commit 0e9f3357 authored by Bernhard Link's avatar Bernhard Link

add 'warning' tag for FilterList files

parent d1df817a
2009-02-20
* add 'warning' flag for FilterList files
2009-02-13 2009-02-13
* add ReadOnly option for conf/distributions * add ReadOnly option for conf/distributions
......
...@@ -1216,6 +1216,10 @@ will be installed. Things listed as ...@@ -1216,6 +1216,10 @@ will be installed. Things listed as
or or
.B purge .B purge
will ignored. will ignored.
Things listed with
.B warning
are also ignored,
but a warning message is printed to stderr.
A package being A package being
.B hold .B hold
will not be upgraded but also not downgraded or removed by previous will not be upgraded but also not downgraded or removed by previous
......
...@@ -128,6 +128,8 @@ static inline retvalue filterlistfile_parse(struct filterlistfile *n, const char ...@@ -128,6 +128,8 @@ static inline retvalue filterlistfile_parse(struct filterlistfile *n, const char
type = flt_hold; type = flt_hold;
} else if( strcmp(what, "upgradeonly") == 0 ) { } else if( strcmp(what, "upgradeonly") == 0 ) {
type = flt_upgradeonly; type = flt_upgradeonly;
} else if( strcmp(what, "warning") == 0 ) {
type = flt_warning;
} else if( strcmp(what,"error") == 0 ) { } else if( strcmp(what,"error") == 0 ) {
type = flt_error; type = flt_error;
} else { } else {
...@@ -292,6 +294,7 @@ static const struct constant filterlisttype_listtypes[] = { ...@@ -292,6 +294,7 @@ static const struct constant filterlisttype_listtypes[] = {
{"deinstall", (int)flt_deinstall}, {"deinstall", (int)flt_deinstall},
{"purge", (int)flt_purge}, {"purge", (int)flt_purge},
{"upgradeonly", (int)flt_upgradeonly}, {"upgradeonly", (int)flt_upgradeonly},
{"warning", (int)flt_warning},
{"error", (int)flt_error}, {"error", (int)flt_error},
{NULL, 0} {NULL, 0}
}; };
......
...@@ -5,6 +5,7 @@ enum filterlisttype { ...@@ -5,6 +5,7 @@ enum filterlisttype {
/* must be 0, so it is the default, when there is no list */ /* must be 0, so it is the default, when there is no list */
flt_install = 0, flt_install = 0,
flt_purge, flt_purge,
flt_warning,
flt_deinstall, flt_deinstall,
flt_hold, flt_hold,
flt_upgradeonly, flt_upgradeonly,
......
...@@ -654,6 +654,8 @@ static upgrade_decision ud_decide_by_rule(void *privdata, const char *package, / ...@@ -654,6 +654,8 @@ static upgrade_decision ud_decide_by_rule(void *privdata, const char *package, /
case flt_deinstall: case flt_deinstall:
case flt_purge: case flt_purge:
return UD_NO; return UD_NO;
case flt_warning:
return UD_LOUDNO;
case flt_hold: case flt_hold:
decision = UD_HOLD; decision = UD_HOLD;
break; break;
......
...@@ -1449,6 +1449,8 @@ static upgrade_decision ud_decide_by_pattern(void *privdata, const char *package ...@@ -1449,6 +1449,8 @@ static upgrade_decision ud_decide_by_pattern(void *privdata, const char *package
case flt_deinstall: case flt_deinstall:
case flt_purge: case flt_purge:
return UD_NO; return UD_NO;
case flt_warning:
return UD_LOUDNO;
case flt_hold: case flt_hold:
decision = UD_HOLD; decision = UD_HOLD;
break; break;
......
...@@ -269,6 +269,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda ...@@ -269,6 +269,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda
decision = predecide(predecide_data, packagename_const, NULL, version, chunk); decision = predecide(predecide_data, packagename_const, NULL, version, chunk);
if( decision != UD_UPGRADE ) { if( decision != UD_UPGRADE ) {
upgrade->last = insertafter; upgrade->last = insertafter;
if( decision == UD_LOUDNO )
fprintf(stderr, "Loudly rejecting '%s' '%s' to enter '%s'!\n", packagename, version, upgrade->target->identifier);
free(packagename); free(packagename);
free(version); free(version);
return (decision==UD_ERROR)?RET_ERROR:RET_NOTHING; return (decision==UD_ERROR)?RET_ERROR:RET_NOTHING;
...@@ -358,6 +360,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda ...@@ -358,6 +360,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda
decision = predecide(predecide_data,current->name, decision = predecide(predecide_data,current->name,
current->version,version,chunk); current->version,version,chunk);
if( decision != UD_UPGRADE ) { if( decision != UD_UPGRADE ) {
if( decision == UD_LOUDNO )
fprintf(stderr, "Loudly rejecting '%s' '%s' to enter '%s'!\n", packagename, version, upgrade->target->identifier);
/* Even if we do not install it, setting it on hold /* Even if we do not install it, setting it on hold
* will keep it or even install from a mirror before * will keep it or even install from a mirror before
* the delete was applied */ * the delete was applied */
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* Things for making decisions what to upgrade and what not */ /* Things for making decisions what to upgrade and what not */
typedef enum { UD_ERROR, UD_NO, UD_UPGRADE, UD_HOLD } upgrade_decision; typedef enum { UD_ERROR, UD_LOUDNO, UD_NO, UD_UPGRADE, UD_HOLD } upgrade_decision;
typedef upgrade_decision upgrade_decide_function(void *privdata, const char *package,const char *old_version,const char *new_version,const char *newcontrolchunk); typedef upgrade_decision upgrade_decide_function(void *privdata, const char *package,const char *old_version,const char *new_version,const char *newcontrolchunk);
......
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