Changeset 1592 for pykota/trunk/setup.py
- Timestamp:
- 07/06/04 11:37:11 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/setup.py
r1522 r1592 24 24 # 25 25 # $Log$ 26 # Revision 1.45 2004/07/06 09:37:01 jalet 27 # Integrated most of the Debian packaging work made by Sergio Gonz�z Gonz�z 28 # 26 29 # Revision 1.44 2004/06/05 22:03:49 jalet 27 30 # Payments history is now stored in database … … 195 198 ACTION_CONTINUE = 0 196 199 ACTION_ABORT = 1 200 201 #ETC_DIR = "./debian/tmp/etc/pykota/" 202 ETC_DIR = "/etc/pykota/" 197 203 198 204 def checkOldModule(path) : … … 256 262 257 263 # checks if a configuration file is present in the new location 258 if not os.path.isfile( "/etc/pykota/pykota.conf") :259 if not os.path.isdir( "/etc/pykota") :264 if not os.path.isfile(os.path.join(ETC_DIR,"pykota.conf")) : 265 if not os.path.isdir(ETC_DIR) : 260 266 try : 261 os.mkdir( "/etc/pykota")267 os.mkdir(ETC_DIR) 262 268 except OSError, msg : 263 sys.stderr.write("An error occured while creating the /etc/pykota directory.\n%s\n" % msg)269 sys.stderr.write("An error occured while creating the etc/pykota directory.\n%s\n" % msg) 264 270 sys.exit(-1) 265 271 … … 271 277 if answer[0:1].upper() == 'Y' : 272 278 try : 273 os.rename("/etc/pykota.conf", "/etc/pykota/pykota.conf")279 os.rename("/etc/pykota.conf", os.path.join(ETC_DIR,"pykota.conf")) 274 280 except OSError : 275 281 sys.stderr.write("ERROR : An error occured while moving /etc/pykota.conf to /etc/pykota/pykota.conf\nAborted !\n") … … 287 293 if answer[0:1].upper() == 'Y' : 288 294 try : 289 shutil.copy("conf/pykota.conf.sample", "/etc/pykota/pykota.conf")290 shutil.copy("conf/pykotadmin.conf.sample", "/etc/pykota/pykotadmin.conf")295 shutil.copy("conf/pykota.conf.sample", os.path.join(ETC_DIR,"pykota.conf")) 296 shutil.copy("conf/pykotadmin.conf.sample", os.path.join(ETC_DIR,"pykotadmin.conf")) 291 297 except IOError, msg : 292 298 sys.stderr.write("WARNING : Problem while installing sample configuration files in /etc/pykota/, please do it manually.\n%s\n" % msg) … … 317 323 from pykota.config import PyKotaConfig,PyKotaConfigError 318 324 try : 319 conf = PyKotaConfig( "/etc/pykota/")325 conf = PyKotaConfig(ETC_DIR) 320 326 except PyKotaConfigError, msg : 321 327 sys.stedrr.write("%s\nINSTALLATION ABORTED !\nPlease restart installation.\n" % msg) … … 375 381 376 382 # change files permissions 377 os.chmod( "/etc/pykota/pykota.conf", 0644)378 os.chmod( "/etc/pykota/pykotadmin.conf", 0640)383 os.chmod(os.path.join(ETC_DIR,"pykota.conf"), 0644) 384 os.chmod(os.path.join(ETC_DIR,"pykotadmin.conf"), 0640) 379 385 380 386 # WARNING MESSAGE … … 420 426 data_files.append((directory, [ mofile ])) 421 427 422 docdir = " /usr/share/doc/pykota"428 docdir = "share/doc/pykota" 423 429 docfiles = ["README", "FAQ", "SECURITY", "COPYING", "LICENSE", "CREDITS", "TODO", "NEWS"] 424 430 data_files.append((docdir, docfiles))