From 1d3f7b2f5245229efe462c97245ad2d5c31c5af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Tue, 22 May 2007 16:02:37 +0000 Subject: [PATCH] pisi.conf varsa yazma --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index c58cdb7f..a2141ef8 100755 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ class Install(install): self.installi18n() self.installdoc() self.generateConfigFile() - + def installi18n(self): for name in os.listdir('po'): if not name.endswith('.po'): @@ -49,7 +49,7 @@ class Install(install): os.makedirs(destpath) os.chdir('doc') for pdf in glob.glob('*.pdf'): - print 'Installing', pdf + print 'Installing', pdf shutil.copy(pdf, os.path.join(destpath, pdf)) os.chdir('..') @@ -58,7 +58,12 @@ class Install(install): destpath = os.path.join(self.root, "etc/pisi/") if not os.path.exists(destpath): os.makedirs(destpath) - pisiconf = open(os.path.join(destpath, "pisi.conf"), "w") + + confFile = os.path.join(destpath, "pisi.conf") + if os.path.isfile(confFile): # Don't overwrite existing pisi.conf + return + + pisiconf = open(confFile, "w") klasses = inspect.getmembers(pisi.configfile, inspect.isclass) defaults = [klass for klass in klasses if klass[0].endswith('Defaults')]