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
* add ReadOnly option for conf/distributions
......
......@@ -1216,6 +1216,10 @@ will be installed. Things listed as
or
.B purge
will ignored.
Things listed with
.B warning
are also ignored,
but a warning message is printed to stderr.
A package being
.B hold
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
type = flt_hold;
} else if( strcmp(what, "upgradeonly") == 0 ) {
type = flt_upgradeonly;
} else if( strcmp(what, "warning") == 0 ) {
type = flt_warning;
} else if( strcmp(what,"error") == 0 ) {
type = flt_error;
} else {
......@@ -292,6 +294,7 @@ static const struct constant filterlisttype_listtypes[] = {
{"deinstall", (int)flt_deinstall},
{"purge", (int)flt_purge},
{"upgradeonly", (int)flt_upgradeonly},
{"warning", (int)flt_warning},
{"error", (int)flt_error},
{NULL, 0}
};
......
......@@ -5,6 +5,7 @@ enum filterlisttype {
/* must be 0, so it is the default, when there is no list */
flt_install = 0,
flt_purge,
flt_warning,
flt_deinstall,
flt_hold,
flt_upgradeonly,
......
......@@ -654,6 +654,8 @@ static upgrade_decision ud_decide_by_rule(void *privdata, const char *package, /
case flt_deinstall:
case flt_purge:
return UD_NO;
case flt_warning:
return UD_LOUDNO;
case flt_hold:
decision = UD_HOLD;
break;
......
......@@ -1449,6 +1449,8 @@ static upgrade_decision ud_decide_by_pattern(void *privdata, const char *package
case flt_deinstall:
case flt_purge:
return UD_NO;
case flt_warning:
return UD_LOUDNO;
case flt_hold:
decision = UD_HOLD;
break;
......
......@@ -269,6 +269,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda
decision = predecide(predecide_data, packagename_const, NULL, version, chunk);
if( decision != UD_UPGRADE ) {
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(version);
return (decision==UD_ERROR)?RET_ERROR:RET_NOTHING;
......@@ -358,6 +360,8 @@ static retvalue upgradelist_trypackage(struct upgradelist *upgrade, void *privda
decision = predecide(predecide_data,current->name,
current->version,version,chunk);
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
* will keep it or even install from a mirror before
* the delete was applied */
......
......@@ -3,7 +3,7 @@
/* 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);
......
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