[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gnue-common setup-cvs.py
From: |
Jason Cater |
Subject: |
gnue-common setup-cvs.py |
Date: |
Thu, 25 Sep 2003 21:07:46 -0400 |
CVSROOT: /cvsroot/gnue
Module name: gnue-common
Branch:
Changes by: Jason Cater <address@hidden> 03/09/25 21:07:46
Modified files:
. : setup-cvs.py
Log message:
Added a new per-module cvs setup system
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue-common/setup-cvs.py.diff?tr1=1.54&tr2=1.55&r1=text&r2=text
Patches:
Index: gnue-common/setup-cvs.py
diff -c gnue-common/setup-cvs.py:1.54 gnue-common/setup-cvs.py:1.55
*** gnue-common/setup-cvs.py:1.54 Thu Sep 25 19:23:57 2003
--- gnue-common/setup-cvs.py Thu Sep 25 21:07:46 2003
***************
*** 23,54 ****
import sys, string, os, glob
! BASEDIR = os.path.abspath(os.path.join(os.getcwd(), '../.cvsdevelbase'))
CVSDIR = os.path.abspath(os.path.join(os.getcwd(),'..'))
PYTHONBIN=sys.executable
rootCommands = []
! def createCVS (scriptdir,script,py):
script = "%s%s" % (script, SUFFIX)
! print "Creating %s....." % os.path.join('..',scriptdir, script) ,
try:
! file = open(os.path.join('..',scriptdir, script),'w')
file.write(cvsbase % py)
file.close()
! 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))
except IOError:
print "Unable to create. Do you have this package checked out?"
else:
print "ok"
def createDocs(sgmlfile, destdir):
! sgmlfile = os.path.join(CVSDIR, sgmlfile)
destdir = os.path.join(DOCDIR, destdir)
rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (destdir,
destdir))
rootCommands.append("%s --output %s %s" %
--- 23,58 ----
import sys, string, os, glob
! BASEDIR = os.path.abspath(os.path.join(os.getcwd(), '.cvsdevelbase'))
CVSDIR = os.path.abspath(os.path.join(os.getcwd(),'..'))
PYTHONBIN=sys.executable
+ CURRENT_TOOL = ""
rootCommands = []
! def createShell (script,py,scriptdir="scripts"):
script = "%s%s" % (script, SUFFIX)
! dest = os.path.join(CURRENT_DIR, scriptdir, script)
! print "Creating %s....." % dest ,
try:
! file = open(dest,'w')
file.write(cvsbase % py)
file.close()
! os.system ('chmod 700 %s' % dest)
rootCommands.append ('rm -f %s/%s' % (BINDIR, script))
! rootCommands.append ('ln -s %s %s/%s' % \
! (dest, BINDIR, script))
! rootCommands.append ('chmod o+x %s' % dest)
except IOError:
print "Unable to create. Do you have this package checked out?"
else:
print "ok"
def createDocs(sgmlfile, destdir):
! if not willInstallDocs:
! return
! sgmlfile = os.path.join(CURRENT_DIR, sgmlfile)
destdir = os.path.join(DOCDIR, destdir)
rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (destdir,
destdir))
rootCommands.append("%s --output %s %s" %
***************
*** 74,81 ****
return val
! def getYesNo(message, default=None):
! return getInput(message,default,('Y','N')) == 'Y'
def getBinPaths():
--- 78,99 ----
return val
! _getYesNoAllStat = {}
!
! def getYesNo(message, default=None, category=None):
! if category:
! try:
! response = _getYesNoAllStat[category]
! print "\n" + message + ' ' + (response and 'Always' or 'Never')
! return response
! except KeyError:
! pass
!
! response = getInput(message,default,('Y','N','A','V'))
! val = response in ('Y','A')
! if category and response in ('A','V'):
! _getYesNoAllStat[category] = val
! return val
def getBinPaths():
***************
*** 99,105 ****
# Do not include python 1.x files
if version < '2':
pass
!
# Do not include python2.2-popy-config
elif len(version)>8:
pass
--- 117,123 ----
# Do not include python 1.x files
if version < '2':
pass
!
# Do not include python2.2-popy-config
elif len(version)>8:
pass
***************
*** 113,118 ****
--- 131,144 ----
return results
+ def findAllGNUePackages():
+ results = []
+ for file in glob.glob('../*'):
+ if os.path.isfile(os.path.join(file, 'setup.cvs')):
+ base = os.path.basename(file)
+ results.append(base)
+ results.sort()
+ return results
def finddb2html():
for path in getBinPaths():
***************
*** 264,270 ****
if ROOTINSTALL:
BINDIR = "/usr/local/bin"
CONFDIR = "/usr/local/gnue"
! DOCDIR = "/usr/share/doc/gnue"
else:
BINDIR = os.path.expanduser("~/bin")
CONFDIR = os.path.expanduser("~/gnue")
--- 290,296 ----
if ROOTINSTALL:
BINDIR = "/usr/local/bin"
CONFDIR = "/usr/local/gnue"
! DOCDIR = "/usr/local/gnue/doc/"
else:
BINDIR = os.path.expanduser("~/bin")
CONFDIR = os.path.expanduser("~/gnue")
***************
*** 276,282 ****
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 """
--- 302,308 ----
getInput ("Where shall I put executable files?", BINDIR))
if os.path.isdir(BINDIR) or \
! getYesNo("Directory %s does not exist. Create? (Yes,No,All,neVer)" %
BINDIR, 'Y','directories'):
break
print """
***************
*** 294,300 ****
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, "%s/etc" % CONFDIR, "%s/shared" % CONFDIR,
--- 320,326 ----
getInput ("Where shall I put configuration files?", CONFDIR))
if os.path.isdir(CONFDIR) or \
! getYesNo("Directory %s does not exist. Create? (Yes,No,All,neVer)" %
CONFDIR, 'Y','directories'):
break
newdirs = [BINDIR, CONFDIR, "%s/etc" % CONFDIR, "%s/shared" % CONFDIR,
***************
*** 312,332 ****
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";
- ######### 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)
- ##############################################################
for dir in newdirs:
rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (dir,dir))
--- 338,349 ----
getInput ("Where shall I put the documentation files?", DOCDIR))
if os.path.isdir(DOCDIR) or \
! getYesNo("Directory %s does not exist. Create? (Yes,No,All,neVer)"
% DOCDIR, 'Y','directories'):
newdirs.append(DOCDIR)
break
else:
print "Cannot generate documentation, could not find db2html in path\n";
for dir in newdirs:
rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (dir,dir))
***************
*** 348,359 ****
fi
PYTHONPATH=%(BASEDIR)s:$PYTHONPATH; export PYTHONPATH
SCRIPT="%%s"
! if [ "$SCRIPT" != "" ]
! then
%(PYTHONBIN)s %(GNUEDIR)s/${SCRIPT} "$@"
else
%(PYTHONBIN)s "$@"
! fi
""" % globals()
--- 365,376 ----
fi
PYTHONPATH=%(BASEDIR)s:$PYTHONPATH; export PYTHONPATH
SCRIPT="%%s"
! if [ "$SCRIPT" != "" ]
! then
%(PYTHONBIN)s %(GNUEDIR)s/${SCRIPT} "$@"
else
%(PYTHONBIN)s "$@"
! fi
""" % globals()
***************
*** 374,487 ****
output.write ("config = \"%s/etc\"\n" % CONFDIR)
output.close ()
! os.system ("""
cd %(GNUEDIR)s
ln -s %(CVSDIR)s/gnue-common/module/base/__init__.py .
ln -s %(CVSDIR)s/gnue-common/src common
if [ -f %(CVSDIR)s/gnue-common/src/.GDTD.py ]; then rm -f
%(CVSDIR)s/gnue-common/src/.GDTD.py; fi
! ln -s %(CVSDIR)s/gnue-common/scripts/gnuedtd
%(CVSDIR)s/common/src/.GDTD.py
! ln -s %(CVSDIR)s/gnue-designer/src designer
! ln -s %(CVSDIR)s/gnue-dbtools/src dbtools
! ln -s %(CVSDIR)s/gnue-forms/src forms
! ln -s %(CVSDIR)s/gnue-reports/src reports
! ln -s %(CVSDIR)s/gnue-navigator/src navigator
! ln -s %(CVSDIR)s/gnue-integrator/src integrator
! ln -s %(CVSDIR)s/gnue-appserver/src appserver
! """ % globals() )
- rootCommands.append("""
- cd %(CONFDIR)s/etc
- rm -f sample.*
- ln -s %(CVSDIR)s/gnue-common/etc/sample.* .
-
- cd %(CONFDIR)s/shared
- rm -rf images filters
- mkdir filters
- mkdir images
-
- cd %(CONFDIR)s/shared/grpc
- rm -f appserver.grpc GEAS.grpc GRServer.grpc
-
- ln -s %(CVSDIR)s/gnue-common/images/* %(CONFDIR)s/shared/images/
- ln -s %(CVSDIR)s/gnue-forms/images %(CONFDIR)s/shared/images/forms
- ln -s %(CVSDIR)s/gnue-designer/images %(CONFDIR)s/shared/images/designer
-
- rm -f %(CONFDIR)s/shared/dialogs
- ln -s %(CVSDIR)s/gnue-forms/dialogs %(CONFDIR)s/shared/dialogs
-
- ln -s %(CVSDIR)s/gnue-reports/src/adapters/filters/Labels/etc
%(CONFDIR)s/shared/filters/Labels
- ln -s %(CVSDIR)s/gnue-reports/src/adapters/filters/SimpleTabulation/etc
%(CONFDIR)s/shared/filters/SimpleTabulation
-
- ln -s %(CVSDIR)s/gnue-appserver/grpc/appserver.grpc
%(CONFDIR)s/shared/grpc/appserver.grpc
- ln -s %(CVSDIR)s/gnue-reports/grpc/GRServer.grpc
%(CONFDIR)s/shared/grpc/GRServer.grpc
-
- cd %(CONFDIR)s/translations
- rm -f ?? ??_??
- ln -s %(CVSDIR)s/gnue-common/translations/?? %(CONFDIR)s/translations/
- ln -s %(CVSDIR)s/gnue-common/translations/??_?? %(CONFDIR)s/translations/
- """ % globals() )
-
-
- createCVS ('gnue-forms/scripts', 'gfcvs','forms/GFClient.py')
- createCVS ('gnue-reports/scripts', 'grcvs','reports/client/GRRun.py')
- createCVS ('gnue-reports/scripts', 'grdcvs','reports/server/GRServer.py')
- createCVS ('gnue-designer/scripts', 'gfdes','designer/Designer.py')
- createCVS ('gnue-navigator/scripts', 'gncvs','navigator/GNClient.py')
- createCVS ('gnue-integrator/scripts','gicvs','integrator/GIClient.py')
- createCVS ('gnue-dbtools/scripts', 'glcvs','dbtools/loader/Loader.py')
- createCVS ('gnue-dbtools/scripts', 'gscvs','dbtools/sql/Client.py')
- createCVS ('gnue-common/scripts',
'grpcdoc','common/rpc/drivers/_helpers/RpcDoc.py')
- #createCVS ('gnue-common/scripts', 'gtestcvs','common/GTest.py')
- createCVS ('gnue-common/scripts', 'gdtdcvs','common/.GDTD.py')
- createCVS ('gnue-common/scripts',
'gsscvs','common/schema/scripter/Scripter.py')
- createCVS ('gnue-common/scripts', 'gcvs','')
- createCVS ('gnue-appserver/scripts', 'gacvs','appserver/geasRpcServer.py')
-
- if willInstallDocs:
- createDocs('gnue-docbook/GNUEnterprise/main.sgml', 'GNUEnterprise')
- createDocs('gnue-docbook/DevelopersIntroduction/main.sgml',
- 'DevelopersIntroduction')
- createDocs('gnue-docbook/GDAQuickHackersGuide/main.sgml',
- 'GDAQuickHackersGuide')
- createDocs('gnue-docbook/GNUeFormsTechRef/main.sgml', 'GNUeFormsTechRef')
- createDocs('gnue-docbook/GNUeModuleGuide/main.sgml', 'GNUeModuleGuide')
- createDocs('gnue-docbook/GNUeObjectServer/main.sgml',
- 'GNUeObjectServer')
willCreateConf = 0
willCreateConn = 0
willCreateFilt = 0
if os.path.isfile('/usr/local/gnue/etc/gnue.conf') and \
! CONFDIR != '/usr/local/gnue':
! if getYesNo('Do you wish to use the current system-wide gnue.conf
file?','N'):
rootCommands.append("ln -s /usr/local/gnue/etc/gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals())
willCreateConf = 1
if os.path.isfile('/usr/local/gnue/etc/connections.conf') and \
! CONFDIR != '/usr/local/gnue':
! if getYesNo('Do you wish to use the current system-wide connections.conf
file?','Y'):
rootCommands.append("ln -s /usr/local/gnue/etc/connections.conf
%(CONFDIR)s/etc/connections.conf" % globals())
willCreateConn = 1
if os.path.isfile('/usr/local/gnue/etc/report-filters.conf') and \
! CONFDIR != '/usr/local/gnue':
! if getYesNo('Do you wish to use the current system-wide report-filters.conf
file?','N'):
rootCommands.append("ln -s /usr/local/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'):
command = "ln -s %(CVSDIR)s/gnue-common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals()
else:
command = "cp %(CVSDIR)s/gnue-common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals()
--- 391,493 ----
output.write ("config = \"%s/etc\"\n" % CONFDIR)
output.close ()
!
! rootCommands.append("""
cd %(GNUEDIR)s
ln -s %(CVSDIR)s/gnue-common/module/base/__init__.py .
ln -s %(CVSDIR)s/gnue-common/src common
if [ -f %(CVSDIR)s/gnue-common/src/.GDTD.py ]; then rm -f
%(CVSDIR)s/gnue-common/src/.GDTD.py; fi
! # ln -s %(CVSDIR)s/gnue-common/scripts/gnuedtd
%(CVSDIR)s/common/src/.GDTD.py
! cd %(CONFDIR)s/etc
! rm -f sample.*
! ln -s %(CVSDIR)s/gnue-common/etc/sample.* .
!
! cd %(CONFDIR)s/shared
! rm -rf images filters
! mkdir filters
! mkdir images
!
! cd %(CONFDIR)s/translations
! rm -f ?? ??_??
! ln -s %(CVSDIR)s/gnue-common/translations/?? %(CONFDIR)s/translations/
! ln -s %(CVSDIR)s/gnue-common/translations/??_?? %(CONFDIR)s/translations/
!
! """ % globals() )
!
! def createLink(file, dest, overwrite=0):
! if overwrite:
! rootCommands.append ("if [ -e %s ]; then rm -f %s; fi" % (dest, dest))
! rootCommands.append("ln -s %s/%s %s" % (CURRENT_DIR, file, dest))
!
!
! def linkModule(subdir, module):
! rootCommands.append("ln -s %s/%s %s/%s" % (CURRENT_DIR, subdir, GNUEDIR,
module))
!
!
! for CURRENT_TOOL in ('gnue-designer',
! 'gnue-dbtools',
! 'gnue-forms',
! 'gnue-reports',
! 'gnue-navigator',
! 'gnue-pos',
! 'gnue-integrator',
! 'gnue-appserver'):
!
! global CURRENT_DIR
! CURRENT_DIR = os.path.join(CVSDIR, CURRENT_TOOL)
! setupfile = os.path.join(CURRENT_DIR, 'setup.cvs')
! print setupfile
!
! if os.path.isfile(setupfile) and \
! getYesNo('Setup CVS environment for %s? (Yes,No,All,neVer)'%
CURRENT_TOOL,
! 'Y','autotools'):
! execfile(setupfile,globals())
!
!
! if getYesNo('Do you have any external/custom packages to setup?','N'):
! while 1:
! path = getInput("Path to package's directory containing a setup.cvs file?
(blank line to end)")
! if not path:
! break
!
! CURRENT_TOOL = CURRENT_DIR = path
! execfile(os.path.join(CURRENT_DIR,'setup.cvs'), globals())
willCreateConf = 0
willCreateConn = 0
willCreateFilt = 0
if os.path.isfile('/usr/local/gnue/etc/gnue.conf') and \
! CONFDIR != '/usr/local/gnue' and not
os.path.isfile(CONFDIR+'/etc/gnue.conf'):
! if getYesNo('Do you wish to use the current system-wide gnue.conf file?
(Yes,No,All,neVer)','N','conf'):
rootCommands.append("ln -s /usr/local/gnue/etc/gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals())
willCreateConf = 1
if os.path.isfile('/usr/local/gnue/etc/connections.conf') and \
! CONFDIR != '/usr/local/gnue' and not
os.path.isfile(CONFDIR+'/etc/connections.conf'):
! if getYesNo('Do you wish to use the current system-wide connections.conf
file? (Yes,No,All,neVer)','Y','conf'):
rootCommands.append("ln -s /usr/local/gnue/etc/connections.conf
%(CONFDIR)s/etc/connections.conf" % globals())
willCreateConn = 1
if os.path.isfile('/usr/local/gnue/etc/report-filters.conf') and \
! CONFDIR != '/usr/local/gnue' and not
os.path.isfile(CONFDIR+'/etc/report-filters.conf'):
! if getYesNo('Do you wish to use the current system-wide report-filters.conf
file? (Yes,No,All,neVer)','N','conf'):
rootCommands.append("ln -s /usr/local/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? (Yes,No,All,neVer)",'Y','autoconf'):
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',):
command = "ln -s %(CVSDIR)s/gnue-common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals()
else:
command = "cp %(CVSDIR)s/gnue-common/etc/sample.gnue.conf
%(CONFDIR)s/etc/gnue.conf" % globals()
***************
*** 492,498 ****
if not willCreateConn and not
os.path.isfile("%s/etc/connections.conf"%CONFDIR):
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'):
rootCommands.append("cp
%(CVSDIR)s/gnue-common/etc/sample.connections.conf
%(CONFDIR)s/etc/connections.conf" % globals())
print
--- 498,504 ----
if not willCreateConn and not
os.path.isfile("%s/etc/connections.conf"%CONFDIR):
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? (Yes,No,All,neVer)",'Y','autoconf'):
rootCommands.append("cp
%(CVSDIR)s/gnue-common/etc/sample.connections.conf
%(CONFDIR)s/etc/connections.conf" % globals())
print
***************
*** 503,513 ****
if not willCreateConf and not
os.path.isfile("%s/etc/report-filters.conf"%CONFDIR):
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 = "ln -s %(CVSDIR)s/gnue-common/etc/sample.report-filters.conf
%(CONFDIR)s/etc/report-filters.conf" % globals()
else:
command = "cp %(CVSDIR)s/gnue-common/etc/sample.report-filters.conf
%(CONFDIR)s/etc/report-filters.conf" % globals()
--- 509,519 ----
if not willCreateConf and not
os.path.isfile("%s/etc/report-filters.conf"%CONFDIR):
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? (Yes,No,All,neVer)",'Y','autoconf'):
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?
(Yes,No,All,neVer)",'N', 'symconf'):
command = "ln -s %(CVSDIR)s/gnue-common/etc/sample.report-filters.conf
%(CONFDIR)s/etc/report-filters.conf" % globals()
else:
command = "cp %(CVSDIR)s/gnue-common/etc/sample.report-filters.conf
%(CONFDIR)s/etc/report-filters.conf" % globals()