+2006-04-10 Andrew Suffield <asuffield@debian.org>
+
+ * src/main.h (clearselections): New prototype.
+ * src/main.c (usage): Print '--clear-selections' option description.
+ (cmdinfos): Add clear-selectons action.
+ * src/select.c (clearselections): New function.
+
2006-04-10 Guillem Jover <guillem@debian.org>
* src/main.h (fc_autoselect): Remove.
* Document that 'dpkg --get-selections' and 'dpkg-query -l' without a
pattern will not list packages in state purge. Closes: #355633
* Obsolete force/refuse 'auto-select' dpkg option.
+ * Add new '--clear-selections' option to dpkg (Andrew Suffield).
+ Closes: #112388
[ Christian Perrier ]
*
deinstall or purge. Blank lines and comment lines beginning with '#'
are also permitted.
.TP
+.B dpkg \-\-clear\-selections
+Set the requested state of every non-essential package to deinstall.
+This is intended to be used immediately before \-\-set\-selections, to
+deinstall any packages not in list given to \-\-set\-selections.
+.TP
.B dpkg \-\-yet\-to\-unpack
Searches for packages selected for installation, but which for some
reason still haven't been installed.
+2006-04-10 Andrew Suffield <asuffield@debian.org>
+
+ * C/dpkg.1: Document the new '--clear-selections' option.
+
2006-04-10 Guillem Jover <guillem@debian.org>
* C/dpkg.1: Remove mention of obsolete force/refuse 'auto-select'
" -P|--purge <package-name> ... | -a|--pending\n"
" --get-selections [<pattern> ...] Get list of selections to stdout.\n"
" --set-selections Set package selections from stdin.\n"
+" --clear-selections Deselect every non-essential package.\n"
" --update-avail <Packages-file> Replace available packages info.\n"
" --merge-avail <Packages-file> Merge with info from file.\n"
" --clear-avail Erase existing available info.\n"
ACTIONBACKEND( "status", 's', DPKGQUERY),
ACTION( "get-selections", 0, act_getselections, getselections ),
ACTION( "set-selections", 0, act_setselections, setselections ),
+ ACTION( "clear-selections", 0, act_clearselections, clearselections ),
ACTIONBACKEND( "print-avail", 'p', DPKGQUERY),
ACTION( "update-avail", 0, act_avreplace, updateavailable ),
ACTION( "merge-avail", 0, act_avmerge, updateavailable ),
act_unpackchk, act_status, act_searchfiles, act_audit, act_listfiles,
act_assertpredep, act_printarch, act_predeppackage, act_cmpversions,
act_printinstarch, act_compareversions, act_printavail, act_avclear,
- act_forgetold, act_getselections, act_setselections,
+ act_forgetold,
+ act_getselections, act_setselections, act_clearselections,
act_assertepoch, act_assertlongfilenames, act_assertmulticonrep,
act_commandfd };
void getselections(const char *const *argv);
void setselections(const char *const *argv);
+void clearselections(const char *const *argv);
/* from packages.c, remove.c and configure.c */
varbufreset(&namevb);
varbufreset(&selvb);
}
+
+void clearselections(const char *const *argv)
+{
+ struct pkgiterator *it;
+ struct pkginfo *pkg;
+
+ if (*argv)
+ badusage(_("--clear-selections does not take any argument"));
+
+ modstatdb_init(admindir, msdbrw_write);
+
+ it = iterpkgstart();
+ while ((pkg = iterpkgnext(it))) {
+ if (!pkg->installed.essential)
+ pkg->want = want_deinstall;
+ }
+ iterpkgend(it);
+
+ modstatdb_shutdown();
+}
+