ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/localize.py
(Generate patch)

Comparing localize.py (file contents):
Revision 1.9 by arta, Fri Nov 15 17:05:49 2013 UTC vs.
Revision 1.10 by arta, Fri Nov 15 21:45:34 2013 UTC

# Line 396 | Line 396 | def parseConfig(fin, keymap, addenda, de
396                      section = newSection
397      
398                  if section == 'make':
399 +
400                      # There are some blocks of lines in the __MAKE__ section that must be copied ver batim to the output make file.
401                      # The blocks are defined by _CUST_/_ENDCUST_ tags.
402                      matchobj = regexpCustMkBeg.match(line)
# Line 415 | Line 416 | def parseConfig(fin, keymap, addenda, de
416                  if section == 'defs' or section == 'make':
417                      iscfg = bool(1)
418                      ppRet = processParam(iscfg, line, regexpQuote, regexp, keymap, defs, cDefs, mDefsGen, mDefsMake, perlConstSection, perlInitSection, platDict, machDict, section)
419 <                                
419 >                    
420                      if ppRet:
421 <                        break;
421 >                        break
422                  elif section == 'projcfg':
423                      # Copy the line ver batim to the projCfg list (configure)
424                      for line in fin:
# Line 448 | Line 449 | def parseConfig(fin, keymap, addenda, de
449                      else:
450                          xml += line
451                  else:
452 <                    # Unknown section
452 >                    # Unknown section
453                      raise Exception('unknownSection', section)
454      except Exception as exc:
455          msg = exc.args[0]
# Line 513 | Line 514 | def parseConfig(fin, keymap, addenda, de
514              for var in machDict[mach]:
515                  mDefsMake.extend(list('\n' + var + ' = ' + machDict[mach][var]))
516              mDefsMake.extend(list('\nendif\n'))
516                            
517      return rv
518  
519   def getMgrUIDLine(defs, uidParam):
# Line 727 | Line 727 | def writeProjFiles(pCfile, pMfile, pRfil
727              with open(pTfile, 'w') as tout:
728                  # target.mk
729                  print(PREFIX, file=tout)
730 <                print(''.join(projTarget), file=tout)    
730 >                print(''.join(projTarget), file=tout)
731      except IOError as exc:
732          type, value, traceback = sys.exc_info()
733          print(exc.strerror, file=sys.stderr)
# Line 735 | Line 735 | def writeProjFiles(pCfile, pMfile, pRfil
735          rv = bool(1)
736  
737      if not rv:
738 <        try:
739 <            os.chmod(pCfile, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
740 <        except OSError as exc:
741 <            print(exc.strerror, file=sys.stderr)
742 <            rv = bool(1)
738 >        if os.path.exists(pCfile):
739 >            try:
740 >                os.chmod(pCfile, stat.S_IRWXU | stat.S_IRGRP | stat.S_IROTH)
741 >            except OSError as exc:
742 >                type, value, traceback = sys.exc_info()
743 >                print('Unable to chmod file ' + "'" + value.filename + "'.", file=sys.stderr)
744 >                print(exc.strerror, file=sys.stderr)
745 >                rv = bool(1)
746  
747      return rv
748  
# Line 783 | Line 786 | def configureNet(cfgfile, cfile, mfile,
786                  rv = getMgrUIDLine(defs, uidParam)
787                  if rv == bool(0):
788                      rv = parseConfig(None, keymap, uidParam, defs, cDefs, mDefsGen, None, projCfg, projMkRules, projRules, projTarget, perlConstSection, perlInitSection)
786                
789              # Configure the compiler-selection make variables.
790              if not rv:
791                  rv = configureComps(defs, mDefsComps)
# Line 791 | Line 793 | def configureNet(cfgfile, cfile, mfile,
793              # Write out the parameter files.
794              if not rv:
795                  rv = writeParamsFiles(base, cfile, mfile, pfile, cDefs, mDefsGen, mDefsMake, mDefsComps, perlConstSection, perlInitSection)
794
796              # Write out the project-specific make files (make_basic.mk, Rules.mk, and target.mk).
797              if not rv:
798                  rv = writeProjFiles(pCfile, pMfile, pRfile, pTfile, projCfg, projMkRules, projRules, projTarget)
798
799      except IOError as exc:
800          print(exc.strerror, file=sys.stderr)
801          print('Unable to read configuration file ' + cfgfile + '.', file=sys.stderr)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines