Changeset 594

Show
Ignore:
Timestamp:
05/09/07 04:47:06 (1 year ago)
Author:
Gregor
Message:

sss/build.d, sss/conf.d: Tangofied.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/tango/sss/build.d

    r592 r594  
    7171     
    7272    // add -oq if we don't have such a setting 
    73     if (find(forceFlags, "-o") == -1) { 
     73    if (locatePattern(forceFlags, "-o") == forceFlags.length) { 
    7474        mkdirP("dsss_objs"); 
    7575        bl ~= "-oqdsss_objs "; 
  • branches/tango/sss/conf.d

    r589 r594  
    2929module sss.conf; 
    3030 
     31import tango.io.Console; 
     32import tango.io.File; 
     33import tango.io.FileConst; 
    3134import tango.io.FilePath; 
    32  
    33 import std.ctype; 
    34 import std.file; 
    35 import std.process; 
    36 import std.stdio; 
    37 import std.stream; 
    38 import std.string; 
    39  
    40 import std.c.stdlib; 
     35import tango.io.FileSystem; 
     36 
     37import tango.text.Ascii; 
     38import tango.text.Util; 
     39 
     40import tango.stdc.stdlib; 
    4141 
    4242import sss.clean; 
     
    4949    import bcd.windows.windows; 
    5050} 
    51  
    52 alias std.process.system system; 
    53 alias std.string.find find; 
    54 alias std.string.iswhite iswhite; 
    5551 
    5652/** The default config file name */ 
     
    132128    char[] bname; 
    133129    if (!whereAmI(argvz, installPrefix, bname)) { 
    134         writefln("Failed to determine DSSS' installed prefix.")
     130        Cout("Failed to determine DSSS' installed prefix.").newline
    135131        exit(1); 
    136132    } 
     
    141137     
    142138    // using this directory, find include and library directories 
    143     if (exists(installPrefix ~ std.path.sep ~ "sss" ~ std.path.sep ~ "main.d")) { 
     139    if ((new FilePath(installPrefix ~ FileConst.PathSeparatorChar ~ "sss" ~ 
     140                  FileConst.PathSeparatorChar ~ "main.d")).exists()) { 
    144141        // this is probably the build prefix 
    145142        inSourceDir = true; 
    146143         
    147144        if (forcePrefix == "") { 
    148             forcePrefix = installPrefix ~ std.path.sep ~ "inst"; 
     145            forcePrefix = installPrefix ~ FileConst.PathSeparatorChar ~ "inst"; 
    149146        } else { 
    150147            forcePrefix = canonPath(forcePrefix); 
    151148        } 
    152149         
    153         char[] sssBaseLoc = installPrefix ~ std.path.sep ~ "sss" ~ std.path.sep
     150        char[] sssBaseLoc = installPrefix ~ FileConst.PathSeparatorChar ~ "sss" ~ FileConst.PathSeparatorChar
    154151        stubDLoc = sssBaseLoc ~ "stub.d"; 
    155152        dsssDllLoc = sssBaseLoc ~ "dssdll.d"; 
     
    158155        version (Posix) { 
    159156            dsss_build = installPrefix ~ 
    160                 std.path.sep ~ "rebuild" ~ 
    161                 std.path.sep ~ "rebuild"; 
     157                FileConst.PathSeparatorChar ~ "rebuild" ~ 
     158                FileConst.PathSeparatorChar ~ "rebuild"; 
    162159        } else version (Windows) { 
    163160            dsss_build = installPrefix ~ 
    164                 std.path.sep ~ "rebuild" ~ 
    165                 std.path.sep ~ "rebuild.exe"; 
     161                FileConst.PathSeparatorChar ~ "rebuild" ~ 
     162                FileConst.PathSeparatorChar ~ "rebuild.exe"; 
    166163        } else { 
    167164            static assert(0); 
     
    172169        if (!candyDocPrefix.length) 
    173170            candyDocPrefix = canonPath( 
    174                 installPrefix ~ std.path.sep
     171                installPrefix ~ FileConst.PathSeparatorChar
    175172                "candydoc.tar.gz"); 
    176173    } else { 
     
    184181        } 
    185182         
    186         char[] sssBaseLoc = forcePrefix ~ std.path.sep
    187             "include" ~ std.path.sep
    188             "d" ~ std.path.sep
    189             "sss" ~ std.path.sep
     183        char[] sssBaseLoc = forcePrefix ~ FileConst.PathSeparatorChar
     184            "include" ~ FileConst.PathSeparatorChar
     185            "d" ~ FileConst.PathSeparatorChar
     186            "sss" ~ FileConst.PathSeparatorChar
    190187        stubDLoc = sssBaseLoc ~ "stub.d"; 
    191188        dsssDllLoc = sssBaseLoc ~ "dsssdll.d"; 
     
    194191        version (Posix) { 
    195192            dsss_build = installPrefix ~ 
    196                  std.path.sep ~ "rebuild"; 
     193                 FileConst.PathSeparatorChar ~ "rebuild"; 
    197194        } else version (Windows) { 
    198195            dsss_build = installPrefix ~ 
    199                 std.path.sep ~ "rebuild.exe"; 
     196                FileConst.PathSeparatorChar ~ "rebuild.exe"; 
    200197        } else { 
    201198            static assert(0); 
     
    203200         
    204201        // if we don't have rebuild next to us, try to use it without a path 
    205         if (!std.file.exists(dsss_build)) { 
     202        if (!(new FilePath(dsss_build)).exists()) { 
    206203            version (Posix) { 
    207204                dsss_build = "rebuild"; 
     
    217214        if (!candyDocPrefix.length) 
    218215            candyDocPrefix = canonPath( 
    219                 installPrefix ~ std.path.sep
    220                 ".." ~ std.path.sep
    221                 "share" ~ std.path.sep
    222                 "dsss" ~ std.path.sep
     216                installPrefix ~ FileConst.PathSeparatorChar
     217                ".." ~ FileConst.PathSeparatorChar
     218                "share" ~ FileConst.PathSeparatorChar
     219                "dsss" ~ FileConst.PathSeparatorChar
    223220                "candydoc.tar.gz"); 
    224221    } 
    225222     
    226223    if (!binPrefix.length) 
    227         binPrefix = forcePrefix ~ std.path.sep ~ "bin"; 
     224        binPrefix = forcePrefix ~ FileConst.PathSeparatorChar ~ "bin"; 
    228225    if (!libPrefix.length) 
    229         libPrefix = forcePrefix ~ std.path.sep ~ "lib"; 
     226        libPrefix = forcePrefix ~ FileConst.PathSeparatorChar ~ "lib"; 
    230227    if (!includePrefix.length) 
    231         includePrefix = forcePrefix ~ std.path.sep
    232              "include" ~ std.path.sep
     228        includePrefix = forcePrefix ~ FileConst.PathSeparatorChar
     229             "include" ~ FileConst.PathSeparatorChar
    233230             "d"; 
    234231    if (!docPrefix.length) 
    235         docPrefix = forcePrefix ~ std.path.sep
    236             "share" ~ std.path.sep
     232        docPrefix = forcePrefix ~ FileConst.PathSeparatorChar
     233            "share" ~ FileConst.PathSeparatorChar
    237234            "doc"; 
    238235    if (!manifestPrefix.length) 
    239         manifestPrefix = forcePrefix ~ std.path.sep
    240             "share" ~ std.path.sep
    241             "dsss" ~ std.path.sep
     236        manifestPrefix = forcePrefix ~ FileConst.PathSeparatorChar
     237            "share" ~ FileConst.PathSeparatorChar
     238            "dsss" ~ FileConst.PathSeparatorChar
    242239            "manifest"; 
    243240    if (!etcPrefix.length) 
    244         etcPrefix = forcePrefix ~ std.path.sep
     241        etcPrefix = forcePrefix ~ FileConst.PathSeparatorChar
    245242            "etc"; 
    246243    if (!srcListPrefix.length) 
    247244        srcListPrefix = canonPath( 
    248             installPrefix ~ std.path.sep
    249             ".." ~ std.path.sep
    250             "share" ~ std.path.sep
    251             "dsss" ~ std.path.sep
     245            installPrefix ~ FileConst.PathSeparatorChar
     246            ".." ~ FileConst.PathSeparatorChar
     247            "share" ~ FileConst.PathSeparatorChar
     248            "dsss" ~ FileConst.PathSeparatorChar
    252249            "sources"); 
    253250     
     
    256253        scratchPrefix = "/tmp"; 
    257254         
    258         setEnvVar("DSSS", installPrefix ~ std.path.sep ~ bname); 
     255        setEnvVar("DSSS", installPrefix ~ FileConst.PathSeparatorChar ~ bname); 
    259256        setEnvVar("PREFIX", forcePrefix); 
    260257        setEnvVar("BIN_PREFIX", binPrefix); 
     
    275272        setEnvVar("LD_LIBRARY_PATH", ldlibp); 
    276273    } else version (Windows) { 
    277         scratchPrefix = canonPath(installPrefix ~ std.path.sep
    278                                   ".." ~ std.path.sep
     274        scratchPrefix = canonPath(installPrefix ~ FileConst.PathSeparatorChar
     275                                  ".." ~ FileConst.PathSeparatorChar
    279276                                  "tmp"); 
    280277         
    281         setEnvVar("DSSS", installPrefix ~ std.path.sep ~ bname); 
     278        setEnvVar("DSSS", installPrefix ~ FileConst.PathSeparatorChar ~ bname); 
    282279        setEnvVar("PREFIX", forcePrefix); 
    283280        setEnvVar("BIN_PREFIX", binPrefix); 
     
    294291    } 
    295292     
    296     dsss_build ~= " -Idsss_imports" ~ std.path.sep
    297         " -I. -S." ~ std.path.sep
    298         " -I" ~ includePrefix ~ " -S" ~ libPrefix ~ std.path.sep ~ " " ~ 
     293    dsss_build ~= " -Idsss_imports" ~ FileConst.PathSeparatorChar
     294        " -I. -S." ~ FileConst.PathSeparatorChar
     295        " -I" ~ includePrefix ~ " -S" ~ libPrefix ~ FileConst.PathSeparatorChar ~ " " ~ 
    299296        dsss_buildOptions ~ " "; 
    300297} 
     
    338335                line[i] == '_') { 
    339336                tok ~= line[i..i+1]; 
    340             } else if (iswhite(line[i])) { 
     337            } else if (isSpace(line[i])) { 
    341338                addToken(); 
    342339            } else if (line[i] == '=' || 
     
    350347                 
    351348                // trim whitespace of the setting 
    352                 while (tok.length && iswhite(tok[0])) tok = tok[1..$]; 
     349                while (tok.length && isSpace(tok[0])) tok = tok[1..$]; 
    353350                 
    354351                if (tok.length) addToken(); 
     
    371368    char[] confFile; 
    372369     
    373     if (exists(configFName)) { 
     370    if ((new FilePath(configFName)).exists()) { 
    374371        if (genconfig) { 
    375372            // this makes no sense 
    376             writefln("Will not generate a config file when a config file already exists.")
     373            Cout("Will not generate a config file when a config file already exists.").newline
    377374            exit(1); 
    378375        } 
     
    380377        // before reading the config, distclean if it's changed 
    381378        if (configF == configFName) { 
    382             if (exists(configLBName)) { 
     379            if ((new FilePath(configLBName)).exists()) { 
    383380                if (fileNewer(configFName, configLBName)) { 
    384381                    // our config has changed 
     
    388385         
    389386            // copy in our new dsss.lastbuild 
    390             std.file.copy(configFName, configLBName); 
     387            (new FilePath(configLBName)).copy(configFName); 
    391388        } 
    392389         
    393390        // Read the config file 
    394         confFile = cast(char[]) std.file.read(configFName); 
     391        confFile = cast(char[]) (new File(configFName)).read(); 
    395392    } else { 
    396393        // Generate the config file 
    397394        if (buildElems.length == 0) { 
    398395            // from nothing - just make every directory into a library 
    399             char[][] dires = listdir("."); 
     396            char[][] dires = (new FilePath(".")).toList(); 
    400397            foreach (dire; dires) { 
    401                 if (isdir(dire) && 
     398                if ((new FilePath(dire)).isDir() && 
    402399                    dire[0] != '.') { 
    403400                    confFile ~= "[" ~ dire ~ "]\n"; 
     
    408405            // from a list 
    409406            foreach (build; buildElems) { 
    410                 if (!exists(build)) { 
    411                     writefln("File %s not found!", build)
     407                if (!(new FilePath(build)).exists()) { 
     408                    Cout("File ")(build)(" not found!").newline
    412409                } else { 
    413410                    confFile ~= "[" ~ build ~ "]\n"; 
     
    418415        if (genconfig) { 
    419416            // write it 
    420             std.file.write(configFName, confFile); 
     417            (new File(configFName)).write(confFile); 
    421418        } 
    422419         
     
    425422     
    426423    // Normalize it 
    427     confFile = replace(confFile, "\r", ""); 
     424    confFile = substitute(confFile, "\r", ""); 
    428425     
    429426    // Split it by lines 
     
    435432    // set up the defaults for the top-level section 
    436433    conf.settings[""] = null; 
    437     conf.settings[""]["name"] = getBaseName(getcwd()); 
     434    conf.settings[""]["name"] = (new FilePath(FileSystem.getDirectory())).file(); 
    438435    conf.settings[""]["version"] = "latest"; 
    439436     
     
    457454                        if (!ignoreElse) { 
    458455                            // rewrite this line for later parsing 
    459                             lines[i] = std.string.join(ntokens[2 .. $], " "); 
     456                            lines[i] = tango.text.Util.join(ntokens[2 .. $], " "); 
    460457                            depth--; 
    461458                            i--; 
     
    477474            } 
    478475            // didn't close! 
    479             writefln("DSSS config error: unclosed scope.")
     476            Cout("DSSS config error: unclosed scope.").newline
    480477            exit(1); 
    481478        } 
     
    497494            tokens[$ - 1] == "]") { 
    498495            // a section header 
    499             char[] path = std.string.join(tokens[1 .. ($ - 1)], ""); 
     496            char[] path = tango.text.Util.join(tokens[1 .. ($ - 1)], ""); 
    500497            // allow \'s for badly-written conf files 
    501             path = std.string.replace(path, "\\", "/"); 
     498            path = tango.text.Util.replace(path.dup, '\\', '/'); 
    502499             
    503500            section = canonPath(path); 
     
    516513                conf.settings[section]["target"] = section[1..$]; 
    517514                 
    518             } else if (!exists(section)) { 
    519                 writefln("WARNING: Section for nonexistant file %s.", section)
     515            } else if (!(new FilePath(section)).exists()) { 
     516                Cout("WARNING: Section for nonexistant file ")(section)(".").newline
    520517            } else { 
    521518                conf.sections ~= section; 
    522519                 
    523                 if (isdir(section)) { 
     520                if ((new FilePath(section)).isDir()) { 
    524521                    conf.settings[section]["type"] = "library"; 
    525522                     
    526523                    // target according to the library naming convention 
    527                     char[] pkg = std.string.replace(canonPath(section)
    528                                                     "\\", "/"); 
     524                    char[] pkg = tango.text.Util.replace(canonPath(section).dup
     525                                                         '\\', '/'); 
    529526                     
    530527                    // LNC: 
     
    548545                    // swap out /'s 
    549546                    pkg = 
    550                         std.string.replace(pkg, "/", "-"); 
     547                        tango.text.Util.replace(pkg.dup, '/', '-'); 
    551548                    // name it 
    552549                    conf.settings[section]["target"] = 
     
    555552                } else { 
    556553                    conf.settings[section]["type"] = "binary"; 
    557                     conf.settings[section]["target"] = std.path.getName(section); 
     554                    conf.settings[section]["target"] = (new FilePath(section)).name(); 
    558555                } 
    559556            } 
     
    566563            if (tokens[0] == "warn") { 
    567564                // a warning 
    568                 writefln("WARNING: %s", tokens[2])
     565                Cout("WARNING: ")(tokens[2]).newline
    569566            } else if (tokens[0] == "error") { 
    570567                // an error 
    571                 writefln("ERROR: %s", tokens[2])
     568                Cout("ERROR: ")(tokens[2]).newline
    572569            } 
    573570             
     
    575572                   tokens[1] == "=") { 
    576573            // a setting 
    577             conf.settings[section][std.string.tolower(tokens[0])] = expandEnvVars(tokens[2]); 
     574            conf.settings[section][tango.text.Ascii.toLower(tokens[0])] = expandEnvVars(tokens[2]); 
    578575                 
    579576        } else if (tokens.length == 1 && 
    580577                   isalnum(tokens[0][0])) { 
    581578            // a setting with no value 
    582             conf.settings[section][std.string.tolower(tokens[0])] = ""; 
     579            conf.settings[section][tango.text.Ascii.toLower(tokens[0])] = ""; 
    583580             
    584581        } else if (tokens.length == 4 && 
     
    586583                   tokens[2] == "=") { 
    587584            // append to a setting 
    588             char[] setting = std.string.tolower(tokens[0]); 
     585            char[] setting = tango.text.Ascii.toLower(tokens[0]); 
    589586            if (setting in conf.settings[section]) { 
    590587                conf.settings[section][setting] ~= " " ~ expandEnvVars(tokens[3]); 
     
    608605                 tokens[4] != ")" || 
    609606                 tokens[5] != "{")) { 
    610                 writefln("DSSS config error: malformed version line.")
     607                Cout("DSSS config error: malformed version line.").newline
    611608                exit(1); 
    612609            } 
     
    645642             
    646643        } else { 
    647             writefln("DSSS config error: unrecognized line '%s'.", lines[i])
     644            Cout("DSSS config error: unrecognized line '")(lines[i])("'.").newline
    648645            exit(1); 
    649646                 
     
    678675        /* now check if this version is defined by making a .d file and 
    679676         * building it */ 
    680         int ret = system(dsss_build ~ "-testversion=" ~ vertok); 
     677        int ret = hcf.process.system(dsss_build ~ "-testversion=" ~ vertok); 
    681678         
    682679        if (ret == 0) { 
     
    716713    char[][] exclude; 
    717714    if ("exclude" in settings) { 
    718         exclude = split(settings["exclude"]); 
     715        exclude = tango.text.Util.delimit(settings["exclude"], 
     716                                          [' ', '\t', '\n', '\r']); 
    719717         
    720718        // canonicalize and un-Windows-ize the paths 
    721719        for (int i = 0; i < exclude.length; i++) { 
    722             exclude[i] = std.string.replace(canonPath(exclude[i])
    723                                             "\\", "/"); 
     720            exclude[i] = tango.text.Util.replace(canonPath(exclude[i]).dup
     721                                                 '\\', '/'); 
    724722        } 
    725723    } 
     
    727725    { 
    728726        for (int i = 0; i < exclude.length; i++) { 
    729             if (fnmatch(std.string.replace(path, "\\", "/"), exclude[i])) { 
     727            if (fnmatch(tango.text.Util.replace(path.dup, '\\', '/'), exclude[i])) { 
    730728                return true; 
    731729            } 
     
    745743         
    746744        // not excluded, get the list of files 
    747         char[][] dirFiles = listdir(ndir); 
     745        char[][] dirFiles = (new FilePath(ndir)).toList(); 
    748746        foreach (file; dirFiles) { 
    749747            if (!file.length) continue; // shouldn't happen 
     
    753751             
    754752            // make this the full path 
    755             file = ndir ~ std.path.sep ~ file; 
    756              
    757             if (isdir(file)) { 
     753            file = ndir ~ FileConst.PathSeparatorChar ~ file; 
     754             
     755            if ((new FilePath(file)).isDir()) { 
    758756                // perhaps recurse 
    759757                addDir(file); 
    760             } else if (std.string.tolower(getExt(file)) == "d") { 
     758            } else if (tango.text.Ascii.toLower(getExt(file)) == "d") { 
    761759                // or just add it 
    762760                if (!excluded(file)) { 
     
    767765    } 
    768766     
    769     if (isdir(target)) { 
     767    if ((new FilePath(target)).isDir()) { 
    770768        addDir(target, true); 
    771769    } else { 
     
    784782     
    785783    // since parts of the script can potentially change the directory, store it 
    786     char[] origcwd = getcwd(); 
     784    char[] origcwd = FileSystem.getDirectory(); 
    787785     
    788786    // split the steps by ; 
    789     char[][] cmds = std.string.split(step, ";"); 
     787    char[][] cmds = tango.text.Util.split(step, ";"); 
    790788     
    791789    foreach (cmd; cmds) { 
    792790        // clean cmd 
    793         while (cmd.length > 0 && iswhite(cmd[0])) cmd = cmd[1..$]; 
    794         while (cmd.length > 0 && iswhite(cmd[$-1])) cmd = cmd[0..($-1)]; 
    795         writefln("Command: %s", cmd)
     791        while (cmd.length > 0 && isSpace(cmd[0])) cmd = cmd[1..$]; 
     792        while (cmd.length > 0 && isSpace(cmd[$-1])) cmd = cmd[0..($-1)]; 
     793        Cout("Command: ")(cmd).newline
    796794         
    797795        // run it 
    798         char[] ext = std.string.tolower(getExt(cmd)); 
    799         if (find(cmd, ' ') == -1 && ext == "d") { 
     796        char[] ext = tango.text.Ascii.toLower(getExt(cmd)); 
     797        if (locate(cmd, ' ') == cmd.length && ext == "d") { 
    800798            // if it's a .d file, -exec it 
    801799            saySystemDie(dsss_build ~ "-full -exec " ~ cmd); 
     
    804802                   cmd[0..8] == "install ") { 
    805803            // doing an install 
    806             char[][] comps = std.string.split(cmd); 
     804            char[][] comps = tango.text.Util.delimit(cmd, 
     805                                                     [' ', '\t', '\n', '\r']); 
    807806            if (comps.length != 3) continue; // FIXME: not valid 
    808807             
    809808            // do this install 
    810809            // check for / or \ 
    811             int slloc = std.string.rfind(comps[1], '/'); 
    812             if (slloc == -1
    813                 std.string.rfind(comps[1], '\\'); 
     810            int slloc = tango.text.Util.locatePrior(comps[1], '/'); 
     811            if (slloc == comps[1].length
     812                slloc = tango.text.Util.locatePrior(comps[1], '\\'); 
    814813             
    815814            // strip off the prefix from our manifest path 
    816             char[] manifestPath = comps[2] ~ std.path.sep
     815            char[] manifestPath = comps[2] ~ FileConst.PathSeparatorChar
    817816            if (manifestPath.length > forcePrefix.length && 
    818817                manifestPath[0 .. forcePrefix.length] == forcePrefix) 
     
    834833                   cmd[0..3] == "cd ") { 
    835834            // change directories 
    836             char[][] comps = std.string.split(cmd); 
     835            char[][] comps = tango.text.Util.delimit(cmd, 
     836                                                     [' ', '\t', '\n', '\r']); 
    837837            if (comps.length != 2) continue; // FIXME: not valid 
    838838             
    839839            // change our directory 
    840             chdir(comps[1]); 
     840            FileSystem.setDirectory(comps[1]); 
    841841             
    842842        } else if (cmd.length > 5 && 
     
    846846             
    847847            cmd = cmd[5..$]; 
    848             if (std.string.tolower(getExt(cmd)) == "d") { 
     848            if (tango.text.Ascii.toLower(getExt(cmd)) == "d") { 
    849849                proc = new PStream(dsss_build ~ "-full -exec " ~ cmd); 
    850850            } else { 
     
    858858                try { 
    859859                    proc.read(readc); 
    860                 } catch (ReadException e) { 
     860                } catch (Exception e) { 
    861861                    break; 
    862862                } 
     
    894894            // 2) divide <section>.<setting> 
    895895            char[] section, setting; 
    896             int dotloc = find(sset, '.'); 
    897             if (dotloc == -1) { 
     896            int dotloc = locate(sset, '.'); 
     897            if (dotloc == sset.length) { 
    898898                section = ""; 
    899899                setting = sset; 
     
    930930    } 
    931931     
    932     chdir(origcwd); 
     932    FileSystem.setDirectory(origcwd); 
    933933     
    934934    return manifest; 
     
    965965            if (!found) { 
    966966                // didn't match anything! 
    967                 writefln("%s is not described in the configuration file.", be)
     967                Cout(be)(" is not described in the configuration file.").newline
    968968                exit(1); 
    969969            } 
     
    10171017         
    10181018        // cut off each dot one-by-one 
    1019         while ((dotloc = rfind(soversion, '.')) != -1) { 
     1019        while ((dotloc = locatePrior(soversion, '.')) != soversion.length) { 
    10201020            soversion = soversion[0..dotloc]; 
    10211021            res ~= ("lib" ~ target ~ ".so." ~ soversion); 
     
    10541054     
    10551055    if (!tested) { 
    1056         int ret = system(dsss_build ~ "-libs-safe"); 
     1056        int ret = hcf.process.system(dsss_build ~ "-libs-safe"); 
    10571057        safe = (ret == 0); 
    10581058        tested = true; 
     
    10701070    if (!tested) { 
    10711071        // ask dsss_build 
    1072         int ret = system(dsss_build ~ "-shlib-support"); 
     1072        int ret = hcf.process.system(dsss_build ~ "-shlib-support"); 
    10731073         
    10741074        supported = (ret == 0); 
     
    10911091void copyInFile(char[] file, char[] prefix, char[] from = "") 
    10921092{ 
    1093     if (!exists(prefix)) { 
    1094         writefln("+ making directory %s", prefix)
     1093    if (!(new FilePath(prefix)).exists()) { 
     1094        Cout("+ making directory ")(prefix).newline
    10951095        mkdirP(prefix); 
    10961096    } 
    10971097             
    1098     writefln("+ copying %s", file)
     1098    Cout("+ copying ")(file).newline
    10991099    version (Posix) { 
    1100         char[] target = prefix ~ std.path.sep ~ file; 
     1100        char[] target = prefix ~ FileConst.PathSeparatorChar ~ file; 
    11011101         
    11021102        // preserve permissions 
     
    11041104         
    11051105        // but then guarantee the permissions we made aren't too bad (ignore errors) 
    1106         system("chmod a+rX " ~ target ~ " 2> /dev/null"); 
     1106        hcf.process.system("chmod a+rX " ~ target ~ " 2> /dev/null"); 
    11071107         
    11081108    } else { 
    1109         copy(from ~ file, prefix ~ std.path.sep ~ file); 
     1109        copy(from ~ file, prefix ~ FileConst.PathSeparatorChar ~ file); 
    11101110    } 
    11111111} 
     
    11361136    return ret; 
    11371137} 
     1138 
     1139/** Is this character alphanumeric? */ 
     1140bool isalnum(char c) 
     1141{ 
     1142    if ((c >= 'a' && c <= 'z') || 
     1143        (c >= 'A' && c <= 'Z') || 
     1144        (c >= '0' && c <= '9')) 
     1145        return true; 
     1146    return false; 
     1147}