2003-07-07 09:43:58 +02:00
|
|
|
#include "fstate.hh"
|
2003-06-16 15:33:38 +02:00
|
|
|
#include "globals.hh"
|
2003-07-07 09:43:58 +02:00
|
|
|
#include "store.hh"
|
2003-06-16 15:33:38 +02:00
|
|
|
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
string printTerm(ATerm t)
|
2003-06-17 15:37:44 +02:00
|
|
|
{
|
2003-06-27 15:55:12 +02:00
|
|
|
char * s = ATwriteToString(t);
|
2003-06-17 15:37:44 +02:00
|
|
|
return s;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-06 16:20:47 +02:00
|
|
|
Error badTerm(const format & f, ATerm t)
|
2003-06-16 15:33:38 +02:00
|
|
|
{
|
2003-06-27 15:55:12 +02:00
|
|
|
return Error(format("%1%, in `%2%'") % f.str() % printTerm(t));
|
2003-06-16 15:33:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
Hash hashTerm(ATerm t)
|
2003-06-16 15:33:38 +02:00
|
|
|
{
|
2003-06-27 15:55:12 +02:00
|
|
|
return hashString(printTerm(t));
|
2003-06-16 15:33:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
ATerm termFromId(const FSId & id)
|
2003-07-04 14:18:06 +02:00
|
|
|
{
|
2003-07-15 18:28:54 +02:00
|
|
|
string path = expandId(id);
|
2003-07-04 14:18:06 +02:00
|
|
|
ATerm t = ATreadFromNamedFile(path.c_str());
|
2003-07-15 18:28:54 +02:00
|
|
|
if (!t) throw Error(format("cannot read aterm from `%1%'") % path);
|
2003-07-04 14:18:06 +02:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-21 22:07:12 +02:00
|
|
|
FSId writeTerm(ATerm t, const string & suffix, FSId id)
|
2003-07-04 14:18:06 +02:00
|
|
|
{
|
2003-07-21 22:07:12 +02:00
|
|
|
/* By default, the id of a term is its hash. */
|
|
|
|
if (id == FSId()) id = hashTerm(t);
|
2003-07-15 18:28:54 +02:00
|
|
|
|
|
|
|
string path = canonPath(nixStore + "/" +
|
|
|
|
(string) id + suffix + ".nix");
|
2003-07-04 14:18:06 +02:00
|
|
|
if (!ATwriteToNamedTextFile(t, path.c_str()))
|
|
|
|
throw Error(format("cannot write aterm %1%") % path);
|
2003-07-15 18:28:54 +02:00
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
// debug(format("written term %1% = %2%") % (string) id %
|
|
|
|
// printTerm(t));
|
2003-07-15 18:28:54 +02:00
|
|
|
|
2003-08-01 17:41:47 +02:00
|
|
|
Transaction txn(nixDB);
|
|
|
|
registerPath(txn, path, id);
|
|
|
|
txn.commit();
|
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
return id;
|
2003-07-04 14:18:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
static void parsePaths(ATermList paths, Strings & out)
|
2003-07-15 18:28:54 +02:00
|
|
|
{
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
while (!ATisEmpty(paths)) {
|
2003-07-15 18:28:54 +02:00
|
|
|
char * s;
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
ATerm t = ATgetFirst(paths);
|
|
|
|
if (!ATmatch(t, "<str>", &s))
|
|
|
|
throw badTerm("not a path", t);
|
|
|
|
out.push_back(s);
|
|
|
|
paths = ATgetNext(paths);
|
2003-07-15 18:28:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
static void checkSlice(const Slice & slice)
|
|
|
|
{
|
|
|
|
if (slice.elems.size() == 0)
|
|
|
|
throw Error("empty slice");
|
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
StringSet decl;
|
2003-07-20 21:29:38 +02:00
|
|
|
for (SliceElems::const_iterator i = slice.elems.begin();
|
|
|
|
i != slice.elems.end(); i++)
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
decl.insert(i->path);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
for (Strings::const_iterator i = slice.roots.begin();
|
2003-07-20 21:29:38 +02:00
|
|
|
i != slice.roots.end(); i++)
|
|
|
|
if (decl.find(*i) == decl.end())
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
throw Error(format("undefined root path `%1%'") % *i);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
|
|
|
for (SliceElems::const_iterator i = slice.elems.begin();
|
|
|
|
i != slice.elems.end(); i++)
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
for (Strings::const_iterator j = i->refs.begin();
|
2003-07-20 21:29:38 +02:00
|
|
|
j != i->refs.end(); j++)
|
|
|
|
if (decl.find(*j) == decl.end())
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
throw Error(
|
|
|
|
format("undefined path `%1%' referenced by `%2%'")
|
|
|
|
% *j % i->path);
|
2003-07-20 21:29:38 +02:00
|
|
|
}
|
2003-07-16 22:33:29 +02:00
|
|
|
|
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
/* Parse a slice. */
|
2003-07-20 21:29:38 +02:00
|
|
|
static bool parseSlice(ATerm t, Slice & slice)
|
2003-07-15 18:28:54 +02:00
|
|
|
{
|
|
|
|
ATermList roots, elems;
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
if (!ATmatch(t, "Slice([<list>], [<list>])", &roots, &elems))
|
|
|
|
return false;
|
2003-07-15 18:28:54 +02:00
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
parsePaths(roots, slice.roots);
|
2003-07-15 18:28:54 +02:00
|
|
|
|
|
|
|
while (!ATisEmpty(elems)) {
|
|
|
|
char * s1, * s2;
|
|
|
|
ATermList refs;
|
|
|
|
ATerm t = ATgetFirst(elems);
|
|
|
|
if (!ATmatch(t, "(<str>, <str>, [<list>])", &s1, &s2, &refs))
|
|
|
|
throw badTerm("not a slice element", t);
|
|
|
|
SliceElem elem;
|
|
|
|
elem.path = s1;
|
|
|
|
elem.id = parseHash(s2);
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
parsePaths(refs, elem.refs);
|
2003-07-15 18:28:54 +02:00
|
|
|
slice.elems.push_back(elem);
|
|
|
|
elems = ATgetNext(elems);
|
|
|
|
}
|
|
|
|
|
2003-07-16 22:33:29 +02:00
|
|
|
checkSlice(slice);
|
2003-07-20 21:29:38 +02:00
|
|
|
return true;
|
2003-07-15 18:28:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
static bool parseDerive(ATerm t, Derive & derive)
|
2003-07-15 23:24:05 +02:00
|
|
|
{
|
2003-08-15 14:32:37 +02:00
|
|
|
ATermList outs, ins, args, bnds;
|
2003-07-15 18:28:54 +02:00
|
|
|
char * builder;
|
|
|
|
char * platform;
|
2003-07-15 23:24:05 +02:00
|
|
|
|
2003-08-15 14:32:37 +02:00
|
|
|
if (!ATmatch(t, "Derive([<list>], [<list>], <str>, <str>, [<list>], [<list>])",
|
|
|
|
&outs, &ins, &platform, &builder, &args, &bnds))
|
|
|
|
{
|
|
|
|
/* !!! compatibility -> remove eventually */
|
|
|
|
if (!ATmatch(t, "Derive([<list>], [<list>], <str>, <str>, [<list>])",
|
|
|
|
&outs, &ins, &builder, &platform, &bnds))
|
|
|
|
return false;
|
|
|
|
args = ATempty;
|
|
|
|
}
|
2003-07-15 18:28:54 +02:00
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
while (!ATisEmpty(outs)) {
|
|
|
|
char * s1, * s2;
|
|
|
|
ATerm t = ATgetFirst(outs);
|
|
|
|
if (!ATmatch(t, "(<str>, <str>)", &s1, &s2))
|
|
|
|
throw badTerm("not a derive output", t);
|
|
|
|
derive.outputs.push_back(DeriveOutput(s1, parseHash(s2)));
|
|
|
|
outs = ATgetNext(outs);
|
2003-07-15 18:28:54 +02:00
|
|
|
}
|
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
while (!ATisEmpty(ins)) {
|
|
|
|
char * s;
|
|
|
|
ATerm t = ATgetFirst(ins);
|
|
|
|
if (!ATmatch(t, "<str>", &s))
|
|
|
|
throw badTerm("not an id", t);
|
|
|
|
derive.inputs.push_back(parseHash(s));
|
|
|
|
ins = ATgetNext(ins);
|
|
|
|
}
|
2003-07-15 18:28:54 +02:00
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
derive.builder = builder;
|
|
|
|
derive.platform = platform;
|
|
|
|
|
2003-08-15 14:32:37 +02:00
|
|
|
while (!ATisEmpty(args)) {
|
|
|
|
char * s;
|
|
|
|
ATerm arg = ATgetFirst(args);
|
|
|
|
if (!ATmatch(arg, "<str>", &s))
|
|
|
|
throw badTerm("string expected", arg);
|
|
|
|
derive.args.push_back(s);
|
|
|
|
args = ATgetNext(args);
|
|
|
|
}
|
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
while (!ATisEmpty(bnds)) {
|
|
|
|
char * s1, * s2;
|
|
|
|
ATerm bnd = ATgetFirst(bnds);
|
|
|
|
if (!ATmatch(bnd, "(<str>, <str>)", &s1, &s2))
|
|
|
|
throw badTerm("tuple of strings expected", bnd);
|
2003-07-20 21:29:38 +02:00
|
|
|
derive.env.push_back(StringPair(s1, s2));
|
2003-07-15 18:28:54 +02:00
|
|
|
bnds = ATgetNext(bnds);
|
|
|
|
}
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
return true;
|
2003-07-15 18:28:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
FState parseFState(ATerm t)
|
2003-07-16 13:05:59 +02:00
|
|
|
{
|
2003-07-20 21:29:38 +02:00
|
|
|
FState fs;
|
|
|
|
if (parseSlice(t, fs.slice))
|
|
|
|
fs.type = FState::fsSlice;
|
|
|
|
else if (parseDerive(t, fs.derive))
|
|
|
|
fs.type = FState::fsDerive;
|
|
|
|
else throw badTerm("not an fstate-expression", t);
|
|
|
|
return fs;
|
2003-07-16 13:05:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
static ATermList unparsePaths(const Strings & paths)
|
2003-07-15 23:24:05 +02:00
|
|
|
{
|
2003-07-20 21:29:38 +02:00
|
|
|
ATermList l = ATempty;
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
for (Strings::const_iterator i = paths.begin();
|
|
|
|
i != paths.end(); i++)
|
|
|
|
l = ATinsert(l, ATmake("<str>", i->c_str()));
|
2003-07-20 21:29:38 +02:00
|
|
|
return ATreverse(l);
|
2003-07-15 23:24:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
static ATerm unparseSlice(const Slice & slice)
|
2003-07-15 18:28:54 +02:00
|
|
|
{
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
ATermList roots = unparsePaths(slice.roots);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
|
|
|
ATermList elems = ATempty;
|
2003-07-15 23:24:05 +02:00
|
|
|
for (SliceElems::const_iterator i = slice.elems.begin();
|
2003-07-15 18:28:54 +02:00
|
|
|
i != slice.elems.end(); i++)
|
2003-07-20 21:29:38 +02:00
|
|
|
elems = ATinsert(elems,
|
|
|
|
ATmake("(<str>, <str>, <term>)",
|
|
|
|
i->path.c_str(),
|
|
|
|
((string) i->id).c_str(),
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
unparsePaths(i->refs)));
|
2003-07-15 18:28:54 +02:00
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
return ATmake("Slice(<term>, <term>)", roots, elems);
|
2003-07-15 18:28:54 +02:00
|
|
|
}
|
2003-07-16 00:28:27 +02:00
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
static ATerm unparseDerive(const Derive & derive)
|
2003-07-16 00:28:27 +02:00
|
|
|
{
|
2003-07-20 21:29:38 +02:00
|
|
|
ATermList outs = ATempty;
|
|
|
|
for (DeriveOutputs::const_iterator i = derive.outputs.begin();
|
|
|
|
i != derive.outputs.end(); i++)
|
|
|
|
outs = ATinsert(outs,
|
|
|
|
ATmake("(<str>, <str>)",
|
|
|
|
i->first.c_str(), ((string) i->second).c_str()));
|
2003-07-16 00:28:27 +02:00
|
|
|
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
ATermList ins = ATempty;
|
|
|
|
for (FSIds::const_iterator i = derive.inputs.begin();
|
|
|
|
i != derive.inputs.end(); i++)
|
|
|
|
ins = ATinsert(ins, ATmake("<str>", ((string) *i).c_str()));
|
|
|
|
|
2003-08-15 14:32:37 +02:00
|
|
|
ATermList args = ATempty;
|
|
|
|
for (Strings::const_iterator i = derive.args.begin();
|
|
|
|
i != derive.args.end(); i++)
|
|
|
|
args = ATinsert(args, ATmake("<str>", i->c_str()));
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
ATermList env = ATempty;
|
|
|
|
for (StringPairs::const_iterator i = derive.env.begin();
|
|
|
|
i != derive.env.end(); i++)
|
|
|
|
env = ATinsert(env,
|
|
|
|
ATmake("(<str>, <str>)",
|
|
|
|
i->first.c_str(), i->second.c_str()));
|
2003-07-16 00:28:27 +02:00
|
|
|
|
2003-08-15 14:32:37 +02:00
|
|
|
return ATmake("Derive(<term>, <term>, <str>, <str>, <term>, <term>)",
|
2003-07-20 21:29:38 +02:00
|
|
|
ATreverse(outs),
|
* Change the abstract syntax of slices. It used to be that ids were used as
keys to reference slice elements, e.g.,
Slice(["1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["8c99..."]), ...])
This was wrong, since ids represent contents, not locations. Therefore we
now have:
Slice(["/nix/store/1ef7..."], [("/nix/store/1ef7...-foo", "1ef7", ["/nix/store/8c99-..."]), ...])
* Fix a bug in the computation of slice closures that could cause slice
elements to be duplicated.
2003-08-20 14:39:56 +02:00
|
|
|
ATreverse(ins),
|
2003-07-20 21:29:38 +02:00
|
|
|
derive.platform.c_str(),
|
2003-08-15 14:32:37 +02:00
|
|
|
derive.builder.c_str(),
|
|
|
|
ATreverse(args),
|
2003-07-20 21:29:38 +02:00
|
|
|
ATreverse(env));
|
2003-07-16 00:28:27 +02:00
|
|
|
}
|
2003-07-16 13:05:59 +02:00
|
|
|
|
|
|
|
|
2003-07-20 21:29:38 +02:00
|
|
|
ATerm unparseFState(const FState & fs)
|
2003-07-16 13:05:59 +02:00
|
|
|
{
|
2003-07-20 21:29:38 +02:00
|
|
|
if (fs.type == FState::fsSlice)
|
|
|
|
return unparseSlice(fs.slice);
|
|
|
|
else if (fs.type == FState::fsDerive)
|
|
|
|
return unparseDerive(fs.derive);
|
|
|
|
else abort();
|
2003-07-16 13:05:59 +02:00
|
|
|
}
|