[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnue] r8942 - trunk/gnue-common
From: |
jan |
Subject: |
[gnue] r8942 - trunk/gnue-common |
Date: |
Fri, 27 Oct 2006 08:19:01 -0500 (CDT) |
Author: jan
Date: 2006-10-27 08:19:00 -0500 (Fri, 27 Oct 2006)
New Revision: 8942
Removed:
trunk/gnue-common/setup-cvs-win.py
Log:
Remove old setup-cvs-win.py
Deleted: trunk/gnue-common/setup-cvs-win.py
===================================================================
--- trunk/gnue-common/setup-cvs-win.py 2006-10-27 12:13:37 UTC (rev 8941)
+++ trunk/gnue-common/setup-cvs-win.py 2006-10-27 13:19:00 UTC (rev 8942)
@@ -1,711 +0,0 @@
-#!/usr/bin/python
-import sys, string, os, glob
-
-
-BASEDIR = os.path.join(os.getcwd(), '.cvsdevelbase')
-CVSDIR = os.path.abspath(os.getcwd())
-PYTHONBIN=sys.executable
-OS=os.name
-if OS == 'posix':
- OS = 'linux'
-elif OS == 'nt':
- #TODO: maybe some more checks to make sure we're running on >=w2k and NTFS5
- OS = 'win2K'
-else:
- print "Other operating systems than linux and >=Windows 2000"
- print "(NTFS 5) are not supported."
- sys.exit()
-
-
-rootCommands = []
-commandsWin2K = {
- # remove file
- 'removeF': 'del /f /q /s ', # names
- # remove directory
- 'removeD': 'rmdir /s /q ', # names
- # link file
- 'linkF': os.path.join(CVSDIR, 'common\\utils\\fsutil.exe') +
' hardlink create ', # link_name[new_name] target[existing_name]
- # link directory
- 'linkD': os.path.join(CVSDIR, 'common\\utils\\linkd.exe'), #
destination[new_name] source[existing_name]
- 'copy':'copy /y ', # source destination
- 'chmod': 'N/A' # not available
- }
-commandsLinux = {
- 'remove': 'rm -f ', # source
- 'link': 'ln -s ', # target[existing_name] link_name[new_name]
- 'copy':'cp ', # source destination
- 'chmod': 'chmod ' # mode source
- }
-
-
-def exec2(command, parameters, execute = 1):
- if OS == 'linux':
- cmd = commandsLinux[command]
- if parameters:
- parameters = parameters.replace('\\','/')
- else: # OS is windows
- if parameters:
- parameters = parameters.replace('/','\\')
- # special hack for remove command
- if command == 'remove':
- if os.path.isfile(parameters):
- cmd = commandsWin2K['removeF']
- else:
- cmd = commandsWin2K['removeD']
- # special hack for link command
- elif command == 'link':
- params = string.split(parameters,' ',1)
- target = params[0]
- link_name = params[1]
- parameters = link_name + ' ' + target
- if os.path.isfile(target):
- cmd = commandsWin2K['linkF']
- else:
- cmd = commandsWin2K['linkD']
- else:
- cmd = commandsWin2K[command]
- #
- if cmd == 'N/A':
- return
- else:
- if parameters:
- cmd = cmd + ' ' + parameters
- if execute:
- os.system(cmd)
- else:
- return cmd
-
-def createCVS (scriptdir,script,py):
- script = "%s%s" % (script, SUFFIX)
- path = os.path.join(scriptdir, script)
- if OS=='linux':
- py = py.replace('\\','/')
- scriptdir = scriptdir.replace('\\','/')
- path = path.replace('\\','/')
- else:
- py = py.replace('/','\\')
- scriptdir = scriptdir.replace('/','\\')
- path = path.replace('/','\\') + '.bat'
- script = script + '.bat'
- print "Creating %s" % path
- file = open(path,'w')
- file.write(cvsbase % py)
- file.close()
- if OS == 'linux':
- os.system ('chmod 700 %s/%s/%s' % (CVSDIR,scriptdir, script))
- rootCommands.append ('rm -f %s/%s' % (BINDIR, script))
- rootCommands.append ('ln -s %s/%s/%s %s/%s' % \
- (CVSDIR, scriptdir, script, BINDIR, script))
- rootCommands.append ('chmod o+x %s/%s/%s' % (CVSDIR,scriptdir, script))
- else:
- exec2('remove', '%s\%s' % (BINDIR, script)) ##TODO
- exec2('link', '%s/%s/%s %s/%s' % (CVSDIR, scriptdir, script, BINDIR,
script))
-
-
-def createDocs(sgmlfile, destdir):
- sgmlfile = os.path.join(CVSDIR, sgmlfile)
- destdir = os.path.join(DOCDIR, destdir)
- if OS == 'linux':
- rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (destdir,
destdir))
- rootCommands.append("%s --output %s %s" %(DB2HTML, destdir, sgmlfile))
- else:
- os.system("if not exist %s mkdir %s" % (destdir, destdir))
- os.system('%s --output %s %s' % (DB2HTML, destdir, sgmlfile))
-
-
-def getInput(message, default, responseSet=None):
- print ""
- while 1:
- if default != None:
- print "%s [%s] " % (message, default),
- else:
- print "%s " % (message),
-
- val = string.strip(sys.stdin.readline())
- print ""
-
- if not len(val) and default != None:
- return default
- elif responseSet and string.upper(val) in (responseSet):
- return string.upper(val)
- elif not responseSet:
- return val
-
-
-def getYesNo(message, default=None):
- return getInput(message,default,('Y','N')) == 'Y'
-
-
-def getBinPaths():
- paths = string.split(os.environ['PATH'],os.pathsep)
- if OS == 'linux':
- if not ('/usr/local/bin' in paths or '/usr/local/bin/' in paths) and \
- os.path.isdir('/usr/local/bin'):
- paths.append('/usr/local/bin')
- return(paths)
-
-
-# Returns a list containing all Python executables in the user's path.
-# List element 0 will always be the currently running executable
-def findAllPythonExes():
- results = [sys.executable]
-
- for path in getBinPaths():
- for file in glob.glob(os.path.abspath(string.strip(path)) + os.sep \
- + 'python?*'):
- base = os.path.basename(file)
- version = base[6:]
-
- # Do not include python 1.x files
- if version < '2':
- break
-
- if os.path.samefile(file, sys.executable):
- # If this file is the one being executed, just replace w/full name
- if results[0] == sys.executable:
- results[0] = file
- else:
- results.append(file)
-
- return results
-
-
-def finddb2html():
- for path in getBinPaths():
- for file in glob.glob(os.path.abspath(string.strip(path)) + os.sep \
- + 'db2html'):
- return(file)
-
- # Nothing found
- return ""
-
-
-def restartWithExecutable(exe):
- os.system('%s %s --withNewExecutable "%s"' \
- % (exe, sys.argv[0], string.join(sys.argv[1:],'" "')))
- sys.exit()
-
-
-# end of function definitions
-
-restarting = ('--withNewExecutable' in sys.argv)
-
-if not restarting:
- print """
-GNU Enterprise Developer Setup
-
-This script will install the GNU Enterprise tools to run
-from a CVS copy. This allows GNUe to be run without a
-full installation. THIS IS PRIMARILY USEFUL TO DEVELOPERS.
- """
-
-# First of all, make sure this is a current enough Python release.
-try:
- if sys.hexversion < 0x02000000:
- raise AttributeError
-except AttributeError:
-
- print "-" * 70
- print """
- You are running Python %s.
-
- GNU Enterprise requires at least Python 2.0 (recommended: 2.1+).
- If you have a later version installed, you should run setup.py
- against that version. For example, if you have Python 2.1
- installed, you may need to run:
-
- python2.1 %s
-""" % (string.split(sys.version)[0], sys.argv[0])
- print "-" * 70
-
- if OS=='linux':
- exes = findAllPythonExes()
-
- if len(exes) == 1:
- sys.exit()
- else:
-
- # There are better versions of Python installed...
-
- exes.pop(0)
- print "\n"
- print "I have found the following Python executables. "
- print "Choose another version of Python to run."
- print ""
-
- validOptions = []
- i = 0
-
- for file in exes:
- i = i + 1 # Do not change this to i += 1 as that's >= py2.x
- validOptions.append(str(i))
- print " [%s] %s" % (i, file)
-
- validOptions.append ('Q')
- selection = getInput(
- "Please enter the number of the Python executable to\n"
- 'use [1-%s] or enter "q" to quit.' % i, '1', validOptions)
-
- if selection == 'Q':
- sys.exit()
-
- restartWithExecutable(exes[int(selection)-1])
-
- else: #we do not have linux
- sys.exit()
-
-
-if not restarting:
-
- print """
-If you are trying to install GNU Enterprise for production
-use, then answer 'N' to the following question and install
-each tool separately using it's setup.py script.
- """
-
- if not getYesNo("Continue installing the CVS-runnable tools? "):
- sys.exit()
-
- exes = [sys.executable]
-
- if OS=='linux':
- exes = findAllPythonExes()
- PYTHONBIN=exes[0]
-
-
- # Make sure they are running against the version of python they intended
- if len(exes) > 1:
-
- print "\n"
- print "I have found the following Python executables. Please"
- print "choose the Python installation you would like to use."
- print ""
-
- validOptions = []
- i = 0
-
- for file in exes:
- i = i + 1 # Do not change this to i += 1 as that's >= py2.x
- validOptions.append(str(i))
- if i == 1:
- print " [%s] %s (Current)" % (i, file)
- else:
- print " [%s] %s" % (i, file)
-
- validOptions.append ('Q')
- selection = getInput(
- "Please enter the number of the Python executable to\n"
- 'use [1-%s] or enter "q" to quit.' % i, '1', validOptions)
-
- if selection == 'Q':
- sys.exit()
-
- if selection != '1':
- restartWithExecutable(exes[int(selection)-1])
-
-print
-print "Continuing with the CVS installation...\n"
-
-
-
-# checking for existance of link creating tools for Windows
-if OS=='win2K':
- if not (os.path.isfile('common\\utils\\fsutil.exe') and
- os.path.isfile('common\\utils\\linkd.exe')):
- print "This script requires you to have"
- print " common\\utils\\fsutil.exe - to create file links"
- print " common\\utils\\linkd.exe - to create folder links"
- print "You must have them before continuing installing GNUe"
- print "See common\\utils\\win-links.txt for details."
- sys.exit()
-
-if (OS!='linux' and OS!='win2K'):
- print "This CVS setup script will currently only install on a POSIX-based"
- print "system (Linux) or on >Windows 2000 (if NTFS 5 is used). To install"
- print "on non-POSIX or not NTFS 5 systems, you will have to install each"
- print "individual tool using it's 'setup.py install' script."
- sys.exit()
-
-
-if OS=='linux':
- print """
- This setup script can install GNUe as either a local (per user)
- copy or a system-wide copy. If you are unsure, choose the
- recommended 'Local' setting. Installing system-wide will require
- the root password and may force all users on this machine to use
- your copy.
- """
-
- ROOTINSTALL = getInput(
- "Perform a [L]ocal/per-user or a [S]ystem-wide install?",'L', \
- ('L','S')) == 'S'
-
-else:
- print """
- To use this script you should have administrator privilegies (to create
- file links).
- Also, note that you are not advised simply to delete GNUe installation
- folder - because explorer and other programs still make no difference
- whether it is a link or original folder - they delete both of them.
- """
- ROOTINSTALL = 1 ##TODO: implement administrator's script
-
-
-
-if ROOTINSTALL:
- if OS=='linux':
- BINDIR = "/usr/local/bin"
- CONFDIR = "/usr/local/gnue"
- DOCDIR = "/usr/share/doc/gnue"
- else:
- ## TODO: disk name hardcoded for now
- BINDIR = "C:\\Program Files\\GNUe\\bin"
- CONFDIR = "C:\\Program Files\\GNUe\\conf"
- DOCDIR = "C:\\Program Files\\GNUe\\docs"
-else:
- BINDIR = os.path.expanduser("~/bin")
- CONFDIR = os.path.expanduser("~/gnue")
- DOCDIR = os.path.expanduser("~/gnue/docs")
-
-
-while 1:
- BINDIR = os.path.abspath(
- getInput ("Where shall I put executable files?", BINDIR))
-
- if os.path.isdir(BINDIR) or \
- getYesNo("Directory %s does not exist. Create?" % BINDIR, 'Y'):
- break
-
-print """
-If you maintain multiple GNUe CVS installations, you may
-wish to add a suffix to the script names. For example, if
-are installing the 0.1.x branch as a secondary branch, you
-may want all the executables to be named as <script>-0.1. To
-do this, enter '-0.1' at the next prompt. Normally, you will
-leave the following option blank."""
-
-SUFFIX = string.strip(getInput ("String to append to script names:",None))
-
-while 1:
- CONFDIR = os.path.abspath(
- getInput ("Where shall I put configuration files?", CONFDIR))
-
- if os.path.isdir(CONFDIR) or \
- getYesNo("Directory %s does not exist. Create?" % CONFDIR, 'Y'):
- break
-
-newdirs = [BINDIR, CONFDIR, CONFDIR + os.sep + 'etc', CONFDIR + os.sep \
- + 'shared']
-
-willInstallDocs = 0
-
-DB2HTML = finddb2html();
-if DB2HTML:
- if getYesNo("Generate and install documentation? (This could be slow.)",
'N'):
- willInstallDocs = 1
- while 1:
- DOCDIR = os.path.abspath(
- getInput ("Where shall I put the documentation files?", DOCDIR))
-
- if os.path.isdir(DOCDIR) or \
- getYesNo("Directory %s does not exist. Create?" % DOCDIR, 'Y'):
- newdirs.append(DOCDIR)
- break
-else:
- print "Cannot generate documentation, could not find db2html in path\n";
-
-
-if OS == 'linux':
- ######### fixing bugs created by changed installer ###########
- # remove "%s/shared/grpc" % CONFDIR link
- if os.path.islink("%s/shared/grpc" % CONFDIR):
- rootCommands.append("rm %s/shared/grpc" % CONFDIR)
-
- # remove "%s/shared/grpc" % CVSDIR link
- if os.path.islink("%s/appserver/grpc/GEAS.grpc" % CVSDIR):
- rootCommands.append("rm %s/appserver/grpc/GEAS.grpc" % CVSDIR)
- ##############################################################
-else:
- pass ##TODO
-
-for dir in newdirs:
- if OS == 'linux':
- rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (dir,dir))
- else:
- os.system("if not exist %s mkdir %s" % (dir, dir))
-
-
-GNUEDIR = os.path.join(BASEDIR,'gnue')
-
-if OS=='linux':
- cvsbase = """#!/bin/sh
- if [ "z$GNUE_CONNECTIONS" = "z" ]
- then
- if [ -f %(CONFDIR)s/etc/connections.conf ]
- then
- GNUE_CONNECTIONS=%(CONFDIR)s/etc/connections.conf
- export GNUE_CONNECTIONS
- fi
- fi
- PYTHONPATH=%(BASEDIR)s:$PYTHONPATH; export PYTHONPATH
- %(PYTHONBIN)s %(GNUEDIR)s/%%s "$@"
- """ % globals()
-else:
- cvsbase = '@echo off\n'
- # awful hack to have "%PATH%" in final .bat file
- cvsbase = cvsbase + 'set PATH=%%PATH%%;' + BASEDIR + '\n'
- # set PATH=%%PATH%%;%(BASEDIR)s
- cvsbase = cvsbase + '%(PYTHONBIN)s %(GNUEDIR)s\%%s' % globals()
-
-
-# especially for Windows python
-# this leaves us with only one possible GNUE installation
-# but i don't know how to enter gnue modules into python's
-# search path for Windows
-exec2('link', '%s\gnue %s\lib\gnue' % (BASEDIR, sys.prefix))
-
-if os.path.isdir(os.path.join(GNUEDIR,'gnue')):
- exec2('remove', '%s' % GNUEDIR)
-
-
-os.makedirs(GNUEDIR + os.sep + 'gnue')
-
-# create path.py
-output = open ("%s/paths.py" % GNUEDIR, "w")
-output.write ("# This file was generated by setup-cvs.py.\n")
-output.write ("\n")
-output.write ("lib = \"%s\"\n" % GNUEDIR)
-output.write ("scripts = \"%s\"\n" % BINDIR)
-output.write ("data = \"%s\"\n" % CONFDIR)
-output.write ("config = \"%s/etc\"\n" % CONFDIR)
-output.close ()
-
-os.chdir(GNUEDIR)
-exec2('link', CVSDIR + '/common/gnue/__init__.py __init__.py')
-exec2('link', CVSDIR + '/common/src common')
-if os.path.isfile(CVSDIR + os.sep + 'common' + os.sep + 'src' + os.sep +
'.GDTD.py'):
- os.remove(CVSDIR + os.sep + 'common' + os.sep + 'src' + os.sep + '.GDTD.py')
-exec2('link', '%s/common/scripts/gnuedtd %s/common/src/.GDTD.py' % (CVSDIR,
CVSDIR))
-exec2('link', CVSDIR + '/forms/src forms')
-exec2('link', CVSDIR + '/navigator/src navigator')
-exec2('link', CVSDIR + '/designer/src designer')
-currdir = os.getcwd()
-os.chdir(os.getcwd() + os.sep + 'designer')
-exec2('link', CVSDIR + '/designer/templates templates')
-os.chdir(currdir)
-exec2('link', CVSDIR + '/reports/src reports')
-currdir = os.getcwd()
-os.chdir(os.getcwd() + os.sep + 'reports')
-exec2('link', CVSDIR + '/reports/adapters adapters')
-exec2('link', CVSDIR + '/reports/filters filters')
-os.chdir(currdir)
-exec2('link', CVSDIR + '/appserver/src appserver')
-
-if OS=='linux':
- rootCommands.append("""
- cd %(CONFDIR)s/etc
- rm -f sample.*
- ln -s %(CVSDIR)s/common/etc/sample.* .
-
- cd %(CONFDIR)s/shared
- rm -f images filters
-
- ln -s %(CVSDIR)s/common/images %(CONFDIR)s/shared/images
- ln -s %(CVSDIR)s/reports/filters %(CONFDIR)s/shared/filters
-
- cd %(CONFDIR)s
- ln -s %(CVSDIR)s/common/translations .
-## optimization changes
-## rm -f ?? ??_??
-## ln -s %(CVSDIR)s/common/translations/?? %(CONFDIR)s/translations/
-## ln -s %(CVSDIR)s/common/translations/??_?? %(CONFDIR)s/translations/
- """ % globals() )
-else:
- os.chdir(CONFDIR + os.sep + 'etc')
- exec2('remove', 'sample.*') ##TODO: does not work
- exec2('link', CVSDIR + '/common/etc/sample.gnue.conf sample.gnue.conf')
- exec2('link', CVSDIR + '/common/etc/sample.connections.conf
sample.connections.conf')
- exec2('link', CVSDIR + '/common/etc/sample.report-filters.conf
sample.report-filters.conf')
-
-
- os.chdir(CONFDIR + os.sep + 'shared')
- exec2('remove', 'images')
- exec2('remove', 'filters')
-
- exec2('link', CVSDIR + '/common/images ' + CONFDIR + '/shared/images')
- exec2('link', CVSDIR + '/reports/filters ' + CONFDIR + '/shared/filters')
-
- os.chdir(CONFDIR)
- exec2('link', CVSDIR + '/common/translations translations')
-## exec('remove', '??_??')
-## exec('link', CVSDIR + '/common/translations/?? ' + CONFDIR +
'/translations/')
-## exec('link', CVSDIR + '/common/translations/??_?? ' + CONFDIR +
'/translations/')
-
-os.chdir(CVSDIR)
-createCVS ('forms/scripts','gfcvs','forms/GFClient.py')
-createCVS ('reports/scripts','grcvs','reports/GRRun.py')
-createCVS ('reports/scripts','grdcvs','reports/GRServer.py')
-createCVS ('designer/scripts','gfdes','designer/Designer.py')
-createCVS ('navigator/scripts','gncvs','navigator/GNClient.py')
-createCVS ('common/scripts','gtestcvs','common/GTest.py')
-createCVS ('common/scripts','gdtdcvs','common/.GDTD.py')
-createCVS ('appserver/scripts','gacvs','appserver/geasRpcServer.py')
-
-if willInstallDocs:
- createDocs('docbook/GNUEnterprise/main.sgml', 'GNUEnterprise')
- createDocs('docbook/DevelopersIntroduction/main.sgml',
- 'DevelopersIntroduction')
- createDocs('docbook/GDAQuickHackersGuide/main.sgml',
- 'GDAQuickHackersGuide')
- createDocs('docbook/GNUeFormsTechRef/main.sgml', 'GNUeFormsTechRef')
- createDocs('docbook/GNUeModuleGuide/main.sgml', 'GNUeModuleGuide')
- createDocs('docbook/GNUeObjectServer/main.sgml',
- 'GNUeObjectServer')
-
-willCreateConf = 0
-willCreateConn = 0
-willCreateFilt = 0
-
-
-if ((OS=='linux') and (CONFDIR!='/usr/local/gnue') and \
- (os.path.isfile('/usr/local/gnue/etc/gnue.conf'))) \
- or \
- ((OS=='win2K') and (CONFDIR!='C:\\Program Files\\GNUe') and \
- (os.path.isfile('C:\\Program Files\\GNUe\\etc\\gnue.conf'))):
- if getYesNo('Do you wish to use the current system-wide gnue.conf file?',
'N'):
- if OS=='linux':
- rootCommands.append("ln -s /usr/local/gnue/etc/gnue.conf \
- %(CONFDIR)s/etc/gnue.conf" % globals())
- else:
- exec2('link', 'C:\\Program Files\\GNUe\\etc\\gnue.conf
%(CONFDIR)s\\etc\\gnue.conf' \
- % globals())
-
- willCreateConf = 1
-
-
-if ((OS=='linux') and (CONFDIR!='/usr/local/gnue') and \
- (os.path.isfile('/usr/local/gnue/etc/connections.conf'))) \
- or \
- ((OS=='win2K') and (CONFDIR!='C:\\Program Files\\GNUe') and \
- (os.path.isfile('C:\\Program Files\\GNUe\\etc\\connections.conf'))):
- if getYesNo('Do you wish to use the current system-wide connections.conf
file?','Y'):
- if OS=='linux':
- rootCommands.append("ln -s /usr/local/gnue/etc/connections.conf \
- %(CONFDIR)s/etc/connections.conf" % globals())
- else:
- exec2('link', 'C:\\Program Files\\GNUe\\etc\\connections.conf \
- %(CONFDIR)s\\etc\\connections.conf' % globals())
- willCreateConn = 1
-
-
-if ((OS=='linux') and (CONFDIR!='/usr/local/gnue') and \
- (os.path.isfile('/usr/local/gnue/etc/report-filters.conf'))) \
- or \
- ((OS=='win2K') and (CONFDIR!='C:\\Program Files\\GNUe') and \
- (os.path.isfile('C:\\Program Files\\GNUe\\etc\\report-filters.conf'))):
- if getYesNo('Do you wish to use the current system-wide
report-filters.conf file?', 'N'):
- if OS=='linux':
- rootCommands.append("ln -s /usr/local/gnue/etc/report-filters.conf \
- %(CONFDIR)s/etc/report-filters.conf" % globals())
- else:
- exec2('link', 'C:\\Program Files\\GNUe\\etc\\report-filters.conf' \
- '%(CONFDIR)s\\etc\\report-filters.conf' % globals())
- willCreateFilt = 1
-
-if not willCreateConf and not os.path.isfile("%s/etc/gnue.conf"%CONFDIR):
- print ""
- print "You do not currently have a gnue.conf tools configuration file."
- if getYesNo("Do you want to create a gnue.conf based on the supplied
examples?",'Y'):
- print "Since the gnue.conf file format may change from time to time in
CVS,"
- print "we can create a symlinked gnue.conf file that always mirrors CVS.
This"
- print "will not allow you to customize gnue.conf, however."
- if getYesNo ("Do you want to use a symlinked gnue.conf file?",'N'):
- exec2('link', '%(CVSDIR)s/common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf' % globals())
- else:
- if OS == 'linux':
- command = "cp %(CVSDIR)s/common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals()
- rootCommands.append(command)
- else:
- exec2('copy', '%(CVSDIR)s/common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf' % globals())
-
-if not willCreateConn and not \
-os.path.isfile(CONFDIR + os.sep + 'etc' + os.sep + 'connections.conf'):
- print ""
- print "You do not currently have a connections.conf configuration file."
- if getYesNo("Do you want to create a connections.conf based on the supplied
examples?",'Y'):
- if OS=='linux':
- rootCommands.append("cp %(CVSDIR)s/common/etc/sample.connections.conf
%(CONFDIR)s/etc/connections.conf" % globals())
- else:
- exec2('copy', '%(CVSDIR)s/common/etc/sample.connections.conf
%(CONFDIR)s/etc/connections.conf' % globals())
-
- print
- print "NOTE: Your connections.conf file will need to"
- print " be edited to reflect your local setup."
- print
-
-if not willCreateConf and not \
-os.path.isfile(CONFDIR + os.sep + 'etc' + os.sep + 'report-filters.conf'):
- print ""
- print "You do not currently have a report-filters.conf configuration file."
- if getYesNo("Do you want to create a report-filters.conf based on the
supplied examples?",'Y'):
- print "Since the report-filters.conf file format may change from time to
time in CVS,"
- print "we can create a symlinked report-filters.conf file that always
mirrors CVS. This"
- print "will not allow you to customize report-filters.conf, however."
- if getYesNo ("Do you want to use a symlinked report-filters.conf
file?",'N'):
- command = 'copy'
- else:
- command = 'link'
-
- if OS=='linux':
- if command == 'copy':
- rootCommands.append("cp
%(CVSDIR)s/common/etc/sample.report-filters.conf \
- %(CONFDIR)s/etc/report-filters.conf" % globals())
- else:
- rootCommands.append("ln -s
%(CVSDIR)s/common/etc/sample.report-filters.conf \
- %(CONFDIR)s/etc/report-filters.conf" % globals())
- else:
- if command == 'copy':
- exec2('copy', '%(CVSDIR)s\\common\\etc\\sample.report-filters.conf \
- %(CONFDIR)s\\etc\\report-filters.conf' % globals())
- else:
- exec2('link', '%(CVSDIR)s\\common\\etc\\sample.report-filters.conf \
- %(CONFDIR)s\\etc\\report-filters.conf' % globals())
-
-
-
-if ROOTINSTALL and OS=='linux':
-
- out = open("setup-root.sh",'w')
- out.write("#!/bin/sh\n")
- out.write(string.join(rootCommands,"\n"))
- out.write("\n")
- out.close()
-
- print ""
- print "All the commands that need to be run as root have been written"
- print "to setup-root.sh . In order for your setup to be complete, this"
- print "file must be run. This setup script can run setup-root.sh for"
- print "you. If you choose to run the script now and are not currently"
- print "logged in as root, you will be prompted for the root password."
-
- if getYesNo('Run "/bin/sh setup-root.sh" as root?','Y'):
- os.system('su root -c "/bin/sh setup-root.sh"')
- else:
- print ""
- print 'Do not forget to run "/bin/sh setup-root.sh" as root'
- print ""
-
-
-elif not ROOTINSTALL and OS=='linux':
-
- out = open("setup.log",'w')
- out.write(string.join(rootCommands,"\n"))
- out.write("\n")
- out.close()
-
- os.system(string.join(rootCommands,'\n'))
-
-else:
- pass #just for nice if statement
-
-print '\nInstallation finished successfully\n\n'
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnue] r8942 - trunk/gnue-common,
jan <=