(file) Return to buildprod.py CVS log (file) (dir) Up to [Development] / JSOC / build

Diff for /JSOC/build/buildprod.py between version 1.3 and 1.6

version 1.3, 2015/02/13 18:23:36 version 1.6, 2015/03/30 14:15:16
Line 5  import sys
Line 5  import sys
 import os import os
 import pwd import pwd
 from subprocess import check_output, check_call, call, Popen, CalledProcessError from subprocess import check_output, check_call, call, Popen, CalledProcessError
   sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../base/libs/py'))
   from drmsCmdl import CmdlParser
  
 # PROD_ROOTDIR = '/home/jsoc/cvs/Development'  PROD_ROOTDIR = '/home/jsoc/cvs/Development'
 PROD_ROOTDIR = '/tmp/arta'  # PROD_ROOTDIR = '/tmp/arta'
 WAYSTATION = 'waystation' WAYSTATION = 'waystation'
 WAYSTATION_USER = 'arta' WAYSTATION_USER = 'arta'
  
Line 40  class Chdir:
Line 42  class Chdir:
         else:         else:
             return 1             return 1
  
   optD = {}
   
   try:
       parser = CmdlParser(usage='%(prog)s [ -f ]')
   
       # Optional
       parser.add_argument('-f', '--full', help='Create/re-create all links and create/re-create all localization parameter files.', dest='full', action='store_true', default=False)
   
       args = parser.parse_args()
   
       optD['full'] = args.full
   
   except Exception as exc:
       if len(exc.args) != 2:
           raise # Re-raise
   
       etype = exc.args[0]
       msg = exc.args[1]
   
       if etype == 'CmdlParser-ArgUnrecognized' or etype == 'CmdlParser-ArgBadformat' or etype == 'CmdlParser':
           raise Exception('getArgs', 'cl', 'Unable to parse command-line arguments. ' + msg + '\n' + parser.format_help())
       else:
           raise # Re-raise.
   
 # Allow only arta to modify the files in the waystation. # Allow only arta to modify the files in the waystation.
 if pwd.getpwuid(os.getuid())[0] != WAYSTATION_USER: if pwd.getpwuid(os.getuid())[0] != WAYSTATION_USER:
     sys.exit(RV_ERROR_WRONGUSER)     sys.exit(RV_ERROR_WRONGUSER)
Line 58  try:
Line 84  try:
         # os.chdir does NOT change the environment variable $PWD. But our make system relies on PWD being the current directory.         # os.chdir does NOT change the environment variable $PWD. But our make system relies on PWD being the current directory.
         os.environ['PWD'] = os.path.realpath(os.getcwd())         os.environ['PWD'] = os.path.realpath(os.getcwd())
  
           if optD['full']:
         cmdList = ['./configure']         cmdList = ['./configure']
           else:
               cmdList = ['./configure', '-d']
         check_call(cmdList)         check_call(cmdList)
  
         cmdList = ['make']          cmdList = ['/usr/bin/make']
         check_call(cmdList)         check_call(cmdList)
         cmdList = ['/usr/bin/make', 'dsds']         cmdList = ['/usr/bin/make', 'dsds']
         check_call(cmdList)         check_call(cmdList)
           if optD['full']:
               cmdList = ['/usr/bin/make', 'globalhs']
               check_call(cmdList)
  
         cmdList = ['chgrp', '-R', 'jsoc', '.']          cmdList = ['chgrp', '-Rh', 'jsoc', '.']
         check_call(cmdList)         check_call(cmdList)
         cmdList = ['chmod', '-R', 'g-w', '.']         cmdList = ['chmod', '-R', 'g-w', '.']
         check_call(cmdList)         check_call(cmdList)
Line 80  except ValueError:
Line 112  except ValueError:
     print('Bad arguments to make: \n' + '\n'.join(cmdList[1:]))     print('Bad arguments to make: \n' + '\n'.join(cmdList[1:]))
     sys.exit(RV_ERROR_MAKE);     sys.exit(RV_ERROR_MAKE);
 except Exception as exc: except Exception as exc:
       if len(exc.args) != 2:
     raise # Re-raise     raise # Re-raise
   
       etype = exc.args[0]
       msg = exc.args[1]
   
       if etype != 'getArgs':
           raise # Re-raise
   
       print(msg, file=sys.stderr)


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

Karen Tian
Powered by
ViewCVS 0.9.4