Changeset 1701

Show
Ignore:
Timestamp:
10/22/08 20:45:20 (3 months ago)
Author:
Chuck.Esterbrook
Message:

Improvements for running the installer and the installed cobra on the Mac/Linux/Unix+Mono side.

Location:
cobra/trunk/Source
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • cobra/trunk/Source/InstallFromWorkspace.cobra

    r1689 r1701  
    3939                 
    4040                Use the script: 
    41                 $ install-from-workspace 
     41                $ sudo ./install-from-workspace 
    4242 
    4343 
     
    227227                output = CobraCore.runAndCaptureAllOutput(p).trim 
    228228                process = p 
    229                 if displayOutput 
     229                if displayOutput and output <> '' 
    230230                        for line in output.replace('\r', '').split(c'\n') 
    231                                 print '     [line]' 
    232                         print 
     231                                print '   : [line]' 
     232                print 
    233233                return output 
    234234 
     
    270270                if not File.exists('Compiler.cobra'), .error(msg) 
    271271                if not Directory.exists('Snapshot'), .error(msg) 
     272                print 'Verified.' 
     273                print 
    272274 
    273275        def locateSnapshotCompiler 
     
    292294                        CobraCore.runAndCaptureAllOutput(p) 
    293295                        found = true 
     296                        print 'found in system PATH' 
    294297                catch exc as Exception 
    295298                        if 'cannot find the file' not in exc.message 
     
    311314                                        if File.exists(path) 
    312315                                                print 'found:', path 
    313                                                 print 
    314316                                                gacutil = path 
    315317                                                found = true 
     
    321323 
    322324                _gacutil = gacutil 
     325                print 
    323326 
    324327        def buildCobraCompiler 
     
    409412                        print 'writing  :', _cobraCommandPath 
    410413                        using f = File.createText(_cobraCommandPath) 
    411                                 f.writeLine("'[versionDir][slash]bin[slash]cobra.exe' $*") 
     414                                f.writeLine('#!/bin/sh') 
     415                                f.writeLine('exec mono "[versionDir][slash]bin[slash]cobra.exe" "$@"') 
    412416                        .runCommand('chmod', "a+x '[_cobraCommandPath]'") 
    413417                else 
     
    416420                        using f = File.createText(_cobraCommandPath) 
    417421                                f.writeLine('@"[versionDir][slash]bin[slash]cobra.exe" %*') 
    418                 print 
    419                  
     422                        print 
     423 
    420424                # record "svn info" in the installation directory 
    421425                output = .runCommand('svn', 'info', false) 
     
    445449                paths = (Environment.getEnvironmentVariable('PATH') ? '').split(Path.pathSeparator) 
    446450                for commandDir in paths 
     451                        if commandDir == '.', continue  # skip the 'cobra' in the <workspace>/Source directory 
    447452                        # print 'checking path:', commandDir 
    448453                        commandPath = '[commandDir][slash][commandName]' 
  • cobra/trunk/Source/SharpGenerator.cobra

    r1699 r1701  
    6868                assert File.exists(cobraExePath) 
    6969                infoPath = Path.combine(Path.getDirectoryName(cobraExePath), 'CobraInfo.cs') 
    70                 using sw = File.createText(infoPath) 
    71                         print to sw 
    72                                 print 'using System;' 
    73                                 print 'namespace Cobra.Lang {' 
    74                                 print '    class CobraInfo {' 
    75                                 print '        static public String CobraPath {' 
    76                                 print '            get { return @"[cobraExePath]"; }' 
    77                                 print '        }' 
    78                                 print '    }' 
    79                                 print '}' 
     70                try 
     71                        using sw = File.createText(infoPath) 
     72                                print to sw 
     73                                        print 'using System;' 
     74                                        print 'namespace Cobra.Lang {' 
     75                                        print '    class CobraInfo {' 
     76                                        print '        static public String CobraPath {' 
     77                                        print '            get { return @"[cobraExePath]"; }' 
     78                                        print '        }' 
     79                                        print '    }' 
     80                                        print '}' 
     81                catch UnauthorizedAccessException 
     82                        # an installed Cobra may not have perms to write this file 
     83                        # and this CobraInfo.cs approach may be going away soon in favor of using the new internal 'extra-source' option 
     84                        pass 
    8085                _didWriteSharpInfoClass = true 
    8186