* Symlink changes are special. Handle with care and Avril is so beautiful.
This commit is contained in:
@@ -260,9 +260,18 @@ class Install(AtomicOperation):
|
|||||||
|
|
||||||
config_changed = []
|
config_changed = []
|
||||||
def check_config_changed(config):
|
def check_config_changed(config):
|
||||||
|
changed = False
|
||||||
fpath = pisi.util.join_path(ctx.config.dest_dir(), config.path)
|
fpath = pisi.util.join_path(ctx.config.dest_dir(), config.path)
|
||||||
if os.path.exists(fpath) and not os.path.isdir(fpath):
|
if os.path.exists(fpath) and not os.path.isdir(fpath):
|
||||||
|
if os.path.islink(fpath):
|
||||||
|
file = os.readlink(fpath)
|
||||||
|
if os.path.exists(file) and pisi.util.sha1_data(file) != config.hash:
|
||||||
|
changed = True
|
||||||
|
else:
|
||||||
if pisi.util.sha1_file(fpath) != config.hash:
|
if pisi.util.sha1_file(fpath) != config.hash:
|
||||||
|
changed = True
|
||||||
|
|
||||||
|
if changed:
|
||||||
config_changed.append(fpath)
|
config_changed.append(fpath)
|
||||||
if os.path.exists(fpath + '.old'):
|
if os.path.exists(fpath + '.old'):
|
||||||
os.unlink(fpath + '.old')
|
os.unlink(fpath + '.old')
|
||||||
|
|||||||
Reference in New Issue
Block a user