From 40274c1f4f763e634dd031f7a6b4ba8ce2de7a82 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 8 Jul 2003 13:22:08 +0000 Subject: * A command to query the paths referenced by an fstate expression. * Use a temporary directory for build actions. --- src/fix.cc | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) (limited to 'src/fix.cc') diff --git a/src/fix.cc b/src/fix.cc index 87ce7c775a10..508a441167bc 100644 --- a/src/fix.cc +++ b/src/fix.cc @@ -13,29 +13,6 @@ typedef ATerm Expr; static Expr evalFile(string fileName); -static bool isFState(Expr e, string & path) -{ - char * s1, * s2, * s3; - Expr e1, e2; - if (ATmatch(e, "Path(, , [])", &s1, &e1, &e2)) { - path = s1; - return true; - } - else if (ATmatch(e, "Derive(, , [], , [])", - &s1, &s2, &e1, &s3, &e2)) - { - path = s3; - return true; - } - else if (ATmatch(e, "Include()", &s1)) - { - string fn = queryPathByHash(parseHash(s1)); - return isFState(evalFile(fn), path); - } - else return false; -} - - static Expr substExpr(string x, Expr rep, Expr e) { char * s; @@ -113,8 +90,7 @@ static Expr evalExpr(Expr e) ATmatch(e, "Function([], )", &e1, &e2)) return e; - string dummy; - if (isFState(e, dummy)) return e; + if (fstatePath(e) != "") return e; /* !!! hack */ /* Application. */ if (ATmatch(e, "App(, [])", &e1, &e2)) { @@ -165,8 +141,8 @@ static Expr evalExpr(Expr e) string key = it->first; ATerm value = it->second; - string path; - if (isFState(value, path)) { + string path = fstatePath(value); + if (path != "") { ins = ATinsert(ins, value); env = ATinsert(env, ATmake("(, )", key.c_str(), path.c_str())); -- cgit 1.4.1