From 2641e21cc9f9f6b229f2e286b32460824c10c9e2 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Tue, 29 Aug 2006 12:51:00 +0000 Subject: [PATCH] * on second thought, these are the same!! --- pisi/atomicoperations.py | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 74057cee..53e1132e 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -292,26 +292,13 @@ class Install(AtomicOperation): old_fileinfo[str(fileinfo.path)] = fileinfo for path in leftover: Remove.remove_file( old_fileinfo[path] ) - - if self.reinstall: - # get 'config' typed file objects - new = filter(lambda x: x.type == 'config', self.files.list) - old = filter(lambda x: x.type == 'config', self.old_files.list) - # get config path lists - newconfig = set(map(lambda x: str(x.path), new)) - oldconfig = set(map(lambda x: str(x.path), old)) - - config_overlaps = newconfig & oldconfig - if config_overlaps: - files = filter(lambda x: x.path in config_overlaps, old) - for file in files: - check_config_changed(file) - else: - for file in self.files.list: - if file.type == 'config': - # there may be left over config files - check_config_changed(file) + # You either upgrade/downgrade or install a new package, controls are same. + # If a 'config' typed file coming from the package and the same file + # already exists on the system, it is either a left over from a previously + # uninstalled package or it is upgraded package's currently used config file. + for file in filter(lambda x: x.type == 'config', self.files.list): + check_config_changed(file) self.package.extract_install(ctx.config.dest_dir())