/[papo]/gnue/setup-cvs.py
ViewVC logotype

Diff of /gnue/setup-cvs.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by charlie, Tue Aug 27 18:15:51 2002 UTC revision 1.4 by styxman, Fri Nov 8 17:08:28 2002 UTC
# Line 23  def createCVS (scriptdir,script,py): Line 23  def createCVS (scriptdir,script,py):
23    rootCommands.append ('chmod o+x %s/%s/%s' % (CVSDIR,scriptdir, script))    rootCommands.append ('chmod o+x %s/%s/%s' % (CVSDIR,scriptdir, script))
24    
25    
26    def createDocs(sgmlfile, destdir):
27      sgmlfile = os.path.join(CVSDIR, sgmlfile)
28      destdir  = os.path.join(DOCDIR, destdir)
29      rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (destdir, destdir))
30      rootCommands.append("%s --output %s %s" %
31                                                      (DB2HTML, destdir, sgmlfile))
32    
33    
34  def getInput(message, default, responseSet=None):  def getInput(message, default, responseSet=None):
35    print ""    print ""
36    while 1:    while 1:
# Line 46  def getYesNo(message, default=None): Line 54  def getYesNo(message, default=None):
54    return getInput(message,default,('Y','N')) == 'Y'    return getInput(message,default,('Y','N')) == 'Y'
55    
56    
57  # Returns a list containing all Python executables in the user's path.  def getBinPaths():
 # List element 0 will always be the currently running executable  
 def findAllPythonExes():  
   results = [sys.executable]  
   
