diff options
author | Robert Luberda <robert@debian.org> | 2010-04-15 12:10:21 +0200 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2010-04-15 12:10:21 +0200 |
commit | 29fe363219625f2a411c85ce065ad47a67077797 (patch) | |
tree | cfd597d3bd22c8393e90c22cd379c3f1d306ffba /dselect | |
parent | 8ccebf62ea2940b597e2d66433b1ac00801e1c6b (diff) | |
download | dpkg-29fe363219625f2a411c85ce065ad47a67077797.tar.gz |
dselect: treat unknown packages as known and marked for purge
This is a temporary work-around so that dselect doesn't try to
reinstall packages of priority > standard that were removed or not
installed.
The complete solution (tracked in #551638) will involve storing the
seen/not-seen information somewhere else than in the dpkg status database
and ideally in a new database shared by all frontends.
Diffstat (limited to 'dselect')
-rw-r--r-- | dselect/pkglist.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/dselect/pkglist.cc b/dselect/pkglist.cc index fd90dcf26..6bd7db910 100644 --- a/dselect/pkglist.cc +++ b/dselect/pkglist.cc @@ -398,15 +398,16 @@ packagelist::packagelist(keybindings *kb) : baselist(kb) { pkg->clientdata= 0; continue; } if (!pkg->available.valid) blankpackageperfile(&pkg->available); - state->direct= state->original= pkg->want; - if (readwrite && pkg->want == pkginfo::want_unknown) { + // treat all unknown packages as already seen + state->direct= state->original= (pkg->want == pkginfo::want_unknown ? pkginfo::want_purge : pkg->want); + if (readwrite && state->original == pkginfo::want_unknown) { state->suggested= pkg->status == pkginfo::stat_installed || pkg->priority <= pkginfo::pri_standard /* FIXME: configurable */ ? pkginfo::want_install : pkginfo::want_purge; state->spriority= sp_inherit; } else { - state->suggested= pkg->want; + state->suggested= state->original; state->spriority= sp_fixed; } state->dpriority= dp_must; @@ -455,7 +456,8 @@ void perpackagestate::free(int recursive) { pkg->clientdata= uprec; } else { assert(!recursive); - if (pkg->want != selected) { + if (pkg->want != selected && + !(pkg->want == pkginfo::want_unknown && selected == pkginfo::want_purge)) { pkg->want= selected; } pkg->clientdata= 0; |