]> err.no Git - dpkg/commitdiff
Remove duplicate nested conditional and move its cotents to the outer one
authorGuillem Jover <guillem@debian.org>
Tue, 18 Sep 2007 08:34:23 +0000 (11:34 +0300)
committerGuillem Jover <guillem@debian.org>
Tue, 18 Sep 2007 08:34:23 +0000 (11:34 +0300)
ChangeLog
src/remove.c

index b76379c68a0dd25aae03cf2422944b3659dccb21..5114391a3fb26c5619c5a27072c49d4cf84e5e50 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-18  Guillem Jover  <guillem@debian.org>
+
+       * src/remove.c (deferred_remove): Remove duplicate nested conditional,
+       and move its contents to the outer one.
+
 2007-09-14  Brian M. Carlson  <sandals@crustytoothpaste.ath.cx>
 
        * src/remove.c (deferred_remove): Store the previous package status
index b0fea250ef907f12eeae17d491dcfa98b722cf4c..09d5c14e1ca64428fcc3d934abf5b46ccc11a57e 100644 (file)
@@ -164,18 +164,15 @@ void deferred_remove(struct pkginfo *pkg) {
   printf(_("Removing %s ...\n"),pkg->name);
   log_action("remove", pkg);
   if (pkg->status == stat_halfconfigured || pkg->status == stat_installed) {
+    static enum pkgstatus oldpkgstatus;
 
-    if (pkg->status == stat_installed || pkg->status == stat_halfconfigured) {
-      static enum pkgstatus oldpkgstatus;
-
-      oldpkgstatus= pkg->status;
-      pkg->status= stat_halfconfigured;
-      modstatdb_note(pkg);
-      push_cleanup(cu_prermremove, ~ehflag_normaltidy, 0, 0, 2,
-                   (void *)pkg, (void *)&oldpkgstatus);
-      maintainer_script_installed(pkg, PRERMFILE, "pre-removal",
-                                  "remove", NULL);
-    }
+    oldpkgstatus= pkg->status;
+    pkg->status= stat_halfconfigured;
+    modstatdb_note(pkg);
+    push_cleanup(cu_prermremove, ~ehflag_normaltidy, 0, 0, 2,
+                 (void *)pkg, (void *)&oldpkgstatus);
+    maintainer_script_installed(pkg, PRERMFILE, "pre-removal",
+                                "remove", NULL);
 
     pkg->status= stat_unpacked; /* Will turn into halfinstalled soon ... */
   }