summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2007-09-18 11:34:23 +0300
committerGuillem Jover <guillem@debian.org>2007-09-18 11:34:23 +0300
commit826db4452b743ddf206662dc17cec5f097836933 (patch)
treebbd5dfb490d45bd003160eeacec903bd467e4808 /src
parent07d95556ecc863d969e4c9ac09d398c55c37b082 (diff)
downloaddpkg-826db4452b743ddf206662dc17cec5f097836933.tar.gz
Remove duplicate nested conditional and move its cotents to the outer one
Diffstat (limited to 'src')
-rw-r--r--src/remove.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/remove.c b/src/remove.c
index b0fea250e..09d5c14e1 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 ... */
}