+2007-08-08 Guillem Jover <guillem@debian.org>
+
+ * src/cleanup.c (cu_prermdeconfigure): Split call to
+ maintainer_script_installed depending on the conflictor variable.
+ * src/packages.c (dependencies_ok): Remove comment stating that
+ Breaks needs to be implemented.
+ * src/depcon.c (depisok): Likewise. Remove return at the beggining
+ of the function checking for a Breaks dependency, that was
+ efectively making it a no-op in that case.
+ * src/processarc.c (process_archive): Fix indentation. Split calls
+ in deconfigure code to printf and maintainer_script_installed
+ depending on the removing variable.
+
2007-08-07 Guillem Jover <guillem@debian.org>
* src/query.c (listpackages): Instead of allocating an additional
struct pkginfo *conflictor= (struct pkginfo*)argv[1]; /* may be 0 */
struct pkginfo *infavour= (struct pkginfo*)argv[2];
- maintainer_script_installed(deconf,POSTINSTFILE,"post-installation",
- "abort-deconfigure", "in-favour", infavour->name,
- versiondescribe(&infavour->available.version,
- vdew_nonambig),
- conflictor ? "removing" : (char*)0,
- conflictor ? conflictor->name : (char*)0,
- conflictor ? versiondescribe(&conflictor->installed.version,
- vdew_nonambig) : (char*)0,
- (char*)0);
+ if (conflictor) {
+ maintainer_script_installed(deconf, POSTINSTFILE, "post-installation",
+ "abort-deconfigure",
+ "in-favour", infavour->name,
+ versiondescribe(&infavour->available.version,
+ vdew_nonambig),
+ "removing", conflictor->name,
+ versiondescribe(&conflictor->installed.version,
+ vdew_nonambig),
+ (char*)0);
+ } else {
+ maintainer_script_installed(deconf, POSTINSTFILE, "post-installation",
+ "abort-deconfigure",
+ "in-favour", infavour->name,
+ versiondescribe(&infavour->available.version,
+ vdew_nonambig),
+ (char*)0);
+ }
+
deconf->status= stat_installed;
modstatdb_note(deconf);
}
internerr("unknown istobe depending");
}
- if (dep->type == dep_breaks)
- /* We don't implement this and we can only be in this state
- * if either a Breaks-ignorant or a Breaks-supporting dpkg
- * installed the package. In both cases it's probably too
- * late to do anything useful about it now in this version
- * so we just ignore it and hope.
- * FIXME: implement Breaks
- */
- return 1;
-
/* Describe the dependency, in case we have to moan about it. */
varbufreset(whynot);
varbufaddc(whynot, ' ');
debug(dbg_depcon,"checking dependencies of %s (- %s)",
pkg->name, removing ? removing->name : "<none>");
assert(pkg->installed.valid);
- /* To implement Breaks we need to add code here which prevents
- * configuration of Broken packages.
- * FIXME: implement Breaks */
+
for (dep= pkg->installed.depends; dep; dep= dep->next) {
if (dep->type != dep_depends && dep->type != dep_predepends) continue;
debug(dbg_depcondetail," checking group ...");
modstatdb_note(pkg);
}
- for (deconpil= deconfigure; deconpil; deconpil= deconpil->next) {
- struct pkginfo *removing= deconpil->xinfo;
+ for (deconpil= deconfigure; deconpil; deconpil= deconpil->next) {
+ struct pkginfo *removing= deconpil->xinfo;
- printf(removing ?
- _("De-configuring %s, to allow removal of %s ...\n") :
- _("De-configuring %s ...\n"),
- deconpil->pkg->name, removing ? removing->name : 0);
+ if (removing)
+ printf(_("De-configuring %s, to allow removal of %s ...\n"),
+ deconpil->pkg->name, removing->name);
+ else
+ printf(_("De-configuring %s ...\n"), deconpil->pkg->name);
- deconpil->pkg->status= stat_halfconfigured;
- modstatdb_note(deconpil->pkg);
- /* This means that we *either* go and run postinst abort-deconfigure,
- * *or* queue the package for later configure processing, depending
- * on which error cleanup route gets taken.
- */
- push_cleanup(cu_prermdeconfigure,~ehflag_normaltidy,
- ok_prermdeconfigure,ehflag_normaltidy,
- 3,(void*)deconpil->pkg,
- (void*)removing, (void*)pkg);
+ deconpil->pkg->status= stat_halfconfigured;
+ modstatdb_note(deconpil->pkg);
+
+ /* This means that we *either* go and run postinst abort-deconfigure,
+ * *or* queue the package for later configure processing, depending
+ * on which error cleanup route gets taken.
+ */
+ push_cleanup(cu_prermdeconfigure, ~ehflag_normaltidy,
+ ok_prermdeconfigure, ehflag_normaltidy,
+ 3, (void*)deconpil->pkg, (void*)removing, (void*)pkg);
+
+ if (removing) {
+ maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
+ "deconfigure", "in-favour", pkg->name,
+ versiondescribe(&pkg->available.version,
+ vdew_nonambig),
+ "removing", removing->name,
+ versiondescribe(&removing->installed.version,
+ vdew_nonambig),
+ (char*)0);
+ } else {
maintainer_script_installed(deconpil->pkg, PRERMFILE, "pre-removal",
"deconfigure", "in-favour", pkg->name,
versiondescribe(&pkg->available.version,
vdew_nonambig),
- removing ? "removing" : (char*)0,
- removing ? removing->name : (char*)0,
- removing ? versiondescribe(&removing->installed.version,
- vdew_nonambig) : (char*)0,
(char*)0);
}
+ }
for (i = 0 ; i < cflict_index; i++) {
if (!(conflictor[i]->status == stat_halfconfigured ||