From 624059f662efd03ff296328d7e384f7087606831 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Wed, 26 Nov 2014 05:42:23 +0200 Subject: [PATCH] update setup --- setup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 83a4ffa5..b67d23c6 100755 --- a/setup.py +++ b/setup.py @@ -31,6 +31,8 @@ from slpkg.__metadata__ import ( __email__, __author__ ) +from slpkg.checksum import md5sum + try: from setuptools import setup @@ -93,5 +95,12 @@ if "install" in sys.argv: if not os.path.exists(conf_path): os.system("mkdir -p {0}".format(conf_path)) for conf in conf_file: - print("Installing '{0}' file".format(conf.split("/")[-1])) - shutil.copy2(conf, conf_path) + filename = conf.split("/")[-1] + print("Installing '{0}' file".format(filename)) + if os.path.isfile(conf_path + filename): + old = md5sum(conf_path + filename) + new = md5sum(conf) + if old != new: + shutil.copy2(conf, conf_path + filename + ".new") + else: + shutil.copy2(conf, conf_path)