]> err.no Git - dpkg/commitdiff
Fix Breaks commit.
authorGuillem Jover <guillem@debian.org>
Wed, 8 Aug 2007 01:57:16 +0000 (04:57 +0300)
committerGuillem Jover <guillem@debian.org>
Wed, 8 Aug 2007 01:57:16 +0000 (04:57 +0300)
Enable depisok for the Breaks case. Remove comments stating Breaks needs to
be implemented. And split functions calls which had different arguments
depending on a variable.

ChangeLog
src/cleanup.c
src/depcon.c
src/packages.c
src/processarc.c

index cde65a76cd59db5c1e85653c1acd35cca7800fa8..41a56ee722bf55bf74939e530b5691d0b4e359fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+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
index 6a96836f3dc8f0cf91135ba9f285a8708376932e..096199298d1ca5cc8a2f8df92a0ae1c8ed3dc758 100644 (file)
@@ -132,15 +132,25 @@ void cu_prermdeconfigure(int argc, void **argv) {
   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);
 }
index 24f93aea3126492a80190851ae949b1d54adf521..5f7f28544ed543ce7d679d51f7417a81b3e84569 100644 (file)
@@ -243,16 +243,6 @@ int depisok(struct dependency *dep, struct varbuf *whynot,
     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, ' ');
index ebbd5a90f8c7daa5ba210bb4c8353f6d6c05e6c5..467a6d48836de43ae2d279b118736f8317914151 100644 (file)
@@ -425,9 +425,7 @@ int dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
   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 ...");
index 31f28e9492ba0e324d8a324e779462be9e30215e..4c1d0573f91f5b0af8d3e7dd83eb425ffcef1475 100644 (file)
@@ -398,34 +398,43 @@ void process_archive(const char *filename) {
     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 ||