diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 108f8f3d..0bea94f8 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -300,9 +300,7 @@ class Install(AtomicOperation): if os.path.exists(fpath + '.old'): os.unlink(fpath + '.old') os.rename(fpath, fpath + '.old') - else: - # old config file not changed, overwrite - pass + # otherwise, old config file not changed, overwrite except pisi.util.FileError, e: pass else: @@ -310,10 +308,14 @@ class Install(AtomicOperation): if file.type == 'config': fpath = pisi.util.join_path(ctx.config.dest_dir(), file.path) if os.path.exists(fpath): # there is an old config file lying around - config_changed.append(fpath) - if os.path.exists(fpath + '.old'): - os.unlink(fpath + '.old') - os.rename(fpath, fpath + '.old') + try: + if pisi.util.sha1_file(fpath) != file.hash: + config_changed.append(fpath) + if os.path.exists(fpath + '.old'): + os.unlink(fpath + '.old') + os.rename(fpath, fpath + '.old') + except pisi.util.FileError, e: + pass self.package.extract_install(ctx.config.dest_dir())