Just FYI, here's a new procedure I'm putting in flx to install it:

proc backup() {
    debugln "Backup Felix build";
    println$ "FROM: " + FLX_INSTALL_DIR;
    println$ "TO  : backup";
    var result = 0;
    
    proc cp(s:string) {
      result=system(FLX_INSTALL_DIR+"/bin/flx_cp '"+FLX_INSTALL_DIR+"' '"+s+"' 
'backup/\\0'");
      if result != 0 do goto failure; done
    }
    srcs := list(
     "(tools|lib)/.*\\.(flxh?|par2|libtab)",
     "lib/rtl/.*\\.(h|hpp|c|cpp|dylib|so|a)",
     "lib/rtl/flx_a?run.(o|obj)",
     "bin/.*",
     "config/.*",
     "(test|tut)/.*\\.(flx|expect)",
     "doc/.*\\.(fdoc|html)",
     "web/.*\\.(fdoc|html|gif|png|jpg)",
     "index.html",
     "automaton.syntax",
     "VERSION",
    );
    iter cp srcs;
    println "Source Install succeeded";
    System::exit(result);
failure:> 
    println$ "Install failed, code = " + str(result);
    System::exit(result);
}

This procedure currently uses the flx_cp command, and creates a backup
of a usable Felix installation in directory backup: I'm doing this to test the 
procedure before I get rid of the old one (which uses Unix cp command:
Flx_cp is portable, although it doesn't preserve time stamps at the moment,
something I can't figure out how to do.. anyone know?)

Note how compact the instructions are using flx_cp!
Regexps plus recursion, plus replacement, plus automatic directory construction.

[BTW: another bug or so has surfaced: the iteration doesn't compile if the
symbols cp and srcs are replaced by their values .. I don't know why]

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to