58    paths = string.split(os.environ['PATH'],os.pathsep)    paths = string.split(os.environ['PATH'],os.pathsep)
59    if not ('/usr/local/bin' in paths or '/usr/local/bin/' in paths) and \    if not ('/usr/local/bin' in paths or '/usr/local/bin/' in paths) and \
60       os.path.isdir('/usr/local/bin'):       os.path.isdir('/usr/local/bin'):
61      paths.append('/usr/local/bin')      paths.append('/usr/local/bin')
62      return(paths)
63    
64    
65    # Returns a list containing all Python executables in the user's path.
66    # List element 0 will always be the currently running executable
67    def findAllPythonExes():
68      results = [sys.executable]
69    
70    for path in paths:    for path in getBinPaths():
71      for file in glob.glob('%s/python?*' % os.path.abspath(string.strip(path))):      for file in glob.glob('%s/python?*' % os.path.abspath(string.strip(path))):
72        base = os.path.basename(file)        base = os.path.basename(file)
73        version = base[6:]        version = base[6:]
# Line 75  def findAllPythonExes(): Line 86  def findAllPythonExes():
86    return results    return results
87    
88    
89    def finddb2html():
90      for path in getBinPaths():
91        for file in glob.glob('%s/db2html' % os.path.abspath(string.strip(path))):
92          return(file)
93    
94      # Nothing found
95      return "";
96    
97    
98  def restartWithExecutable(exe):  def restartWithExecutable(exe):
99    os.system('%s %s --withNewExecutable "%s"' \    os.system('%s %s --withNewExecutable "%s"' \
# Line 108  except AttributeError: Line 127  except AttributeError:
127    against that version. For example, if you have Python 2.1    against that version. For example, if you have Python 2.1
128    installed, you may need to run:    installed, you may need to run:
129    
130         python2.1 setup.py         python2.1 %s
131  """ % string.split(sys.version)[0]  """ % (string.split(sys.version)[0], sys.argv[0])
132    print "-" * 70    print "-" * 70
133    
134    exes = findAllPythonExes()    exes = findAllPythonExes()
# Line 217  ROOTINSTALL = getInput( Line 236  ROOTINSTALL = getInput(
236  if ROOTINSTALL:  if ROOTINSTALL:
237    BINDIR = "/usr/local/bin"    BINDIR = "/usr/local/bin"
238    CONFDIR = "/usr/local/gnue"    CONFDIR = "/usr/local/gnue"
239      DOCDIR = "/usr/share/doc/gnue"
240  else:  else:
241    BINDIR = os.path.expanduser("~/bin")    BINDIR = os.path.expanduser("~/bin")
242    CONFDIR = os.path.expanduser("~/gnue")    CONFDIR = os.path.expanduser("~/gnue")
243      DOCDIR = os.path.expanduser("~/gnue/docs")
244    
245    
246  while 1:  while 1:
# Line 248  while 1: Line 269  while 1:
269        getYesNo("Directory %s does not exist. Create?" % CONFDIR, 'Y'):        getYesNo("Directory %s does not exist. Create?" % CONFDIR, 'Y'):
270      break      break
271    
272    newdirs = [BINDIR, CONFDIR, "%s/etc" % CONFDIR, "%s/shared" % CONFDIR,
273               "%s/shared/grpc" % CONFDIR,
274               "%s/translations" % CONFDIR ]
275    
276    willInstallDocs = 0
277    
278    DB2HTML = finddb2html();
279    if DB2HTML:
280      if getYesNo("Generate and install documentation? (This could be slow.)", 'N'):
281        willInstallDocs = 1
282        while 1:
283          DOCDIR = os.path.abspath(
284                 getInput ("Where shall I put the documentation files?", DOCDIR))
285        
286          if os.path.isdir(DOCDIR) or \
287              getYesNo("Directory %s does not exist. Create?" % DOCDIR, 'Y'):
288            newdirs.append(DOCDIR)
289            break
290    else:
291      print "Cannot generate documentation, could not find db2html in path\n";
292    
293  for dir in (BINDIR, CONFDIR,"%s/etc" % CONFDIR, "%s/shared" % CONFDIR,  
294              "%s/translations" % CONFDIR):  for dir in newdirs:
295    rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (dir,dir))    rootCommands.append("if [ ! -d %s ]; then mkdir %s; fi" % (dir,dir))
296    
297    
# Line 274  cvsbase = """#!/bin/sh Line 315  cvsbase = """#!/bin/sh
315         export INSTALL_PREFIX         export INSTALL_PREFIX
316       fi       fi
317       PYTHONPATH=%(BASEDIR)s:$PYTHONPATH; export PYTHONPATH       PYTHONPATH=%(BASEDIR)s:$PYTHONPATH; export PYTHONPATH
318       %(PYTHONBIN)s %(GNUEDIR)s/%%s $*       %(PYTHONBIN)s %(GNUEDIR)s/%%s "$@"
319    """ % globals()    """ % globals()
320    
321    
# Line 291  os.system (""" Line 332  os.system ("""
332      mkdir appserver      mkdir appserver
333      ln -s %(CVSDIR)s/common/gnue/__init__.py .      ln -s %(CVSDIR)s/common/gnue/__init__.py .
334      ln -s %(CVSDIR)s/common/src common      ln -s %(CVSDIR)s/common/src common
335        if [ -f %(CVSDIR)s/common/src/.GDTD.py ]; then rm -f %(CVSDIR)s/common/src/.GDTD.py; fi
336        ln -s %(CVSDIR)s/common/scripts/gnuedtd %(CVSDIR)s/common/src/.GDTD.py
337      ln -s %(CVSDIR)s/forms/src forms      ln -s %(CVSDIR)s/forms/src forms
338      ln -s %(CVSDIR)s/navigator/src navigator      ln -s %(CVSDIR)s/navigator/src navigator
339      cd designer      cd designer
# Line 312  rm -f sample.* Line 355  rm -f sample.*
355  ln -s %(CVSDIR)s/common/etc/sample.* .  ln -s %(CVSDIR)s/common/etc/sample.* .
356    
357  cd %(CONFDIR)s/shared  cd %(CONFDIR)s/shared
358  rm -f images filters grpc  rm -f images filters
359    
360    cd %(CONFDIR)s/shared/grpc
361    rm -f GEAS.grpc GRServer.grpc
362    
363  ln -s %(CVSDIR)s/common/images %(CONFDIR)s/shared/images  ln -s %(CVSDIR)s/common/images %(CONFDIR)s/shared/images
364  ln -s %(CVSDIR)s/reports/filters %(CONFDIR)s/shared/filters  ln -s %(CVSDIR)s/reports/filters %(CONFDIR)s/shared/filters
365  ln -s %(CVSDIR)s/appserver/grpc %(CONFDIR)s/shared/grpc  ln -s %(CVSDIR)s/appserver/grpc/GEAS.grpc %(CONFDIR)s/shared/grpc/GEAS.grpc
366    ln -s %(CVSDIR)s/reports/grpc/GRServer.grpc %(CONFDIR)s/shared/grpc/GRServer.grpc
367    
368  cd %(CONFDIR)s/translations  cd %(CONFDIR)s/translations
369  rm -f ?? ??_??  rm -f ?? ??_??
# Line 326  ln -s %(CVSDIR)s/common/translations/??_ Line 374  ln -s %(CVSDIR)s/common/translations/??_
374    
375  createCVS ('forms/scripts','gfcvs','forms/GFClient.py')  createCVS ('forms/scripts','gfcvs','forms/GFClient.py')
376  createCVS ('reports/scripts','grcvs','reports/GRRun.py')  createCVS ('reports/scripts','grcvs','reports/GRRun.py')
377  createCVS ('reports/scripts','grdcvs','reports/GRServe.py')  createCVS ('reports/scripts','grdcvs','reports/GRServer.py')
378  createCVS ('designer/scripts','gfdes','designer/Designer.py')  createCVS ('designer/scripts','gfdes','designer/Designer.py')
379  createCVS ('navigator/scripts','gncvs','navigator/GNClient.py')  createCVS ('navigator/scripts','gncvs','navigator/GNClient.py')
380  createCVS ('common/scripts','grpcdoc','common/commdrivers/_helpers/RpcDoc.py')  createCVS ('common/scripts','grpcdoc','common/commdrivers/_helpers/RpcDoc.py')
381  createCVS ('common/scripts','gtestcvs','common/GTest.py')  createCVS ('common/scripts','gtestcvs','common/GTest.py')
382    createCVS ('common/scripts','gdtdcvs','common/.GDTD.py')
383  createCVS ('appserver/scripts','gacvs','appserver/geasRpcServer.py')  createCVS ('appserver/scripts','gacvs','appserver/geasRpcServer.py')
384    
385    if willInstallDocs:
386      createDocs('docbook/GNUEnterprise/main.sgml', 'GNUEnterprise')
387      createDocs('docbook/DevelopersIntroduction/main.sgml',
388                 'DevelopersIntroduction')
389      createDocs('docbook/GDAQuickHackersGuide/main.sgml',
390                 'GDAQuickHackersGuide')
391      createDocs('docbook/GNUeFormsTechRef/main.sgml', 'GNUeFormsTechRef')
392      createDocs('docbook/GNUeModuleGuide/main.sgml', 'GNUeModuleGuide')
393      createDocs('docbook/GNUeObjectServer/main.sgml',
394                 'GNUeObjectServer')
395    
396  willCreateConf = 0  willCreateConf = 0
397  willCreateConn = 0  willCreateConn = 0
398  willCreateFilt = 0  willCreateFilt = 0
# Line 428  else: Line 488  else:
488    out.close()    out.close()
489    
490    os.system(string.join(rootCommands,'\n'))    os.system(string.join(rootCommands,'\n'))
   

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26