From 826db4452b743ddf206662dc17cec5f097836933 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Tue, 18 Sep 2007 11:34:23 +0300 Subject: [PATCH] Remove duplicate nested conditional and move its cotents to the outer one --- ChangeLog | 5 +++++ src/remove.c | 19 ++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index b76379c6..5114391a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-18 Guillem Jover + + * src/remove.c (deferred_remove): Remove duplicate nested conditional, + and move its contents to the outer one. + 2007-09-14 Brian M. Carlson * src/remove.c (deferred_remove): Store the previous package status diff --git a/src/remove.c b/src/remove.c index b0fea250..09d5c14e 100644 --- a/src/remove.c +++ b/src/remove.c @@ -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 ... */ } -- 2.39.5