diff options
author | Guillem Jover <guillem@debian.org> | 2007-09-18 11:34:23 +0300 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2007-09-18 11:34:23 +0300 |
commit | 826db4452b743ddf206662dc17cec5f097836933 (patch) | |
tree | bbd5dfb490d45bd003160eeacec903bd467e4808 /src | |
parent | 07d95556ecc863d969e4c9ac09d398c55c37b082 (diff) | |
download | dpkg-826db4452b743ddf206662dc17cec5f097836933.tar.gz |
Remove duplicate nested conditional and move its cotents to the outer one
Diffstat (limited to 'src')
-rw-r--r-- | src/remove.c | 19 |
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 ... */ } |