Compare commits

...

9 Commits

Author SHA1 Message Date
Eelco Dolstra
dda773ddc4 * Tag Nix 0.10.1. 2006-10-11 13:35:54 +00:00
Eelco Dolstra
e30789d084 2006-10-11 11:02:41 +00:00
Eelco Dolstra
a185b07a67 2006-10-11 11:02:11 +00:00
Eelco Dolstra
6f7efe438c * Release notes. 2006-10-11 10:56:35 +00:00
Eelco Dolstra
4f5be16ca4 * Merge r6688 from the trunk. 2006-10-11 10:46:12 +00:00
Eelco Dolstra
6a64ca413d * Bump the version number to 0.10.1. 2006-10-10 15:11:15 +00:00
Eelco Dolstra
47f2e407be * Merged r6683 from the trunk. 2006-10-10 15:10:41 +00:00
Eelco Dolstra
3c11534341 * Create a 0.10 maintenance branch. 2006-10-10 15:09:33 +00:00
Eelco Dolstra
9962197fc5 * Release branch for 0.10. 2006-10-06 10:00:13 +00:00
4 changed files with 44 additions and 28 deletions

View File

@@ -1,11 +1,11 @@
AC_INIT(nix, 0.10)
AC_INIT(nix, 0.10.1)
AC_CONFIG_SRCDIR(README)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
# Change to `1' to produce a `stable' release (i.e., the `preREVISION'
# suffix is not added).
STABLE=0
STABLE=1
# Put the revision number in the version.
if test "$STABLE" != "1"; then

View File

@@ -5,6 +5,18 @@
<!--==================================================================-->
<section><title>Release 0.10.1 (October 11, 2006)</title>
<para>This release fixes two somewhat obscure bugs that occur when
evaluating Nix expressions that are stored inside the Nix store
(<literal>NIX-67</literal>). These do not affect most users.</para>
</section>
<!--==================================================================-->
<section><title>Release 0.10 (October 6, 2006)</title>

View File

@@ -244,9 +244,11 @@ string coerceToStringWithContext(EvalState & state,
e = evalExpr(state, e);
bool isWrapped = false;
ATermList es;
ATerm e2;
if (matchContext(e, es, e2)) {
isWrapped = true;
e = e2;
context = ATconcat(es, context);
}
@@ -258,7 +260,7 @@ string coerceToStringWithContext(EvalState & state,
if (matchPath(e, s)) {
isPath = true;
Path path = aterm2String(s);
if (isInStore(path)) {
if (isInStore(path) && !isWrapped) {
context = ATinsert(context, makePath(toATerm(toStorePath(path))));
}
return path;
@@ -295,16 +297,18 @@ static ATerm concatStrings(EvalState & state, const ATermVector & args)
std::ostringstream s;
bool isPath = false;
/* Note that if the first argument in the concatenation is a path,
then the result is also a path. */
for (ATermVector::const_iterator i = args.begin(); i != args.end(); ++i) {
bool isPath2;
s << coerceToStringWithContext(state, context, *i, isPath2);
if (i == args.begin()) isPath = isPath2;
}
Expr result = isPath
return wrapInContext(context, isPath
? makePath(toATerm(canonPath(s.str())))
: makeStr(toATerm(s.str()));
return wrapInContext(context, result);
: makeStr(toATerm(s.str())));
}

View File

@@ -13,6 +13,16 @@
namespace nix {
static Expr unwrapContext(EvalState & state, Expr e, ATermList & context)
{
context = ATempty;
e = evalExpr(state, e);
if (matchContext(e, context, e))
e = evalExpr(state, e);
return e;
}
static Expr primBuiltins(EvalState & state, const ATermVector & args)
{
/* Return an attribute set containing all primops. This allows
@@ -43,8 +53,9 @@ static Expr primImport(EvalState & state, const ATermVector & args)
{
ATermList es;
Path path;
Expr arg = evalExpr(state, args[0]), arg2;
ATermList context; /* don't care the context */
Expr arg = unwrapContext(state, args[0], context), arg2;
if (matchPath(arg, arg2))
path = aterm2String(arg2);
@@ -67,7 +78,7 @@ static Expr primImport(EvalState & state, const ATermVector & args)
}
}
else throw TypeError("`import' requires a path or derivation as its argument");
else throw TypeError(format("argument of `import' is %1% while a path or derivation is required") % showType(arg));
return evalFile(state, path);
}
@@ -148,8 +159,15 @@ void toString(EvalState & state, Expr e,
else if (matchPath(e, s)) {
Path path(canonPath(aterm2String(s)));
if (!isInStore(path)) {
if (isStorePath(path) || (isWrapped && isInStore(path))) {
result += path;
/* !!! smells hacky. Check whether this is the Right
Thing To Do. */
if (!isWrapped)
context = ATinsert(context, makePath(toATerm(toStorePath(path))));
}
else {
if (isDerivation(path))
throw EvalError(format("file names are not allowed to end in `%1%'")
% drvExtension);
@@ -167,14 +185,6 @@ void toString(EvalState & state, Expr e,
result += dstPath;
context = ATinsert(context, makePath(toATerm(dstPath)));
}
else {
result += path;
/* !!! smells hacky. Check whether this is the Right
Thing To Do. */
if (!isWrapped)
context = ATinsert(context, makePath(toATerm(toStorePath(path))));
}
}
else if (matchList(e, es)) {
@@ -513,16 +523,6 @@ static Expr primToXML(EvalState & state, const ATermVector & args)
}
static Expr unwrapContext(EvalState & state, Expr e, ATermList & context)
{
context = ATempty;
e = evalExpr(state, e);
if (matchContext(e, context, e))
e = evalExpr(state, e);
return e;
}
/* Store a string in the Nix store as a source file that can be used
as an input by derivations. */
static Expr primToFile(EvalState & state, const ATermVector & args)