diff options
author | Guillem Jover <guillem@debian.org> | 2013-08-12 00:33:09 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2013-09-19 19:53:42 +0200 |
commit | ef63703776ae8f17cf65669d098c338bb97efb32 (patch) | |
tree | d045a780d63236b3f2aad0769862a50c584f273c /src | |
parent | 9b8a544549ea911210f8ec1dc6062bf98e8a3e3a (diff) | |
download | dpkg-ef63703776ae8f17cf65669d098c338bb97efb32.tar.gz |
dpkg: Use enum dep_check type and values instead of int and literals
Diffstat (limited to 'src')
-rw-r--r-- | src/configure.c | 2 | ||||
-rw-r--r-- | src/remove.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/configure.c b/src/configure.c index 8e151a783..005e58977 100644 --- a/src/configure.c +++ b/src/configure.c @@ -326,7 +326,7 @@ deferred_configure(struct pkginfo *pkg) struct varbuf aemsgs = VARBUF_INIT; struct conffile *conff; struct pkginfo *otherpkg; - int ok; + enum dep_check ok; if (pkg->status == stat_notinstalled) ohshit(_("no package named `%s' is installed, cannot configure"), diff --git a/src/remove.c b/src/remove.c index d81d8a630..75ab96192 100644 --- a/src/remove.c +++ b/src/remove.c @@ -51,10 +51,12 @@ */ static void checkforremoval(struct pkginfo *pkgtoremove, struct pkgset *pkgdepcheck, - int *rokp, struct varbuf *raemsgs) { + enum dep_check *rokp, struct varbuf *raemsgs) +{ struct deppossi *possi; struct pkginfo *depender; - int before, ok; + enum dep_check ok; + int before; for (possi = pkgdepcheck->depended.installed; possi; possi = possi->rev_next) { if (possi->up->type != dep_depends && possi->up->type != dep_predepends) continue; @@ -84,8 +86,8 @@ static void checkforremoval(struct pkginfo *pkgtoremove, void deferred_remove(struct pkginfo *pkg) { struct varbuf raemsgs = VARBUF_INIT; - int rok; struct dependency *dep; + enum dep_check rok; debug(dbg_general, "deferred_remove package %s", pkg_name(pkg, pnaw_always)); @@ -121,7 +123,7 @@ void deferred_remove(struct pkginfo *pkg) { debug(dbg_general, "checking dependencies for remove '%s'", pkg_name(pkg, pnaw_always)); - rok= 2; + rok = dep_check_ok; checkforremoval(pkg, pkg->set, &rok, &raemsgs); for (dep= pkg->installed.depends; dep; dep= dep->next) { if (dep->type != dep_provides) continue; @@ -129,12 +131,12 @@ void deferred_remove(struct pkginfo *pkg) { checkforremoval(pkg, dep->list->ed, &rok, &raemsgs); } - if (rok == 1) { + if (rok == dep_check_defer) { varbuf_destroy(&raemsgs); pkg->clientdata->istobe= itb_remove; add_to_queue(pkg); return; - } else if (rok == 0) { + } else if (rok == dep_check_halt) { sincenothing= 0; varbuf_end_str(&raemsgs); notice(_("dependency problems prevent removal of %s:\n%s"), |